travis: run pylint on python2.7 only
[git-cola.git] / qtpy / _patch / qheaderview.py
blobb6baddbb22b49a81df63faeba52fe255c715a8ec
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)
7 import warnings
9 def introduce_renamed_methods_qheaderview(QHeaderView):
11 _isClickable = QHeaderView.isClickable
12 def sectionsClickable(self):
13 """
14 QHeaderView.sectionsClickable() -> bool
15 """
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):
27 """
28 QHeaderView.sectionsMovable() -> bool
29 """
30 return _isMovable(self)
31 QHeaderView.sectionsMovable = sectionsMovable
32 def isMovable(self):
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):
41 """
42 QHeaderView.sectionResizeMode(int) -> QHeaderView.ResizeMode
43 """
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):
54 """
55 QHeaderView.setSectionsClickable(bool)
56 """
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):
68 """
69 QHeaderView.setSectionsMovable(bool)
70 """
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):
82 """
83 QHeaderView.setSectionResizeMode(QHeaderView.ResizeMode)
84 QHeaderView.setSectionResizeMode(int, QHeaderView.ResizeMode)
85 """
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