Qt Designer C ++ or QML for GUI

I know that using QML is completely new in QT, and I was wondering if I should develop my application using QTDesigner or QML. I will use the MVC pattern, and my main problem, if I use QML for the GUI, is that it would not be easy to integrate inside the rest of my C ++ application.

Feel free to give your personal advice, I would really appreciate it. Thank!

+44
c ++ user-interface qt qml
Jan 05 2018-11-11T00:
source share
3 answers

QML is primarily intended for mobile platforms. Due to her youth and her concern for the various interface interfaces of the platform, she does not have standard controls, such as buttons and combo boxes (but see the Components project). If you are on a mobile phone or your user interface requires a special visual style, QML may be worth considering. Get ready for a lot of extra work on developing custom controls. In my opinion, the integration of QML and C ++ is still quite complicated. I personally would recommend using QML only for simpler applications, only on mobile platforms and only with JavaScript. Under the right circumstances, I could consider creating custom QML elements in C ++.

The Qt C ++ API is not leaving soon. It is also designed with desktops in mind and will better meet the expectations of users on desktop platforms. If you're on the desktop, I would recommend sticking with C ++ and Designer. Even after QML matures a bit, it probably won't be the right solution for most desktop applications.

Update!

Things seem to be starting to change . I have not tried new components yet, and the documentation seems a bit sparse (or at least aside), but this may ultimately remove the biggest barrier to using QML on the desktop. It is not yet clear whether this will receive support in the long run, but if you agree to risk becoming an early adopter, I think that QML can now be a viable choice for desktop applications.

+43
Jan 05 2018-11-11T00:
source share

It would be helpful to try some QML to see if it suits your needs.

If you are creating a custom user interface with dynamic interfaces and animations, QML is suitable for work; if you are building a traditional desktop application, then you probably want to stick with the Qt C ++ API.

As for the integration between QML and C ++, QML is designed for easy integration with C ++ code, and many CML applications use some kind of C ++ server. Directly inject C ++ objects into the QML interface or write custom QML elements in C ++. See http://doc.qt.io/archives/qt-4.7/qtbinding.html and http://doc.qt.io/archives/qt-4.7/qml-extending-tutorial-index.html .

+15
Jan 6 '11 at 6:32
source share

One thing missed by the above answers is that QML has the added benefit / disadvantage of JavaScript for business logic (if necessary). I am currently creating an application (for small and medium) for the desktop, and now I like (2) alpha users. I am impressed with the expressiveness of the structure and how quickly I can update and test it. All in all, I find it is faster to work than the RAD editor (designer), and I like having JavaScript as a backup of my user interface when I do annoying things like freezes / validation, etc.

I think this is a question of how comfortable you are with the language. If C ++ is your go-ahead language, what are you most likely using as a designer. If you come from the Internet (confession, I am a Java EE / MVC.NET developer dealing with a large number of interfaces), you will find it refreshing and fast.

It also allows for some of the responsiveness that users expect these days. In general, I would give him a huge plus. Try it - you are likely to be satisfied and more likely annoyed in the same time period. I'm still angry with a couple of things (FileIO in particular), but I enjoy the GUI side of things that I rarely do on the desktop.

+13
Nov 26 '13 at 21:57
source share



All Articles