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 move main window without the following of child window

How to move main window without the following of child window

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 324 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.
  • B Offline
    B Offline
    BelfryCrank
    wrote on last edited by BelfryCrank
    #1

    Here is my code. It is very simple and easy, but I found that when I move the main_window,the child_window will make the same movement. I want child_window remain still when I move main_window,How to realize this? I would be very grateful if someone could tell me.

    import QtQuick 2.14
    import QtQuick.Window 2.14

    Window
    {
    id:main_window
    width: 640
    height: 480
    visible: true
    title: qsTr("main_window")
    Window
    {
    id:child_window
    width: 300
    height: 300
    minimumHeight: 300
    minimumWidth: 300
    visible: true
    title: qsTr("child_window")
    }
    }

    B 1 Reply Last reply
    0
    • B Offline
      B Offline
      BelfryCrank
      wrote on last edited by
      #2

      The environment is Qt6.5.3 with MSCV2019

      1 Reply Last reply
      0
      • jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Child widgets will always move with the parent. If you do not want this then make these child widgets top level windows (without parent).

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

        1 Reply Last reply
        3
        • B BelfryCrank

          Here is my code. It is very simple and easy, but I found that when I move the main_window,the child_window will make the same movement. I want child_window remain still when I move main_window,How to realize this? I would be very grateful if someone could tell me.

          import QtQuick 2.14
          import QtQuick.Window 2.14

          Window
          {
          id:main_window
          width: 640
          height: 480
          visible: true
          title: qsTr("main_window")
          Window
          {
          id:child_window
          width: 300
          height: 300
          minimumHeight: 300
          minimumWidth: 300
          visible: true
          title: qsTr("child_window")
          }
          }

          B Offline
          B Offline
          BelfryCrank
          wrote on last edited by
          #4
          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