Opened 8 years ago

Closed 11 months ago

#279 closed defect (wontfix)

Qt::WindowStaysOnTopHint support

Reported by: KO Myung-Hun Owned by:
Priority: minor Milestone: Qt 5
Component: QtGui Version: 4.7.3
Severity: low Keywords:


Any plans ?

Change History (3)

comment:1 Changed 23 months ago by Silvan Scherrer

Milestone: Qt EnhancedQt 5

comment:2 Changed 20 months ago by Alex Taylor

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 11 months ago by Silvan Scherrer

Resolution: wontfix
Status: newclosed

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

Note: See TracTickets for help on using tickets.