Skip to content

CURA-13376 Make sure all the dialogs are handled the proper way - #1066

Merged
HellAholic merged 4 commits into
5.14from
CURA-13376-some-dialog-not-centered-on-linux
Oct 28, 2026
Merged

HellAholic merged 4 commits into
5.14from
CURA-13376-some-dialog-not-centered-on-linux

Conversation

@wawanbreton

@wawanbreton Erwan MATHIEU (wawanbreton) commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

We recently introduced new mechanisms to make sure all the dialogs in the front-end are created, displayed and destroyed the same way. This PR ensures all the remaining dialogs are now processed properly. This also ensures that the dialog-centering hack on Linux works for all of them.

  • Make the QtApplication singleton accessible to QML
  • Add a mainWindow property to the QtApplication
  • Make UM.Dialog take the main window as transient parent by default, so that modality and centering always work

Comes with Ultimaker/Cura#21876
CURA-13376

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

2 404 tests  ±0   2 389 ✅ ±0   22s ⏱️ -1s
    1 suites ±0      15 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 46562ae. ± Comparison against base commit 57054bc.

♻️ This comment has been updated with latest results.

CURA-13376
We now set the transient parent on the top-level Dialog item, so that it does not require being created through createQmlSubWindow anymore. This is useful for dialogs that are created from QML.
@wawanbreton
Erwan MATHIEU (wawanbreton) marked this pull request as ready for review October 26, 2026 16:02
Copilot AI balanced review requested due to automatic review settings October 26, 2026 16:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The constant main-window property prevents surviving dialogs from updating their transient parent after a QML reload.

1 open issue
What changed in this PR

Standardizes dialog parenting in Uranium to support consistent modality and Linux centering, complementing the dialog lifecycle updates in Cura PR #21876.

Changes:

  • Exposes QtApplication and its main window to QML.
  • Moves default transient parenting from createQmlSubWindow() into UM.Dialog.
File Description
UM/​Qt/​QtApplication.py Exposes the application and main-window property; removes explicit subwindow parenting.
UM/​Qt/​qml/​UM/​Dialog.qml Binds the default transient parent to the application's main window.

Review effort: Balanced

Comment thread UM/Qt/QtApplication.py Resolved

@rburema R. Burema (rburema) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM; I have a suggestion though (except I didn't test that).

Comment thread UM/Qt/qml/UM/Dialog.qml Resolved
@rburema

Copy link
Copy Markdown
Member

Also; I think exposing QtApplication like this could have more advantage than just in this ticket -- I remember struggling with something lately that would've benefitted from a reference to the main app. Maybe worth searching for cases like that? (Or at least keep it in mind.)

CURA-13376
When using `data`, we can also set non-visual children elements, so now we don't have to declare a top-level Item for the dialogs that have various children.
As suggested by @rburema
@wawanbreton

Copy link
Copy Markdown
Contributor Author

Also; I think exposing QtApplication like this could have more advantage than just in this ticket -- I remember struggling with something lately that would've benefitted from a reference to the main app. Maybe worth searching for cases like that? (Or at least keep it in mind.)

There was a case exactly like that indeed, where we could definitely have done that... So to keep in mind indeed, however at some point Uranium will merge into Cura, and that will be obsolete...

Pin development dependencies pytest to 9.1.1 and pytest-benchmark to 5.3.0.
@HellAholic
HellAholic merged commit fe860a2 into 5.14 Oct 28, 2026
14 checks passed
@HellAholic
HellAholic deleted the CURA-13376-some-dialog-not-centered-on-linux branch October 28, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants