18

I have a project in mind and want to take on it and have chosen QT as the preferred framework to begin with. I have been trying to figure out how to start and have Qt package (SDK and Qt Creator) installed. The problem is - I am not able to figure out the exact use-cases of Qt Quick and Qt Widgets. I plan to make the project for a long-term purpose with these properties:

  • It will be a desktop-only GUI application. If I ever want to make a mobile version, I would do that for the mobile platform in native or HTML5, and not Qt. So code-base compatibility with any mobile platform is not my concern.
    • Touch UI and animations are also not a part of the feature set. However, down the line support for creating graphs would be great (I can always use QtWebkit and JS to create some though)
  • Windows is the prime target. Linux and Mac would probably not be used by the target user(s).
  • It would need to be self-upgradable - now that is not much of a concern in making the choice but if there are problems with either, some knowledge would help me. I do not mind a full application installer download but updating modules independently would be a little better
  • It would need to talk to a web server for fetching and uploading data (I think HTTP would be Qt core's job but I do not know much about Qt yet).
  • The app would need tables with inline editing, a small picture gallery, menus, multi-part windows, drag-n-drop support etc. I could not find anything about menus relating to Qt Quick though.

Considering that use-case, what would be a better choice - Qt Widgets or Qt Quick?

A little about me and why I chose Qt - I have been out of touch from C++ since almost 2 years and have not made anything serious in Qt but Qt is a preferable choice over Java (which I do not like much). Again, I lack experience with Python. In addition to that Python UI sucks and if I have to install QT framework for a good UI, why not make the entire thing in Qt anyway (considering I am okay with C++). So Qt is the preferable choice for me. Since the project would need to be cross-platform compatible, Qt is even more attractive to my eyes.

Vaibhav Kaushal
  • 340
  • 1
  • 6
  • 16
  • 2
    If you want a classical, desktop-themed UI, I'd go for widgets, for now. QtQuick controls is moving towards desktop UIs, but it will take a while until the convenience and feature set matches widgets. Still, have a look at QtQuick and how C++ interfaces with QML. If you keep all business logic in C++ and make QtQuick a thin UI layer, it gives a clean core/UI separation that is also good practice if you then put a widgets UI on top of the core. With the option to switch to QtQuick later. – Frank Osterfeld Jan 22 '14 at 05:59
  • @FrankOsterfeld I am a PHP developer and have to work on 'themes' at times. So, yeah, I get the logic behind having the logic in just C++ and make the UI a thin layer. But I am one single person who is going to work on the project and I do not think that I would be able to hire anyone for the project for the coming year (or a couple). So the codebase and development is on me. I do not want to go with something which is either unstable, incapable or deprecated. I do not know if they are going to retire Widgets in favor of Quick because the development in Widgets is little. – Vaibhav Kaushal Jan 22 '14 at 07:08
  • 2
    @VaibhavKaushal, don't be afraid that Widgets become deprecated in the future. Too many software relies on widgets, including the whole KDE desktop environment. In one Qt Developer Days talk, one of the main developers said, that both frameworks are developed as alternatives since the use cases are different. You need for example 3D acceleration for Qt Quick, which makes it's use in a VM nearly impossible. Another point to consider is, that you ship QML plaintext to the user that can be used to clone your software. – Simon Warta Jan 22 '14 at 19:26
  • So that means Widgets are going to be there and I should be going with Widgets and not Qt Quick because everything I want fits as a traditional desktop app. As Nicholas mentioned below - documentation is well developed and available for Widgets. Hence, I am making the decision to go with Widgets. Many thanks to you (Simon), Frank and Nicholas :) – Vaibhav Kaushal Jan 23 '14 at 03:10
  • possible duplicate of [Qt Quick vs. Qt Widget](http://stackoverflow.com/questions/8626355/qt-quick-vs-qt-widget) – BuZZ-dEE Jun 19 '15 at 23:13
  • "Composable UI building blocks" in Qt Quick are called **Controls**, http://doc.qt.io/qt-5/qtquickcontrols-index.html. – user7610 Nov 05 '15 at 13:39

1 Answers1

14

QML will provide more support for customising widgets in a simple manner, Widgets gives you a set of tools ready to go that gives you platform styled controls in a very simple way. Both have their upsides, both have their downsides, I'd personally recommend getting started with Widgets first as there's a lot more historical documentation for them, so if you need to research something you'll have a bigger base to work with.

From your comment above, there's been little development on Widgets as the Qt development team feel that they don't need any additional work at this stage. They're stable, solid and reliable, there's not much that needs to be done to be improved, and when people need custom widgets they end up creating them themselves.

Nicholas Smith
  • 11,642
  • 6
  • 37
  • 55
  • Okay. Thanks for your answer. So Qt Widgets would let me have all the UI controls that I mentioned too? (that's perhaps the last question remaining in my mind). – Vaibhav Kaushal Jan 23 '14 at 03:07
  • Yeah it would, you may need to tweak to get the results you need but it wouldn't be difficult. – Nicholas Smith Jan 23 '14 at 16:50