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. How to create a QWindow that only behave according to MainWindow?
Forum Updated to NodeBB v4.3 + New Features

How to create a QWindow that only behave according to MainWindow?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 521 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.
  • I Offline
    I Offline
    Isolde
    wrote on last edited by
    #1

    For example:
    I have a QMainwindow A and a QWindow B. I want B only moves when A moves, only resize when A resize, only minimize/maximize when A minimize/maximize, etc...

    In fact, I want to write a semi-transparent overlay that contains some animation above a QWidget. I have tried many ways to achieve that but all failed. After reading some documents I found that it is because that QWidget is a window container, and the Qt Doc says that
    0_1524622769737_b64723d4-6270-4030-94ad-eb1b692da9d9-image.png
    So I wonder whether I can use a semi-transparent QWindow placing above the MainWindow as a workaround?

    jsulmJ 1 Reply Last reply
    0
    • I Isolde

      For example:
      I have a QMainwindow A and a QWindow B. I want B only moves when A moves, only resize when A resize, only minimize/maximize when A minimize/maximize, etc...

      In fact, I want to write a semi-transparent overlay that contains some animation above a QWidget. I have tried many ways to achieve that but all failed. After reading some documents I found that it is because that QWidget is a window container, and the Qt Doc says that
      0_1524622769737_b64723d4-6270-4030-94ad-eb1b692da9d9-image.png
      So I wonder whether I can use a semi-transparent QWindow placing above the MainWindow as a workaround?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Isolde To me it sounds like you simply need a QWidget placed on your QMainWindow.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Isolde To me it sounds like you simply need a QWidget placed on your QMainWindow.

        I Offline
        I Offline
        Isolde
        wrote on last edited by
        #3

        @jsulm said in How to create a QWindow that only behave according to MainWindow?:

        @Isolde To me it sounds like you simply need a QWidget placed on your QMainWindow.

        It doesn't work. Please read words above red line on the screenshot. A QWidget from QWidget::createWindowContainer() will always on top, so I cannot put any semi-transparent QWidget above that.

        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