wxQt: Add support for window modality to TLWs (PR #26137)

19 views
Skip to first unread message

AliKet

unread,
Jan 30, 2026, 7:10:15 PM (2 days ago) Jan 30
to wx-...@googlegroups.com, Subscribed

You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26137

Commit Summary

  • 27ce0ff wxQt: Add QtSetWindowModality() member function to support window modality
  • 52f713a wxQt: Fix applying window modality to wxPreviewFrame
  • 2b7b9bb wxQt: Document wxWindowDisabler(wxWindow*, wxWindow*) ctor limitations

File Changes

(5 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26137@github.com>

AliKet

unread,
Jan 30, 2026, 7:36:19 PM (2 days ago) Jan 30
to wx-...@googlegroups.com, Subscribed
AliKet left a comment (wxWidgets/wxWidgets#26137)

Note to self: make QtSetWindowModality() a non virtual member of wxTLW


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26137/c3826787824@github.com>

AliKet

unread,
Jan 31, 2026, 1:45:06 AM (2 days ago) Jan 31
to wx-...@googlegroups.com, Push

@AliKet pushed 3 commits.

  • 8f38098 wxQt: Add QtSetWindowModality() member function to support window modality
  • d4f5c56 wxQt: Fix applying window modality to wxPreviewFrame
  • 29054fa wxQt: Document wxWindowDisabler(wxWindow*, wxWindow*) ctor limitations


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26137/before/2b7b9bbe6260af9e9c97fb85fcc56b4cc9dd0b66/after/29054faebca30e42370bba7ee473ce55b01928f6@github.com>

VZ

unread,
Jan 31, 2026, 8:38:34 AM (2 days ago) Jan 31
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.

Thanks, I'm ok with merging this, but it looks like this approach points to even better solution: add wxTLW::SetWindowModality() (or maybe ShowWithModality()?) and implement it different for wxQt (using the code from this PR) and the other ports (using the existing wxWindowDisabler-based code from print preview).

Please let me know if you'd like to update this PR to do this or prefer to apply it as is.

Thanks!


In include/wx/qt/toplevel.h:

> @@ -47,6 +47,18 @@ class WXDLLIMPEXP_CORE wxTopLevelWindowQt : public wxTopLevelWindowBase
     virtual void SetWindowStyleFlag( long style ) override;
     virtual long GetWindowStyleFlag() const override;
 
+    // Values of this enum are synchronized with Qt::WindowModality ones
+    enum wxQtWindowModality

Especially if we make this enum public (in wxTLW), I'd make it a scoped enum called just Modality with values None, Window and App.


In src/common/prntbase.cpp:

> @@ -1831,6 +1835,18 @@ void wxPreviewFrame::InitializeWithModality(wxPreviewFrameModalityKind kind)
             // Nothing to do, we don't need to disable any windows.
             break;
     }
+#else // __WXQT__
+    wxQtWindowModality qtWindowModality;
+
+    if ( m_modalityKind == wxPreviewFrame_AppModal )

Minor, but I always prefer using switch for enums, and it would be more consistent with the code above.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26137/review/3732596655@github.com>

AliKet

unread,
Feb 1, 2026, 3:58:56 PM (10 hours ago) Feb 1
to wx-...@googlegroups.com, Subscribed
AliKet left a comment (wxWidgets/wxWidgets#26137)

Thanks, I'm ok with merging this, but it looks like this approach points to even better solution: add wxTLW::SetWindowModality() (or maybe ShowWithModality()?) and implement it different for wxQt (using the code from this PR) and the other ports (using the existing wxWindowDisabler-based code from print preview).

Please let me know if you'd like to update this PR to do this or prefer to apply it as is.

I'am working on this and will push the changes soon...


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26137/c3832021324@github.com>

Reply all
Reply to author
Forward
0 new messages