Skip to content

Comments

Qt 6.8 preparation: Qt::UniqueConnection can only be used with QObject member functions#25343

Merged
cbjeukendrup merged 1 commit intomusescore:masterfrom
cbjeukendrup:qt68_prep/unique_connection
Apr 30, 2025
Merged

Qt 6.8 preparation: Qt::UniqueConnection can only be used with QObject member functions#25343
cbjeukendrup merged 1 commit intomusescore:masterfrom
cbjeukendrup:qt68_prep/unique_connection

Conversation

@cbjeukendrup
Copy link
Collaborator

@cbjeukendrup cbjeukendrup commented Oct 27, 2024

This has been the case always, but only since a few Qt versions it causes an assertion failure.

This is my quick-and-dirty fix cherry-picked from #25016. I'm not sure if it is the simplest/cleanest thing we can do, but it is the closest equivalent to a capturing lambda.

@Eism I'm aware that this may be obsoleted by your work on the KDDockWidgets 2.1 update; if that's the case, feel free to close this!

Resolves: #24716
Resolves: #25307

@cbjeukendrup cbjeukendrup requested a review from Eism October 27, 2024 20:06
@cbjeukendrup cbjeukendrup force-pushed the qt68_prep/unique_connection branch from 4cad687 to 933434f Compare April 30, 2025 14:43
alignTopLevelToolBars(page);

if (!m_pageConnections.contains(page)) {
m_pageConnections[page] = new UniqueConnectionHolder(page, this);
Copy link
Contributor

@igorkorsukov igorkorsukov Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are they deleted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the QObject destructor of the DockWindow :)
(because we set the parent to this, and the QObject destructor deletes child objects)

@cbjeukendrup cbjeukendrup merged commit 3ecccdc into musescore:master Apr 30, 2025
12 checks passed
@cbjeukendrup cbjeukendrup deleted the qt68_prep/unique_connection branch April 30, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants