Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt::WindowStaysOnTopHint and full screen
Forum Updated to NodeBB v4.3 + New Features

Qt::WindowStaysOnTopHint and full screen

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 571 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Francky033
    wrote on last edited by
    #1

    Hello,

    I have a small problem with using Qt::WindowStaysOnTopHin in full screen.

    On Windows 10, for example, windows with this flag are always visible on a GPU intel. On the other hand, on a Nvidia card, windows with the Qt::WindowStaysOnTopHint flag go to the background if I click on the main window.
    I need to do a raise() to bring them to the first plan but this has an unsightly effect (screen flickering).

    I also tried with the Qt::WindowStaysOnTopHint flag but it doesn't change anything.

    I use Qt 5.15.0 and Opengl 4.0

    Thanks !

    1 Reply Last reply
    0
    • K Offline
      K Offline
      khryleption
      wrote on last edited by khryleption
      #2

      try using the windows winAPI function SetWindowPos.

      for Qt4.7, maybe it's the same on Qt5

      #ifdef WIN32
      // first force to show widget on top most
      // get win handle of the widget to force focus
      SetWindowPos(widget->winId(), HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME | 
       WP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
      
      // then unforce to show widget on top most
      SetWindowPos(widget->winId(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
      
      #endif
      
      K 1 Reply Last reply
      0
      • K khryleption

        try using the windows winAPI function SetWindowPos.

        for Qt4.7, maybe it's the same on Qt5

        #ifdef WIN32
        // first force to show widget on top most
        // get win handle of the widget to force focus
        SetWindowPos(widget->winId(), HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME | 
         WP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
        
        // then unforce to show widget on top most
        SetWindowPos(widget->winId(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
        
        #endif
        
        K Offline
        K Offline
        khryleption
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved