This may seem like a very strange question but is it possible to generate a Qt Designer form (.ui) from a Qt object, say something that inherits QWidget?

My plan is to build a simple dynamic form in code as the user picks what stuff they want e.g fields, type of control and then dump out a .ui file so that they can tweak the layout if needed after.

The code will then use the QUiLoader class to reload the ui file and show the modified or not ui file.

Edit
Report