Results 1 to 8 of 8

Thread: QT bug? Or win 7?

  1. #1
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default QT bug? Or win 7?

    I have a widget with these flags and attributes:
    Qt Code:
    1. setWindowFlags(Qt::SubWindow | Qt::FramelessWindowHint );
    2. setTransformationAnchor(QGraphicsView::AnchorViewCenter);
    3.  
    4. this->setAttribute(Qt::WA_TranslucentBackground);
    5. this->setAttribute(Qt::WA_TransparentForMouseEvents);
    To copy to clipboard, switch view to plain text mode 
    To make the window always on top:
    Qt Code:
    1. setWindowFlags(Qt::FramelessWindowHint | Qt::SubWindow | Qt::WindowStaysOnTopHint);
    To copy to clipboard, switch view to plain text mode 
    So when the app runs, the window is on top of every other window, but as soon as I click any other window it goes behind the windowI clicked.
    Why this behaviour?

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

    Default Re: QT bug? Or win 7?

    Why did you use Qt::SubWindow? What happens if you omit it?
    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
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QT bug? Or win 7?

    I use Qt::SubWindow so the widget wont have a icon on the taskbar. The widget is a child of another widget.

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

    Default Re: QT bug? Or win 7?

    Let me guess... if you leave this flag out, the window behaves as expected, right?
    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.


  5. #5
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QT bug? Or win 7?

    No everything continues the same.

  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT bug? Or win 7?

    So you want the window on top of the Z-order regardless of clicking any other window ?

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

    Default Re: QT bug? Or win 7?

    Does your widget inherit QDialog?
    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.


  8. #8
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QT bug? Or win 7?

    So you want the window on top of the Z-order regardless of clicking any other window ?
    Yes. That should work using Qt::WindowStaysOnTopHint. And normally it does.
    Does your widget inherit QDialog?
    No. It's a QWidget.

    I created this app in windows Vista 32bit and never had this trouble. Only after compiling in Windows 7 64bit that this ocurred.

    More explanation:
    My app has a checkbox to enable/disable Qt::WindowStaysOnTopHint. The first time Qt::WindowStaysOnTopHint is set via setWindowFlags(), if I click any other window, it suddenly goes behind it(almost as if Qt::WindowStaysOnTopHint was removed). But then if I check the control checkbox(triggers a slot that -> setWindowFlags(Qt::WindowStaysOnTopHint)) the widget behaves as expected staying on top of any window.

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.