4 ms·
> Qt has a similar story lately, I think there's an "old fashioned" API, and a JavaScript API, and a XML-like thing too, and I just don't know where to get star
by geezerjay 7y ago
> Qt has a similar story lately, I think there's an "old fashioned" API, and a JavaScript API, and a XML-like thing too, and I just don't know where to get started with 100% confidence that I'm not learning the wrong thing.
Qt is way simpler and straight to the point than you believe it is.
Qt's UI files are XML files that offer a convenient way to design layouts which are intended to be used during the build process to generate C++ code. You are free to manually define layouts by instantiating Qt Widget objects but what's masoquism.
It's also possible to use the same XML documents to dynamically generate the UI, but I never saw a project using that in any way.
Then there's Qt Quick. That's an entirely different beast. The UI is defined with a DSL designed for this very purpose, and javascript can be used to handle UI events.
- sbuttgereit 7y ago"It's also possible to use the same XML documents to dynamically generate the UI, but I never saw a project using that in any way." This application: https://github.com/xtuple/qt-client https://github.com/xtuple/qt-client, does precisely that. It's an ERP application, the bulk of the system uses the XML files to generate into C++ as is usually the case, but they use the dynamic approach as a means by which to offer ad hoc customization support for their clients. In that case, and assuming a fully bespoke form, you use Qt Designer to create the XML ui file as you normally would, but that XML ui file ends up in a text field in the database rather than getting compiled into a C++ application. When the form is loaded, the C++ application loads the XML ui from the database, along with JavaScript to back it, and then dynamically renders the UI using the XML definition. On its own, that technique actually works surprisingly well for that use case and isn't distinguishable from the compiled forms in regard to function or performance at a practical level... maybe some delay in opening the form if the network is slow. Disclosure: My consultancy is a business partner of the company that makes that application.