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. Set frameless widget over the main window

Set frameless widget over the main window

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 1.6k 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.
  • M Offline
    M Offline
    Mr Gisa
    wrote on last edited by Mr Gisa
    #1

    I created a custom widget with Qt::FramelessWindowHint | Qt::Tool as flags and I'm moving it using move and show and hide methods to control position and display but I noticed that in linux the widget is not over the main window but under it, how can I set this frameless widget to be over the main window? It works fine on Windows.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Make sure you set its parent and see if
      setWindowFlags(Qt::WindowStaysOnTopHint);
      helps

      1 Reply Last reply
      1
      • M Offline
        M Offline
        Mr Gisa
        wrote on last edited by Mr Gisa
        #3

        @mrjj I fixed the question, it's not another window. I did what you said and it appears multiple windows on the taskbar and on Linux it highlights the widget as it was another window.

        mrjjM 1 Reply Last reply
        0
        • M Mr Gisa

          @mrjj I fixed the question, it's not another window. I did what you said and it appears multiple windows on the taskbar and on Linux it highlights the widget as it was another window.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Mr-Gisa
          Ah sorry. missed that.
          so its inside the mainwindow?
          but drawn behind all the other stuff or ?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Mr Gisa
            wrote on last edited by
            #5

            Yes, it's inside the MainWindow, a regular QWidget with a background and a size that I want to move around with move but it's not over the MainWindow on Linux only on Windows.

            mrjjM 1 Reply Last reply
            0
            • M Mr Gisa

              Yes, it's inside the MainWindow, a regular QWidget with a background and a size that I want to move around with move but it's not over the MainWindow on Linux only on Windows.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Mr-Gisa
              You can try to call raise() on it
              http://doc.qt.io/qt-5/qwidget.html#raise

              1 Reply Last reply
              1
              • M Offline
                M Offline
                Mr Gisa
                wrote on last edited by
                #7

                Never mind, I solved it using: Qt::FramelessWindowHint | Qt::Tool | Qt::WindowStaysOnTopHint.

                Your hint about Qt::WindowStaysOnTopHint saved the day. Thank you.

                1 Reply Last reply
                1

                • Login

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