How to reverse engineer a Ui file from a given QWidget instance

Does anyone know if the Qt Toolkit supports a way to generate Ui files from a given QWidget instance? Speaking in pseudo code, I am looking for something like this:

//setup widget
QWidget* pMyWidget=new QWidget(...);

//fill widget with life
pMyWidget->layout()->addWidget(new QLabel(...));
...

//finally write a Ui file:
pMyWidget->exportToUiFile(QString("/some/path/to/filename.ui"));

Alternatively: does anyone know a tool capable of doing this? thanks in advance, Axel

+3
source share
1 answer

Use QFormBuilder::save()from the module QtDesigner.

+3
source

Source: https://habr.com/ru/post/1765056/


All Articles