[PyQt] Got error with QSplitterHandle

Maurizio Berti maurizio.berti at gmail.com
Sat Jul 13 19:27:10 BST 2019


Il giorno sab 13 lug 2019 alle ore 10:07 Gottfried Müller <
gottfried.mueller at gmx.de> ha scritto:

> TypeError: QSplitterHandle(Qt.Orientation, QSplitter): argument 1 has
> unexpected type 'MySplitter'
>
[...]

> class MySplitterHandle(QSplitterHandle):
>
>      def __init__(self, orientation, parent=None):
>          super().__init__(parent)
>          self.orientation(orientation)
>

The first and mandatory argument of QSplitterHandle init is a
QtCore.Qt.Orientation, not the parent.
See https://doc.qt.io/qt-5/qsplitterhandle.html#QSplitterHandle
Just add the orientation before the parent in the super.

Maurizio

-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net


More information about the PyQt mailing list