OK, what is the difference/advantage vs. using Qt Widgets to make the same application?
@mrj19972 жыл бұрын
The main difference is that QML can run anywhere but widgets are limited to desktop Also, QML productivity is a big remark
@deymoss86152 жыл бұрын
From my experience, qml have some benefits: easy to read(if it's not a 1000+ lines file), flexibility, and speed of development. For me, after ui 1 year with qml, it's horroble to see widget code with huge ammount of connect, very big and hard constructions etc.
@pandacongolais2 жыл бұрын
Note for @mrj : I've been messing a little bit with Qt/Android and I confirm that you can use both Widgets and QML. In my case, hard habits die hard, I still prefer C++/Widgets. Perhaps because I had only one real world case. But that's not only why I had a hard time adapting : - first, you're talking to C++ coders, so why do you mix QML with JS ??? I hate JS. - why did you have to change the name of everything that already exist as a widget ? In this example, you are using Column. Ok, but what about the layouts ? I'm too old to grow a second brain to learn so many new concepts, QML declarative style and the worse : JS It's as if suddenly, a team of young web developers were given a distinct work space at Qt Company to create QML/QtQuick ! Don't take my comments to bad, there (may be) are advantages to QML over widgets. I won't bother trying to make a list though ...
@Strahlex2 жыл бұрын
QML has been designed to build highly customized UIs, e.g. for embedded or mobile targets, or nowadays also desktop applications. Widgets are around for a longer time, they are more productive for some type of desktop applications, I'd call them tool UIs. For QML think Slack for example (probably not QML, but you get the idea, it doesn't look like a typical desktop application), for widgets think Qt Creator. You can mix together QML and widgets in the same application. QML is more modern and flexible, however, has a steeper learning curve for most people already knowing typical UI frameworks. As for JS: JS is the imperative part of QML, it's mainly used for binding and very small code parts, the syntax is similar to C++, newer versions of QML are more like Typescript (e.g. allow type hints in functions for example). I can only recommend doing the business logic in C++ (or Python for that matter) and keeping the JS portion small.
@pandacongolais2 жыл бұрын
@@Strahlex Agreed, and thanks for the answer. I should not have posted to begin with, since I don't feel entitled to speak on that topic. It's been far too long since I've worked on serious Qt projects (and I miss that so much ... But I'm not here to tell you my life ...) I see what you mean since I've made many useful and much less useful softwares based on widgets. Train driver UI with Qt 3, lab equipment monitoring with Qt 4/5, personal tools from Qt 4 to 6 And I had one occasion to make a UI with QML. To give you an idea, imagine a very small R&D team trying to replace the basic commands of a cooking appliance (that thing : imtc.qccdn.fr/test/robot-cuiseur/zoom/miogo-maestro_001.jpg) with a touch screen (R-Pi + buildroot + Qt) It was at the same time very interesting and very painful. Interesting because QML has its own advantages over widgets (mainly, it enforces the separation of the UI and the app logic; to the point that the electronics engineer was able to work on that part of the project). Painful because of JS, because of the naming of object, very different from their widget counterpart, and because of some inconsistencies at the time (sorry, I can't name one now, it was in 2017) Anyway, both are here to stay many years ... Will I have widgets or QML in my next car ...
@JohnJTraston Жыл бұрын
What's the point to have Visual UI designer when you have to type everything? I don't get this whole Quicky thing.
@victormorvy4 ай бұрын
To type is sometimes faster than find your widget, drag it to a point, go to properties, change the widget name, roll to change its width, height, style, and then, write the logic. Qml looks like marked up language focused in ui design like some front end languages.
@shahana8607 Жыл бұрын
I can’t find kit options in Mac book ? Why is it so . Please help
@cernejr2 жыл бұрын
How does one deploy this program? Will one deploy the QtQuick src file? If yes, how would one prevent tampering/edits?
@Alex-kr7zr2 жыл бұрын
Usually Qt applications are deployed as binaries. No way to tamper with the source file
@cernejr2 жыл бұрын
@@Alex-kr7zr So the QML/JavaScript gets somehow embedded into the resulting binary?
@Strahlex2 жыл бұрын
@@cernejr With newer Qt versions, at least the QML part is going to be compiled to C++ code. For older versions, the QML/JS files will be embedded as resource files, meaning that the string can be read when reverse engineering the binary. Of course, if protecting the QML part is of concern, it might be a good idea to additionally use a binary encryption tool. However, I don't have much knowledge on that topic. Best keep your business logic in the C++ part to stay on the safe side.
@cernejr2 жыл бұрын
@@Strahlex Thank you, this helps.
@QuangPhamMinh-hu6mn Жыл бұрын
why i can't find qmake in build system when create qtquick app
@neoenemy4145 Жыл бұрын
Same, were you able find qmake for qt quick?
@CrZenith9 ай бұрын
@@neoenemy4145 To use qmake in qt quick u have to use the Qt Quick Applicaion (Compat) rather than the one hes using
@sennlich Жыл бұрын
qt designer and python with pyqt6 much quicker drag and drop controls to the ui and then save it and continue with vscode for example. this here is overkill imo