PDA

View Full Version : Need suggestions for a new application



Baldur
11th August 2015, 19:34
Good evening,

I'm still new to Qt (but good C++ knowledge) I've already created a small application with QML to get some basic experience, so I started to like QML and it's way to create UIs.

Now I want to start a more complex application and before I write tons of useless code I have to throw away, I wanted to ask for some suggestions from more experienced developers. Basically I want to know, if I should continue using QML for my UI or better use Qt Widgets.

The application should contain a main window with multiple documents organized in tabs. The documents contain various file types, so I need to change toolbars and menu entries depending on the currently selected tab/document. Also I want to support plugins, which should be able to provide additional toolbar elements, menu entries or dockable windows. I also need at least one custom widget to render some graphics with OpenGL.
I dont want to ask how to implement these things (I've already figured out some of them). I just want to ask, if I should prefer QML or widgets (or use a combination of them?) Are there advantages or disadvantages? For example, is it possible to write a custom OpenGL widget with C++ and use it in QML UIs? Can I inject submenu items from plugins in my main window's menu bar? Or is support for these things better in classic Qt?

Thanks for your help!

anda_skoa
11th August 2015, 22:30
For such a classic "desktop" style application I would always choose QtWidgets.

Cheers,
_

Baldur
12th August 2015, 02:15
For such a classic "desktop" style application I would always choose QtWidgets.

Cheers,
_

I don't think, answers like this are really helpful. You're telling me your opinion, but no explanation.
Could you please tell me, what you think are the main disadvantages of QML compared to Qt?

I know, KDE is using a lot of QML, so it dont seem to be that bad for desktop applications, also performance seems to be OK to me.

Thank you,
Baldur

anda_skoa
12th August 2015, 07:25
I don't think, answers like this are really helpful. You're telling me your opinion, but no explanation.
Could you please tell me, what you think are the main disadvantages of QML compared to Qt?

There is no QML without Qt.

And you were actually asking whether to use QtWidgets or QtQuick as the UI technology for a new application.

QtQuick.Controls is nowhere near the QtWidgets yet when it comes to classic desktop UI features such as toolbars, dock widgets, etc., hence the suggestion to use QtWidgets if that is the type of interface you are going for.



I know, KDE is using a lot of QML, so it dont seem to be that bad for desktop applications

KDE is also using a lot of QtWidgets, almost exclusively for desktop applications (Dolphin, Kontact, Calligra, Konsole, Kate, Konqueror, Okular, KDevelop, etc.)
Usage of QtQuick is the desktop shell and games.

Cheers,
_

d_stranz
12th August 2015, 16:42
Personally, I find it hard to take QtQuick seriously when it comes to developing a large application that will run on a desktop. As anda_skoa says, for one QtQuick.Controls has nowhere near the depth or usability of QtWidgets, and AFAIK, there is no QtQuick counterpart to Qt Designer for laying out a complex custom QWidget. I've also played with using QtQuick for part of the GUI of a QtWidget-based app, but it's awkward. (Granted, it was with an early version of QML, before there were many real controls available).

On the other hand, if I was developing something simple to run on a tablet, I would probably choose a QtQuick implementation. I think it is more tuned for that type of platform, and will eventually offer a richer palette of nice-looking controls.