Robert
Robert

Reputation: 1710

Implement with QML or C++?

I've just started learning Qt recently, finding QML quite interesting for implementing UI component. Before the project really kick off, I've got some questions:

Upvotes: 3

Views: 2554

Answers (2)

eric gilbertson
eric gilbertson

Reputation: 1003

I had a chance to put this question to a few Qt experts at the World Summit today and the general take was that because QML component rendering can be done through hardware acceleration that it is preferred for apps requiring high performance graphics, eg automotive dashboards. OTOH widgets seem to be used for desktop applications. Another consideration is that while widgets can be styled using Qss (Qt's version of Css), QML components cannot.

In QML based applications computationally intensive functions are generally written in C++.

HTH,

Eric G

Upvotes: 1

Greenflow
Greenflow

Reputation: 3989

When you start a question with 'Should I use', it is quite a good hint that SO might not be the right place to ask it. Even more when there are only answers, which start with 'It depends on...'.

QML is not designed to replace QWidget. It is a different technique. Which one to use, depends on your requirements.

Whether or not you must implement additional stuff in C++ depends on your project. Some things are easier in C++, others in QML. And some stuff is not possible in QML at all.

There is no relationship between QML and C++ widgets.

And the performance of QML is in most cases more than sufficient. In almost every case QML is used to create user interfaces. I doubt that there are many cases where clicking a button or opening a dropbox folder is performance critical.

Upvotes: 4

Related Questions