Opened 7 years ago

Closed 6 weeks ago

#279 closed defect (wontfix)

Qt::WindowStaysOnTopHint support

Reported by: komh Owned by:
Priority: minor Milestone: Qt 5
Component: QtGui Version: 4.7.3
Severity: low Keywords:


Any plans ?

Change History (3)

comment:1 Changed 14 months ago by diver

  • Milestone changed from Qt Enhanced to Qt 5

comment:2 Changed 11 months ago by ataylor

I was just looking for this feature and wondering why it didn't work on OS/2. :)

I tried this hack:

#ifdef __OS2__
#define WS_TOPMOST  0x00200000L

    HWND hwnd = WinQueryWindow( winId(), QW_OWNER );
    if ( hwnd )
        WinSetWindowBits( hwnd, QWL_STYLE, isOnTop? WS_TOPMOST: 0L, WS_TOPMOST );

    Qt::WindowFlags flags = windowFlags();
    if ( isOnTop )
        flags |= Qt::WindowStaysOnTopHint;
        flags &= ~Qt::WindowStaysOnTopHint;
    setWindowFlags( flags );

Interestingly, using winId() for the dialog handle did nothing. However, using winId()'s owner 's hwnd does work... sort of.

Unfortunately, while the resulting window does stay on top, context menu events don't get inherited by child windows anymore, and the context menu itself opens behind the dialog, so this does not seem to be a viable workaround. :/

comment:3 Changed 6 weeks ago by diver

  • Resolution set to wontfix
  • Status changed from new to closed

please test with Qt 5 and open at ticket at if it's still an issue.

Note: See TracTickets for help on using tickets.