How can I clone a widget?

Qt has no automated way of copying a widget and its properties. You have two
options for achieving this though:

1) If you create the widget and its children as a form (in designer) you can
easily recreate it using QUiLoader.

2) You can create a method that asks the control what class it is and then
makes a new one. Then the function needs to copy the attributes across and
then recurse down the widget tree.

No comments

Write a comment

Sorry, you must be logged in to post a comment.