File tree Expand file tree Collapse file tree 4 files changed +236
-178
lines changed Expand file tree Collapse file tree 4 files changed +236
-178
lines changed Original file line number Diff line number Diff 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+ ```
You can’t perform that action at this time.
0 commit comments