Opened 11 years ago

Closed 5 years 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:
Cc:

Description

Any plans ?

Change History (3)

comment:1 Changed 6 years ago by Silvan Scherrer

Milestone: Qt EnhancedQt 5

comment:2 Changed 5 years 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 );

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

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 5 years ago by Silvan Scherrer

Resolution: wontfix
Status: newclosed

please test with Qt 5 and open at ticket at https://github.com/bitwiseworks/qtbase-os2 if it's still an issue.

Note: See TracTickets for help on using tickets.