Question

WPF uses XAML. Gtk has GladeXML, and associated tooling.

Does something similar exist for Qt?

Just to clarify: I'm asking about runtime loading of a UI from a markup file. XML/YAML/JSON, etc.

Thank you

Was it helpful?

Solution

The .ui files created by Qt's Designer application can be loaded at runtime for a dynamic UI. It will allow the UI to be changed, but it doesn't allow state information like QML does. Also, if you want to do much with the UI, you need to know some information about the widgets in the .ui file.

OTHER TIPS

well... .ui files are .xml files

Yes there are .ui files which are in fact XML based. These files are generated by QtDesigner/QtCreator (Form designer delivered by Nokia/Trolltech). Ui files are converted to C++ code at compile time and linked with application.

So it is not possible to load them at runtime.

While .ui files are XML, these are not as declarative as the .qml files of Qt Quick (QtDeclarative Engine). The latter, in contrast is JSON-like, not XML. So the answer to the original question is: yes (functionally) and no (not XML). Personally, I think XML-based creation for humans is inferior.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top