Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Changing a parent of a widget in qt creator designer.
Forum Updated to NodeBB v4.3 + New Features

Changing a parent of a widget in qt creator designer.

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
7 Posts 5 Posters 7.2k Views 2 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.
  • O Offline
    O Offline
    OmegaDoom
    wrote on last edited by
    #1

    Hello. How can I do the subject?
    I have searched the internet but only solution i found is cutting/pasting a widget. I can't use it because it changes a widget position. Why is it so painfully hard to do?

    jsulmJ 1 Reply Last reply
    0
    • O OmegaDoom

      Hello. How can I do the subject?
      I have searched the internet but only solution i found is cutting/pasting a widget. I can't use it because it changes a widget position. Why is it so painfully hard to do?

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

      @OmegaDoom Parent of a widget is the widget where the child widget is placed. So, if your child widget is on widget A, then A is its parent. If you want widget B to be the parent then you need to move the child to B. You can't put the child on A and have B as parent. And why would you want this? What is your use case?

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

      1 Reply Last reply
      1
      • O Offline
        O Offline
        OmegaDoom
        wrote on last edited by OmegaDoom
        #3

        Yes, it's what my question about. How can I move existing widgets to another parent? The only way I found so far by cutting/pasting. But it's not suitable because it changes widget position and not good for moving many widgets. The only other solutions i can come up with is to edit form manually. Do I really need to do this? And it changes absolute position - sucks.
        My case is simple - I want to move some widgets to a frame in order or enable/disable them by enabling/disabling their parent.

        jsulmJ 1 Reply Last reply
        0
        • O OmegaDoom

          Yes, it's what my question about. How can I move existing widgets to another parent? The only way I found so far by cutting/pasting. But it's not suitable because it changes widget position and not good for moving many widgets. The only other solutions i can come up with is to edit form manually. Do I really need to do this? And it changes absolute position - sucks.
          My case is simple - I want to move some widgets to a frame in order or enable/disable them by enabling/disabling their parent.

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

          @OmegaDoom Why not simply drag and drop the widget to the new parent? Works fine for me.
          And I still don't understand how you want to change parent of a widget without changing its position? The new parent is another widget at another position, so you have to move your child widget to another position.

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

          1 Reply Last reply
          2
          • O Offline
            O Offline
            Otso
            wrote on last edited by
            #5

            I have the same issue. I know I can drag & drop, but it some cases it is unnecessarily difficult. For example, if I have horizontal layout within a vertical layout, the horizontal layout by default squishes into a thin line. It's now close to impossible to drag a widget inside that thin horizontal layout. I know I can work around it, but it is unnecessarily difficult. It would be much easier if I could drag & drop in the object hierarchy browser, but this doesn't seem possible.

            mrjjM 1 Reply Last reply
            0
            • O Otso

              I have the same issue. I know I can drag & drop, but it some cases it is unnecessarily difficult. For example, if I have horizontal layout within a vertical layout, the horizontal layout by default squishes into a thin line. It's now close to impossible to drag a widget inside that thin horizontal layout. I know I can work around it, but it is unnecessarily difficult. It would be much easier if I could drag & drop in the object hierarchy browser, but this doesn't seem possible.

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

              @Otso
              Yeah for layout where you remove margins or simply have no Widgets yet its near impossible to hit
              the right spot. You have to set a temporary min size as not have it to collapse totally.
              Drag and drop in the object hierarchy browser would be great.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mira_k
                wrote on last edited by
                #7

                With Qt, of course, everything is possible! You just have to, like an idiot, find the correct elements in *.ui file, edit it manually, and if the God will stand with you, you may be able to manage this uneasy task.

                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