Skip to content

Commit 8f3ed0e

Browse files
authored
Merge pull request #140 from abstractfactory/implement139
Implement #139
2 parents d13543a + 87d57aa commit 8f3ed0e

File tree

4 files changed

+236
-178
lines changed

4 files changed

+236
-178
lines changed

CAVEATS.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,21 @@ AttributeError: 'PySide.QtGui.QHeaderView' object has no attribute 'setSectionRe
254254

255255
##### Workaround
256256

257-
Use a conditional.
257+
Use compatibility wrapper.
258258

259259
```python
260260
# PySide2
261+
>>> from Qt import QtWidgets, QtCompat
262+
>>> app = QtWidgets.QApplication(sys.argv)
263+
>>> view = QtWidgets.QTreeWidget()
264+
>>> header = view.header()
265+
>>> QtCompat.setSectionResizeMode(header, QtWidgets.QHeaderView.Fixed)
266+
```
267+
268+
Or a conditional.
269+
270+
```python
271+
# PyQt5
261272
>>> from Qt import QtWidgets, __binding__
262273
>>> app = QtWidgets.QApplication(sys.argv)
263274
>>> view = QtWidgets.QTreeWidget()
@@ -266,5 +277,4 @@ Use a conditional.
266277
... header.setResizeMode(QtWidgets.QHeaderView.Fixed)
267278
... else:
268279
... header.setSectionResizeMode(QtWidgets.QHeaderView.Fixed)
269-
```
270-
280+
```

0 commit comments

Comments
 (0)