mottosso / Qt.py

Minimal Python 2 & 3 shim around all Qt bindings - PySide, PySide2, PyQt4 and PyQt5.
MIT License
914 stars 254 forks source link

Qt 6 Transition Guide - new replacement #416

Open Nixellion opened 3 months ago

Nixellion commented 3 months ago

Found another thing that changed:

QPalette.Background was long obsolete, but now using it causes an error, has to be replaced with QPalette.ColorRole.Window. And all calls to QPallete.X should go to QPalette.ColorRole.

At least in my code specifically I had this:

palette = QtGui.QPalette(self.palette())
palette.setColor(palette.Background QtCore.Qt.transparent)

And it was breaking the code and showing an error.

Replacing it with:

palette = QtGui.QPalette(self.palette())
palette.setColor(palette.ColorRole.Window, QtCore.Qt.transparent)

Fixed the problem.

mottosso commented 3 months ago

Thanks for this, any chance you can put this in the README towards the bottom with the other transition notes?