Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where and what to learn to use Qt5? [closed]

Tags:

c++

qt

qml

I tried to use Qt5 but I find it very confusing.

I have good knowledge of c++(I would say between intermediate-expert level) but no knowledge of javascript or QML(only basic HTML)

When I go through the examples and tutorials provided with Qt, I find then more to be reference material or like "what's new" stuff for developers who are already using Qt. It shows me random(non systematic) parts of the vast Qt library.

I am currently more interested in using the Qt widget based apps rather than Qt QML based apps.

So this is what I want to ask.

  1. Is QML the main language and C++ just a supporting language? in other words, is learning QML absolutely essential to use QT?

  2. has using Qt for c++ based apps become a de-facto depreciated thing? Is Qt nowadays only used for QML apps?

  3. What do I need to learn to be able to use Qt?

like image 462
Registered User Avatar asked Jun 12 '15 07:06

Registered User


3 Answers

I have developed a few Qt applications and to this day no knowledge whatsoever about qml. It definitely is the new way because it is newer than what you're after but if everything will be done in qml in Qt 6 or 7 I have no idea.

So to answer your questions:

  1. At the moment I don't see any reason why qml would be required to develop desktop based applications using Qt. This may be different for mobile but I have no experience so far in that

  2. In Qt 5 there is to my knowledge no sign of the old way becoming deprecated. Please correct me if I'm wrong

  3. If you already have a good understand of c++ the main thing you have to learn is the principle of Signals & Slots and the main classes used in desktop applications (QApplication, QMainWindow, QWidget and QObject for instance)

Except that I would suggest downloading & installing Qt (including examples) and running a few of those examples. In Qt 4, there was also a program called qtdemo to which I can't find a link in Qt 5, so I don't know if it still exists. If you can get hold of if there are great examples of what you can do.

like image 101
Bowdzone Avatar answered Oct 27 '22 21:10

Bowdzone


Currently there are no many books about Qt5, so main source is official documentation and web, but currently available books:

  • Free book: Qt5 Cadaques, book about QML
  • General Qt book which was updated to Qt 5.3, but in russian: Qt5.3. Professionalnoe programmirovanie na C++

    1. No, I know people who don't use QML at all, but someone else use it more than C++. It really depends on your needs.

    2. C++ is active and for example Digia offers additional not-free modules, like Qt Charts which can be used botj with QML and C++. Also Qt developers always support new C++ standards. For example we have additional features when C++11 or C++14 was released. Hence, it is definitely not a deprecated language.

QML is just a front-end language, it is very good to build beautiful interfaces without headache, but back-end is still C++ code.

like image 23
Kosovan Avatar answered Oct 27 '22 22:10

Kosovan


  1. No. But as new features just aren't being developed for QtWidgets anymore (since 2012), you should not consider it for new development:

Yes, the Qt Widgets module we have in Qt 5 is right now marked as ‘done’, which means we don’t have anybody actively working on new features for the module at this point in time.

As someone who spent many years developing QWidget based applications, I find it vastly easier to develop UIs in QML - it's well worth learning.

  1. No, and I have no idea how you have come to that conclusion. QtQuick is a front-end layer, it has very limited functionality outside of that. In other words, for all but the simplest applications, you will need a C++ (or Python, Haskell, Java, etc.) backend.

  2. Qt is a (huge) framework, you can't start at the 'beginning' and learn everything until you reach the 'end' - that makes no sense. Use the tutorials to get a feel for the API design and how to approach common problems, and read the reference documentation to learn what capabilities it has.

    As for what you need to learn: core internals, MVC, QtQuick, qmake.

like image 39
cmannett85 Avatar answered Oct 27 '22 23:10

cmannett85