Skip to content

Dark/Light mode change will no longer work in PySide6 > 6.7.2 #3143

@pijyoi

Description

@pijyoi

In mkQApp(), a UniqueConnection is made to a free-standing function to handle light and dark modes.

def mkQApp(name=None):

This will no longer work in PySide6 > 6.7.2, as UniqueConnection will only be allowed on methods of QObject instances.

An example to demonstrate the change in behavior.
On PySide6 6.7.2, "HELLO" will be printed.
On development versions of PySide6, "HELLO" does not get printed.

from PySide6 import QtCore, QtWidgets

def name_changed(name):
    print('name_changed to', name)

app = QtWidgets.QApplication([])
# conntype = QtCore.Qt.ConnectionType.AutoConnection
conntype = QtCore.Qt.ConnectionType.UniqueConnection
app.objectNameChanged.connect(name_changed, type=conntype)
app.objectNameChanged.connect(name_changed, type=conntype)
app.dumpObjectInfo()
app.setObjectName('HELLO')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions