PDA

View Full Version : Incompatibility between the IDE and the book I read to learn Qt5



franky
14th February 2016, 20:21
Hello dear guys,

I'm really disappointed :-(
I do my best to learn Qt5 but apparently I have no good choice :-(

We had a massive discussion here https://forum.qt.io/topic/63499/how-and-where-to-start-qt5 about the documentations and other resources. I then passed primary steps and became ready to read a good book. I installed Qt Creator 3.6.0 as the (latest Qt) IDE and took the book C++-GUI-Programming-with-Qt-4-2nd-Edition as the reference to have a real start on learning Qt5.

The problem is that, following the instructions written in the book and doing them on that IDE, brings many difficulties. There are many incompatibilities between what I read and what I should do.

Since I really love Qt, I had (and have) to learn Qt5. So I did whatever I could to match the IDE and the book to be able to proceed in it.

There of course are some interchanges that are simple to do. Like replacing <QtGui> with <QtWidgets> (on my IDE) and don't doing the qmake from a command line (it seems not to be needed for that IDE).

I can cope with these minor differences but please read this http://www.4shared.com/office/JbUjBFECba/Binder2.html link which is a PDF file containing a project of that book.

I really don't know how to implement it on my IDE. I spent hours to solve the differences but they are not one or two ones.

As well as, I fear to face such confusions again and again; some time later when working, and have to create threads here for helping every time. This will not be a good method for learning.

I should learn Qt5. This is my principle. Please help me.

PS:

I have good experience in C++.
My machine is MS Windows 7.
My primary purpose is being able to create apps for Windows.

anda_skoa
14th February 2016, 22:37
QtGui vs QtWidgets is a Qt4 -> Qt5 difference (widgets got split into their own module).

However, that is usually not that relevant since classes are more often included as needed, e.g.


#include <QApplication>

So the main difference would be to need "QT += widgets" in the .pro file.

QtCreator uses qmake .pro files for its standard application templates, but of course you don't have to run it manually then.
You can still run it manually, or even not use QtCreator, but it is more convenient that way.

A good starting point should the the widgets tutorial, which is part of the Qt documentation (and as such directly accessible in QtCreator).

The exercise you've linked to should also be basially identical in Qt5, with QtCreator even easier since you can use "New -> Designer class" to get the form and the QDialog subclass created for you.

Cheers,
_