1 # -*- coding: utf-8 -*-
3 # Copyright © The Spyder Development Team
5 # Licensed under the terms of the MIT License
6 # (see LICENSE.txt for details)
9 def introduce_renamed_methods_qheaderview(QHeaderView
):
11 _isClickable
= QHeaderView
.isClickable
12 def sectionsClickable(self
):
14 QHeaderView.sectionsClickable() -> bool
16 return _isClickable(self
)
17 QHeaderView
.sectionsClickable
= sectionsClickable
18 def isClickable(self
):
19 warnings
.warn('isClickable is only available in Qt4. Use '
20 'sectionsClickable instead.', stacklevel
=2)
21 return _isClickable(self
)
22 QHeaderView
.isClickable
= isClickable
25 _isMovable
= QHeaderView
.isMovable
26 def sectionsMovable(self
):
28 QHeaderView.sectionsMovable() -> bool
30 return _isMovable(self
)
31 QHeaderView
.sectionsMovable
= sectionsMovable
33 warnings
.warn('isMovable is only available in Qt4. Use '
34 'sectionsMovable instead.', stacklevel
=2)
35 return _isMovable(self
)
36 QHeaderView
.isMovable
= isMovable
39 _resizeMode
= QHeaderView
.resizeMode
40 def sectionResizeMode(self
, logicalIndex
):
42 QHeaderView.sectionResizeMode(int) -> QHeaderView.ResizeMode
44 return _resizeMode(self
, logicalIndex
)
45 QHeaderView
.sectionResizeMode
= sectionResizeMode
46 def resizeMode(self
, logicalIndex
):
47 warnings
.warn('resizeMode is only available in Qt4. Use '
48 'sectionResizeMode instead.', stacklevel
=2)
49 return _resizeMode(self
, logicalIndex
)
50 QHeaderView
.resizeMode
= resizeMode
52 _setClickable
= QHeaderView
.setClickable
53 def setSectionsClickable(self
, clickable
):
55 QHeaderView.setSectionsClickable(bool)
57 return _setClickable(self
, clickable
)
58 QHeaderView
.setSectionsClickable
= setSectionsClickable
59 def setClickable(self
, clickable
):
60 warnings
.warn('setClickable is only available in Qt4. Use '
61 'setSectionsClickable instead.', stacklevel
=2)
62 return _setClickable(self
, clickable
)
63 QHeaderView
.setClickable
= setClickable
66 _setMovable
= QHeaderView
.setMovable
67 def setSectionsMovable(self
, movable
):
69 QHeaderView.setSectionsMovable(bool)
71 return _setMovable(self
, movable
)
72 QHeaderView
.setSectionsMovable
= setSectionsMovable
73 def setMovable(self
, movable
):
74 warnings
.warn('setMovable is only available in Qt4. Use '
75 'setSectionsMovable instead.', stacklevel
=2)
76 return _setMovable(self
, movable
)
77 QHeaderView
.setMovable
= setMovable
80 _setResizeMode
= QHeaderView
.setResizeMode
81 def setSectionResizeMode(self
, *args
):
83 QHeaderView.setSectionResizeMode(QHeaderView.ResizeMode)
84 QHeaderView.setSectionResizeMode(int, QHeaderView.ResizeMode)
86 _setResizeMode(self
, *args
)
87 QHeaderView
.setSectionResizeMode
= setSectionResizeMode
88 def setResizeMode(self
, *args
):
89 warnings
.warn('setResizeMode is only available in Qt4. Use '
90 'setSectionResizeMode instead.', stacklevel
=2)
91 _setResizeMode(self
, *args
)
92 QHeaderView
.setResizeMode
= setResizeMode