Results 1 to 11 of 11

Thread: Qt::WindowStaysOnTopHint not working properly

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2013
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Question Qt::WindowStaysOnTopHint not working properly

    I have a class named BaseDialog which inherits QFrame. All other dialogs inherits BaseDialog. These dialogs contain 3 QGroupBox which inturn contains QLineEdit and QPushButton.
    I used the flag Qt::WindowStaysOnTopHint so that my dialog always remain on top irrespective of the focus.
    This flag didn't work on my system(RHEL 6). So I used the flag Qt::X11BypassWindowManagerHint.
    Above issue was resolved but dialog stopped taking any keyboard input.
    So whenever I enabled my dialog for the first time, i manually activated the dialog using activatewindow().
    As soon as I click outside the dialog, it is deactivated. I reimplemented FocusInEvent(). It is working fine if I click at top. But if I click at QGoupBox or QLineEdit inside that dialog, it is not activated.

    Please tell me is there any way that this problem can be solved without using activateWindow() with each QLineEdit?(As there as many QLineEdits in every dialog )

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Qt::WindowStaysOnTopHint not working properly

    You should focus on this part:
    This flag didn't work on my system(RHEL 6). So I used the flag Qt::X11BypassWindowManagerHint.
    Namely why it didn't work on your system. The system doesn't have much to do with this, it is the window manager that either respects this flag or not. Bypassing the WM completely is probably a bad idea since you loose features such as moving the widget around.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2013
    Posts
    6
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Qt::WindowStaysOnTopHint not working properly

    Sorry, but I meant Window manager only. Even after setting that flag, window didnt stayed at top'. So I used that flag to bypass. (It was suggested in Qt help)

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Qt::WindowStaysOnTopHint not working properly

    What window manager are you using?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 7th December 2011, 00:49
  2. mapToGlobal/mapFromGlobal isn't working properly
    By janderson.daz in forum Qt Programming
    Replies: 7
    Last Post: 13th April 2011, 22:03
  3. memcpy not working properly
    By sattu in forum Qt Programming
    Replies: 3
    Last Post: 26th October 2010, 23:33
  4. ScrollZoomer not working properly..
    By Raghaw in forum Qwt
    Replies: 1
    Last Post: 30th October 2009, 06:51
  5. Replies: 1
    Last Post: 1st June 2006, 23:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.