Important: Please read the Qt Code of Conduct -

Changing a parent of a widget in qt creator designer.

  • 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?

  • Lifetime Qt Champion

    @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?

  • 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.

  • Lifetime Qt Champion

    @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.

Log in to reply