开发者

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

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜