Skip to content

Qt 6 Transition Guide - new replacement #416

@Nixellion

Description

@Nixellion

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions