Is there a way to create a .ui file from a running QApplication?
-
Say you have a C++ QApplication running, can you create a .ui file from some specific widget in that application?
This would be useful for debugging purposes.
I tried using QFormBuilder::save() but:-
It seems like it wasn't meant to be used in anything except Qt Designer
-
Some things that exist during runtime aren't supported in the .ui like QStackedLayout
-
Trying to open some of the generated .ui files in Qt Designer causes it to crash
-
-
Say you have a C++ QApplication running, can you create a .ui file from some specific widget in that application?
This would be useful for debugging purposes.
I tried using QFormBuilder::save() but:-
It seems like it wasn't meant to be used in anything except Qt Designer
-
Some things that exist during runtime aren't supported in the .ui like QStackedLayout
-
Trying to open some of the generated .ui files in Qt Designer causes it to crash
The QFormBuilder class is typically used by custom components and applications that embed Qt Designer. Standalone applications that need to dynamically generate user interfaces at run-time use the QUiLoader class, found in the QtUiTools module.
(from: https://doc.qt.io/qt-5/qformbuilder.html#details)
QFormBuilder
is to create GUI code from an existing UI file at run time, not the other way around.
AFAIK theuic
process in not reversable.
But you can save the state of widgets by using something like
QSettings
-