Qt Widgets is my daily driver right now, but I feel like it is getting too basic for my needs and I am looking for something which is a bit more advanced.
What is a good language and framework for this task?
Thanks
If you're familiar with Qt, QtQuick can be a logical next step. QtQuick offers far more graphical functionality and modern capabilities than Qt widgets by comparison.
The learning curve for QML can be a little steep at first, but the included examples when you install Qt do a pretty good job introducing the major concepts. Once I got the hang of it I've never wanted to bother with Qt widgets again.
Related
New to Qt. In the official Qt tutorial, it says:
To set up a project, you first have to decide what kind of an application you want to develop: do you want a user interface based on Qt Quick or HTML5 or Qt widgets.
We plan to use Qt to do medical image display, and also use Qt to build a GUI application to control a medical device. They will be two different projects.
Which Qt project type we should use for them?
Docs say:
QWidgets are a better choice if your UI is comprised of a small number of complex and static elements, and QML is a better choice if your UI is comprised of a large number of simple and dynamic elements.
I say:
If you're going for desktop applications I'd suggest Qt Widgets, you don't have to ship the final app with libs for QML and the whole source will be written in C++ (faster, simplier so easier to debug).
QML would be a nice alternative if you want to create phone/tablet (touch experience in general).
I would argue that between Qt Quick and Qt Widgets there is no objectively right answer. In theory, one should be able to replicate any UI using either method - because at the end of the day, they are both using QtGui behind the scenes. So functionality is probably not an issue.
One thing to note is that Qt Quick (i.e., QML) is designed explicitly to make UI programming require much less code, and much less C++ knowledge. I would say it achieves this goal very well.
However, at the end of the day, I think it mostly comes down to what language your developers are already familiar with. If you have a team of C++ pro's, then I would go with Qt Widgets - if only because it's going to be very easy for them to pick up, and it's something they're already familiar with. (I'm guessing this is the case because you're already writing C++ code for your project).
If, on the other hand, your developers are already very good at QML (or, more generally, JavaScript - which QML is heavily influenced by), then I would go with Qt Quick for the same reasons.
I know of two types of Qt UI: Qt Quick and widgets.
Widgets behave like most other UI toolkits out there, you have a GUI editor and a tree of UI objects. They are pretty mature and look like most standard UIs.
Qt Quick is the newer Qt UI toolkit. It uses a domain specific declarative language (QML) to specify the user interface and JavaScript for interactions. There are also plans to offer Qt widgets inside the Qt Quick framework, but I'm not sure how far that project has gotten. Qt Quick is meant to deliver more dynamic / custom user interfaces.
As far as I know Qt will continue to support both approaches in the foreseeable future so which one you pick depends on your use-case.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Nokia has just introduced Qt Quick (build UI declaratively like using CSS/HTML) in the recent beta versions of Qt, check this example page, it can build fancy and modern UI, very cool!
On the opposite, the UI developed by 'traditional Qt' seems to be less fancy (I might be wrong, see disclaimer below).
So my question is, would you use 'Traditional Qt' or 'Qt Quick' for a new desktop program? Why?
My initial thoughts:
'Traditional Qt':
Pros:
The overall technologies used be less, thus simpler, if you use PySide, you only code in Python, don't have to mess with the CSS/JS-like things in Qt Quick;
It's maturer.
Cons:
Building fancy UI seems to be more difficult?
'Qt Quick':
Pros and cons: the other way around.
Edit: Qt Quick has a downside, correct me if I'm wrong, you can't design Qt Quick UI in a WYSIWYG way, right?
Disclaimer: I'm new to Qt, PySide and Python, just recently has started evaluating using these tech to build desktop programs.
ave been messing up with qml for my desktop and i personally found this:
its easier to create animations than in traditional qt/c++/pyqt (i loved the animations :)
I haven't looked through all examples but the code size of qml apps looks smaller than equivalent apps in c++
Problems i have found with qml
has poor qml design support- at the moment custom elements dont show up in qml designer.This is a big pain coz ideally i should get a designer to create my ui and i concentrate on the code. Their qml designer still needs some work
You are expected to learn javascript since its the "recommended" way of scripting in qt. Javascript is NOT easy as you may expect eg learning python took me a few hours but javascript looks superficially similar to c but some of its concepts are different. Also i wonder if i can protect intellectual property in an app written i just javascript and qml.(correct me if am wrong)
native widgets are not available in qml eg it just offers rectangles, etc which you combine to form your own widgets.
This has not stopped me from playing with qml and as it matures, i shall adopt a wait and see attitude. Currently am using qml for part of my ui and c++ for the backend.
You made one mistake: Qt Quick is not available only in a beta version of Qt. It has been part of the official Qt release since 4.7 (although each minor version significantly improved the features offered by Qt Quick).
Although the "normal" Qt UI (with QWidgets and layouts and all) is older, this doesn't necessarily mean Qt Quick is immature. It is part of the release, after all.
One thing you fail to point out in your pro's and cons is performance: "normal" Qt UI's are prebuillt (for the most part, basically), and Qt Quick UI's rely on runtime interpretation of QML and CSS/HTML as you say. This will mostly not impact application speed on a desktop system, but if you run into performance bottleneck because you're making the UI too fancy, don't say I didn't warn you. Although such a bottleneck probably means you should've gone OpenGL from the beginning.
Qt Quick provides an easy way of building a cool UI (that's the selling point anyway) and will allow you to use cooler effects in an easier way than the old stuff.
If you are using Python then you probably are not concerned about performance. Traditional Qt allows for fancy looks, too via QSS. What Qt Quick gives is a way to easily build a UI (even without tooling support that is being introduced in 4.8) and use scripting to make it work.
You can make fancy UIs with tradtional Qt, too, mainly via QSS and deriving existing widgets. Most Qt examples don't focus on this but that doesn't mean it can't be done. It also probably gives a better overall performance, especially if coded in C++.
I would use traditional Qt because I'm more familiar with it. But this is subjective anyway, so I think your question will be closed.
I have not so experience on traditional Qt UI systems. But I can give you my experience on QtQuick:
UI using QML is more simple.
QML enables you to better developing using MVC pattern. It makes View separated from Model. You can load different version of the UI in runtime.
QML enables developing advanced UI.
It is very performant now (using QSceneGraph technology). It is implemented on multiple UI threads! I am not sure that you can make more performant UI using C++ anymore!
UI designers can develop UI simpler than HTML+CSS+Javascript!
You can develop your custom UI element by C++ using specific classes.
QML is based on OpenGL and in free version of Qt you need to notice that.
QML has a specific debugger and profiler. Debugging in UI is so easy.
If you want to develop your app using a standard patten like MVC, QML may be more suitable.
You need to be careful about performance notes.
After 4 years of absence I'm finally coming back to Qt development again. I'm quite impressed by the development it has gone through, but also a bit confused by Qt Quick, which got just introduced in Qt 4.7
For me it seems like something to build a quick, appealing GUI with some logic in Java Script. However, if I'm going to build a C++ application, is Qt Quick also the modern way of building a GUI for that or should I follow the classic path by using the .ui files?
Qt Quick should fill a much needed gap but whether that means it will become the way to build applications will largely be determined on the type of applications you intend to build.
Qt has provided .ui files for a long time. These files are easy to work with when you need to create applications based on standard widgets. Designer makes it easy to layout the widgets and do other basic operations.
Qt 4.2 introduce style sheets (qss) that made it possible to style existing widgets. These styles are convenient ways of styling the standard widgets to get away from the standard widgets' look-and-feel, while retaining basic functionality.
But sometimes you need to create custom widgets, widgets that don't exist. Before Qt quick, the only way to do this was to write native code (be it C++ or, with language bindings, Python or Ruby). With Qt Quick it's now quite possible to write widgets and full blown UIs that would otherwise be somewhat painful to write in code. Because Qt quick's focus is on the UI, it's becomes a better development language for that goal. The Qt Quick paradigm also transcends the idea of strict standard widgets, adding support for transitions and boundary-less widgets.
The answer really depends on the type of application you're planning to build and I consider the description provided on the page you linked to very accurate:
"Qt Quick helps programmers and designers collaborate to build the fluid user interfaces that are becoming common in portable consumer devices, such as mobile phones, media players, set-top boxes and netbooks."
At the moment, Qt Quick is certainly not the most obvious choice if you're planning on building a classical desktop application, an area of development which the Qt library traditionally excels at, and in this case you're probably better off using what you call "the classic .ui approach"; at the same time, I think that's the exact reason why Qt Quick was introduced: to add a new tool to facilitate the development (or rapid prototyping) of applications not focused on the desktop.
I am new to this term JavaFX Script, just want to know more on the use of JavaFX Scripts.
thanks you.
JavaFX is a RIA framework, which is something similar to Silverlight and Flash. just check out the JavaFx and will get an idea about what exactly is,.
Well, being as Oracle issued an 'end of life' statement pronouncing javafx 1.3 (and javafx script) dead come September 20, I would say that 'javafx script is of no use whatsoever, except perhaps for dealing with some legacy code'.
That's what I would say if I took your question literally and wanted to be a smart ass. Java fx script was a UI language that went along with javafx 1.3, suns original javafx user interface multimedia oriented development kit. It had its own scripting language interoperable with java.
This, many believed (mysself included) was a terrifically stupid move on suns part. We wanted to code in java and didn't want to have to dick around with some stupid scripting language. Oracle answered our prayers with JavaFX 2.0. It is to put it simply, the user interface toolkit that replaces the old standard, Swing. It's more than that -- it's based on it's own graphics engine Prism, so it pretty much replaces all of the old java multimedia classes, AWT, SWING, GRAPHICS 2D, etc. etc. And you can write it in pure Java code.
It's also correct, as the user above pointed out, that it's a flash competitor. Basically it's an SDK for producing rich cllient interfaces for the web or for the desktop... maybe even for mobile platforms but I'm not sure there.
Hope this helps -- if you want to learn more I suggest Apress publishings Pro JavaFX 2.0 Best book avbailable on Javafx 2.0 ( actually one of only two in print to date, but still damn well written)
It's supposed to be a Flash compete.
Warning: Java newbie.
Been looking at XUI for Java. Its looks quite interesting. Sort of liek a WPF way of designing interfaces. But googling around I don't see much other than articles saying it had been released. So is it used much or a bit niche?
Are there other similar frameworks for Java? Was looking at JavaFX but seems to be a general feeling that it has been slow development wise. Are there other frameworks that work in simialr ways? I get the impression Swing/SWT seem to more like WinForms. I'm looking to do something a bit more WPF like. As I said, Java newbie, so I might have this all confused. Seem to be so many UI frameworks its a bit overwhelming working out what to use for a new project.
If you can't use JavaFx, Take a look http://www.swixml.org.
JavaFx is a nice framework, it is pretty easy to learn and use. There are also some nice tutorials, doco, API's available, its still only in Preview SDK at the moment, but the next reelase is expected out relativly soon.
I would recommend giving it a try
official javaFx site
suns JavaFX overview
openjfx