Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to use Qt in C++ development
Richard Lang last edited by
I know the answer to this is going to be very much opinion based, but interested in the perspective of experienced C++ developers using Qt....
I'm a seasoned C++ developer starting off a new project with a significant UI component and an intending to use Qt as a UI framework (have dabbled with Qt a little in the past but this will be the first serious bit of development I've done). My normal go-to tools for C++ development would be GCC with STL and Boost libraries, with a CMake build system and Eclipse CDT. I'm interested in the pros and cons of wholeheartedly embracing Qt and using it's project management, build system and non-visual library components throughout the system vs. just using it as a UI framework for the GUI layer. I know both approaches are possible, but wondering if I'm going to be "fighting against the current" and/or missing out on a lot of capabilities if I try and limit Qt usage to the GUI layer.
IMO there's no point in limiting Qt to UI. You'll have more libraries to link to (bigger deployment), more functionality duplication, more messy code (different coding styles in Qt/non-Qt code) and more conversions (e.g. std::string to QString). If you can do everything or most of it with one library/environment why mix? Make a list of functionalities you need. If Qt covers them I'd go all the way.
VRonin last edited by
pros and cons of [..] Qt [...]'s project management, build system
Cons: Qt Build system is not as flexible as CMake nor is it that commonly used
Keep using CMake!
Charlie_Hdz last edited by
I had work with C++ for a long time, and trust me when I said that Qt is the best complement to continue developing in C++.
Qt had been improving C++ implementation (QString, QStringList, and so on...), and a milestone is the Signal/Slot functionality that allows us to avoid using CallBack functions. Signal/Slot mechanism make this necessities easier to understand.
@Richard-Lang I use cmake and gcc. There is no reason to use qmake over cmake, Qt fully supports cmake, and cmake is way better. Gcc you'll use to compile so no difference there.
I find STL/Boost much harder to use than Qt's equivalent classes. If I have a Qt dependency on an app I am writing then I use the Q classes all the way. A lot of my apps can't use Qt for size reasons in which case I'm stuck with STL. It's always annoying. I miss things like QList all the time when I'm using std::list/vector.
@ambershark Qt Lite when you need something lighter weight ;-)
@SGaist I've never heard of Qt Lite. Does it not have GUI components? How lite is it? Most of these projects are for embedded systems with very limited resources. Would it be ok for those? If so I'll push for that next time I get one of those projects. :D
It can have GUI components, it depends on what you configure.