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. Widget stays on top of the qt application
Forum Updated to NodeBB v4.3 + New Features

Widget stays on top of the qt application

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 452 Views 1 Watching
  • 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.
  • T Offline
    T Offline
    TanteDroll
    wrote on last edited by
    #1

    Hi everyone,
    i have currently the following problem:

    I have two QMainWindows 'A' and 'B' which both have no parent so they are independent widgets. Now i have a third non modal widget 'C' which should stay on top of widget A and B.

    Is there any way to tell a widget to stay on top of all other widgets but only of this application? I only found the flag Qt::WindowStaysOnTopHint but by unsing this flag the widget will stay on top of every other window of other application too.

    JonBJ 1 Reply Last reply
    0
    • T TanteDroll

      Hi everyone,
      i have currently the following problem:

      I have two QMainWindows 'A' and 'B' which both have no parent so they are independent widgets. Now i have a third non modal widget 'C' which should stay on top of widget A and B.

      Is there any way to tell a widget to stay on top of all other widgets but only of this application? I only found the flag Qt::WindowStaysOnTopHint but by unsing this flag the widget will stay on top of every other window of other application too.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @TanteDroll
      Do you need 2 QMainWindows (or any other QWidget, there is nothing special about QMainWindow)? Did you consider, say, one QMainWindow holding a QStackedWidget for your current other two widgets?

      T 1 Reply Last reply
      0
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by Chris Kawa
        #3

        The only mean to control this is via parent-child relation but a widget can't have two parents so there's no direct way to do this.
        Some workarounds would be to have one main window become a parent of the other. Another one could be switching parent main window e.g. when any of them gets focus or some such tricks.

        T 1 Reply Last reply
        4
        • JonBJ JonB

          @TanteDroll
          Do you need 2 QMainWindows (or any other QWidget, there is nothing special about QMainWindow)? Did you consider, say, one QMainWindow holding a QStackedWidget for your current other two widgets?

          T Offline
          T Offline
          TanteDroll
          wrote on last edited by
          #4

          @JonB Yes in this case it is necessary but thank you for your reply

          1 Reply Last reply
          0
          • Chris KawaC Chris Kawa

            The only mean to control this is via parent-child relation but a widget can't have two parents so there's no direct way to do this.
            Some workarounds would be to have one main window become a parent of the other. Another one could be switching parent main window e.g. when any of them gets focus or some such tricks.

            T Offline
            T Offline
            TanteDroll
            wrote on last edited by
            #5

            @Chris-Kawa Ok, I wanted to be sure that i diddn't miss any qt option. I guess i have to make a concept to assign the parent dynamicly. Thanks for the help.

            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