Completely new to Qt - Should I read a Qt 4 book?
-
I'm just getting into Qt. It seems a new version has just been released, which is both wonderful and horrible for me. On one hand, I won't have to transition to a new version. On the other hand, however, there seems to be no published materials on Qt 5.
So, how different are Qt 4 and Qt 5? If I were to read a Qt 4 book, would I have to unlearn a bunch of stuff to get into Qt 5? Or is it like the difference between C++98 and C++11 where the new version simply adds new functionality (for the most part, anyways) to the already existing functionality?
-
Qt5 puts the focus almost completely on QML, C++ is no longer a primary language to develop in, but a language to extend QML. You can still use the old GUI classes from Qt4, but you might as well use Qt4, Qt5 appears to just add more dependencies and headaches, so if you are not going to take advantage of the new paradigm Qt5 enforces, there is really no point.
At any rate, reading a Qt4 book will be beneficial, whether you develop entirely in C++ with QtWidgets or extend QML, since the out-of-the-box functionality of QML is pretty rudimentary.
The book I always recommend is "foundations of Qt development" - IMO it presents information in the best and easiest to digest way, but there are a bunch of other good books on Qt too.
In fact, after you get to know the concept of Qt you will probably be able to work on your own thanks to the fairly good documentation - the most used classes are very well documented with several examples. Being comfortable with the documentation of Qt is crucial since no book can cover the entire framework, it is really vast.
-
Qt5 is mostly source-code compatible with Qt4, so everything you know of Qt4 will be valuable information for Qt5 as well.
"QtWidgets":http://qt-project.org/doc/qt-5.0/qtwidgets/qtwidgets-index.html is still actively maintained and developed and an essential part of Qt5; C++ is the primary development language and most / all of the code you'll create will be written in it.
In addition, you've been given "QtQuick 2.0":http://qt-project.org/doc/qt-5.0/qtquick/qtquick-index.html, a powerful tool to create fluid, animated, non-uniform user interfaces, which uses a declarative language called "QML":http://qt-project.org/doc/qt-5.0/qtqml/qtqml-index.html, which seemlessly integrates into the rest of Qt.
But even if you aim for a classical QtWidgets project I strongly recommend Qt5, as there have been major overall improvments, most of whom your project will benefit as well, be it improved performance, improved QString and QByteArray handling, a brand new plugin system, a brand new perl-compatible regular expression parser, improved accessibility support, JSON support, a brand new syntax for signals and slots which allows for compile-time checking, brand new OpenGL support, IPv6 and SSL improvments and much more.
In addition, you will get access to loads of additions, like QtMultimedia, Qt3D, QtLocation and more.
Although the requirement for Qt5 is still C++98, Qt5 will provide and take advantage of C++11 if available. This includes rvalue references and move semantics, intializer lists, unicode literals, lambda support for slots and more.
There are no books on Qt5 yet, but what is true for Qt4 is mostly true for Qt5 as well. If you want to start with Qt5 directly just start digging through the "documentation":http://qt-project.org/doc/qt-5.0/qtdoc/index.html.
You will find a Qt5 summary "here":http://qt-project.org/wiki/Qt-5-Beta. I strongly recommend to not use Qt4 for new projects unless you have very specific reasons to do so. Qt5 has everything Qt4 has, plus loads of improvments and additional functionality for all types of applications, Console, Widgets and Quick, on top of it. In addition, 4.8 was the last feature release for Qt4 (this means that it is still maintained, but no new functionality is added).
If you are more of a visual type take look at the "Qt5 Launch Demo":http://www.youtube.com/watch?v=vhWS_bN-T3k and the "Showcase":http://qt-project.org/wiki/Qt-5-Beta#f4b67c735ca7ce8fe886be1e47071d72 ;-)
-
I strongly Recommend you to read Qt4 Text Books. That will help you alot... Because till now there is no text books available for Qt 5.. (AFAIK)... Qt5 has some new functionalities added to the Qt4 Version. So it is better to go from the begining before going directly to the new one.. Also Check this "Best Tutorials":http://qt-project.org/forums/viewthread/21442/ for reading Qt4...
Thanks & Regards....
-
Alright, I think I'll start with a Qt 4 book then.
Thanks for the help!
-
@all
Hey guyz how about we create a wiki documentation/page for the books/videos/tutorials just for reference , thatl be an advantage for people who are new to Qt development, all information can be provided at one place.
Coz there are many threads that has the same question about books/videos/tutorial and we all end up replying to them.
Suggestions Please :)
-
[quote author="Sam" date="1357111418"]@all
Hey guyz how about we create a wiki documentation/page for the books/videos/tutorials just for reference , thatl be an advantage for people who are new to Qt development, all information can be provided at one place.
Coz there are many threads that has the same question about books/videos/tutorial and we all end up replying to them.[/quote]+1
[quote]Suggestions Please :)[/quote]Do you mean suggestions for what to link? I'd start with a simple list of resources that often appear in replies to the aforementioned threads.
We'd probably benefit from some way to rate each link (this requires new features in the Qt Project website -- but that's now under Open Governance too! http://lists.qt-project.org/mailman/listinfo/web )
-
I know I am one year late and I don't even know whether this discussion is still active but I have spent the last month trying to learn QT and I have only stumbled onto this discussion today.
I downloaded the QT5/Qt Creator combo for my mac running Mountain Lion OSX.
It seems that there is quite a bit of incompatibility between QT5 and QT4 to the extend that many of the code examples from books written on QT4 would not compiled in QT5. For example, for web access in QT4 uses the QHttp class which has been obsoleted in QT 5 and there is no direct class replacement that would make the rest of the code compile.
I have tried to follow the procedures to load QHttp as an add-in module with this link:
http://qt-project.org/forums/viewthread/24466
But have been completely baffled trying to follow the instructions there (I am an MCU programmer and only have rudimentary knowledge working with OSX).
So what I want to say is be warned about following some of the examples with a book based on QT4. You might find it won't work with QT5. (Since this discussion is one year, you might have overcome this already). But for me so far, lots of blind alleys and frustrations.
I agree with utcenter "foundations of Qt development" has been very helpful. But again some of their example codes won't work with QT5. If folks out there know of someone who has converted their example codes to QT5, please let me know.
Also good is C++ GUI Programming with Qt 4, although it is a bit difficult to follow at times for beginners like me. However, one very good thing is that their example codes have been converted to QT5.
Another valuable resource are these tutorials by Brian somebody: https://www.youtube.com/watch?v=6KtOzh0StTc&list=PL2D1942A4688E9D63
Folks out there, if you know of a straight forward set of guidelines to download install a QT4.x QT Creator combo. Please let me know, it would be much appreciated. I would love to stick with QT4 to make the learning process less painful.
-
I know I am one year late and I don't even know whether this discussion is still active but I have spent the last month trying to learn QT and I have only stumbled into this discussion today.
I downloaded the QT5/Qt Creator combo for my mac running Mountain Lion OSX.
It seems that there is quite a bit of incompatibility between QT5 and QT4 to the extend that many of the code examples from books written on QT4 would not compiled in QT5. For example, web access in QT4 uses the QHttp class which has been obsoleted in QT 5 and there is no direct class replacement that would make the rest of the code compile.
I have tried to follow the procedures to load QHttp as an add-in module with this link:
http://qt-project.org/forums/viewthread/24466
But have been completely baffled trying to follow the instructions there (I am an MCU programmer and only have rudimentary knowledge working with OSX).
So what I want to say is be warned about following some of the examples with a book based on QT4. You might find it won't work with QT5. (Since this discussion is one year old, you might have overcome this already). But for me so far, lots of blind alleys and frustrations.
I agree with utcenter "foundations of Qt development" has been very helpful. But again some of their example codes won't work with QT5. If folks out there know of someone who has converted their example codes to QT5, please let me know.
Also good is C++ GUI Programming with Qt 4, although it is a bit difficult to follow at times for beginners like me. However, one very good thing is that their example codes have been converted to QT5 (but the QHttp problem is still there).
Another valuable resource is this set of tutorials by Brian somebody which I found extremely helpful (thanks Brian).
https://www.youtube.com/watch?v=6KtOzh0StTc&list=PL2D1942A4688E9D63
Folks out there, if you know of a straight forward set of guidelines to download and install a QT4.x QT Creator combo. Please let me know, it would be much appreciated. I would love to stick with QT4 to make the learning process less painful.
-
Hi,
[quote author="vwcc" date="1391785729"]It seems that there is quite a bit of incompatibility between QT5 and QT4 to the extend that many of the code examples from books written on QT4 would not compiled in QT5.[/quote]Yes, that's to be expected between major release versions. There's a "porting guide":http://qt-project.org/doc/qt-5/sourcebreaks.html to help developers who want to migrate.
[quote]Folks out there, if you know of a straight forward set of guidelines to download install a QT4.x QT Creator combo. Please let me know, it would be much appreciated. I would love to stick with QT4 to make the learning process less painful.[/quote]Sure. Go to https://qt-project.org/downloads and scroll down. You can still get Qt 4.8 -- it will continue to be supported for years to come. (In fact, Qt 4.8.6 is scheduled to be released soon!)
If you scroll down a bit further, you will also find the standalone package for Qt Creator 3.0.1. Install both packages:
Install Qt 4.8
Install Qt Creator 3.0.1
Open Qt Creator, go to Tools -> Options -> Build & Run
If Qt 4.8 is not auto-detected, follow these steps:
Add Qt 4.8 to the "Qt Versions" tab: http://qt-project.org/doc/qtcreator-3.0/creator-project-qmake.html
(Possibly not needed, but I'm not sure) Add your compiler to the "Compilers" tab: http://qt-project.org/doc/qtcreator-3.0/creator-tool-chains.html
Combine the above in the "Kits" tab: http://qt-project.org/doc/qtcreator-3.0/creator-targets.html
-
Thanks JKSH for your help.
I followed the steps you suggested and finally managed to install Qt 4.8.5 with Qt Creator 3.0.1
There are more complications along the way because OSX 10.8.5 hides the qmake file under /usr/bin which is not accessible for Qt Creator.
There is a separate link that addresses this problem for those who are interested.
http://qt-project.org/forums/viewthread/22510/P15/#162254
I now have a QT version that runs the example codes from the Qt books I have. Thanks again.
-
Glad to hear :) Welcome to the world of Qt, and happy coding!