Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Traditional Qt' or 'Qt Quick' for a desktop program? [closed]

Tags:

qt

qt4

qt-quick

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.

like image 393
Edwin Yip Avatar asked Mar 31 '11 09:03

Edwin Yip


People also ask

Should I use Qt Quick?

Qt Widgets provide means for customization via style sheets, but Qt Quick is a better performing choice for user interfaces that do not aim to look native. Qt Widgets do not scale well for animations. Qt Quick offers a convenient and natural way to implement animations in a declarative manner.

What is Quick Control QT?

Qt Quick Controls provides a set of controls that can be used to build complete interfaces in Qt Quick. The module was introduced in Qt 5.7. Qt Quick Controls comes with a selection customizable styles.

What is difference between Qt Designer and Qt Creator?

Qt Creator is Qt's IDE. You don't have to use it, but it greatly simplifies Qt development. Qt Designer is a graphical tool that lets you build QWidget GUIs. Qt Quick Designer is similar, but for building QML GUIs.


3 Answers

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.

like image 104
Dr Deo Avatar answered Nov 18 '22 14:11

Dr Deo


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.

like image 25
rubenvb Avatar answered Nov 18 '22 16:11

rubenvb


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.

like image 40
Tamás Szelei Avatar answered Nov 18 '22 15:11

Tamás Szelei