PDA

View Full Version : QML/QtQuick for a pure desktop application?



Moppel
1st November 2015, 22:01
Hi,

after having used an application called CuteCom (http://kde-apps.org/content/show.php/CuteCom?content=14332) for about half a year I've been missing a certain feature.
I needed some session support (a bit similar to the sessions found in Kate). The first step I made was to add very basic session support via a command line switch. Since command line argument parsing comes for free by the command line parser (by dfaure?) within Qt5 I thought it's a good idea to port this application to Qt5 along the way. (The port can be found on GitHub, just ask if interessted)
After having done this, I thought I could brush up my Qt programming a bit and find out what QML had in store for me.
After a few hours of tinkering and trying to more or less rebuild the UI from the above application I'm now wondering if that's the best approach. E.g. I have found no way of using a scrollbar to one of the textviews which I regard as necessary. (I'll put my proof of concept UI on GitHub within the next few days)
The nice thing I managed to add though is a "sliding in from above" control panel, making the controls getting out of the way when not needed.
Before I follow this route further I thought I better ask:
Is it advicable to implement the UI using Qt Quick for a pure desktop application like this? Or should I rather be using the traditional QWidget approach? Being intrigued by the "sliding in from top control panel" I would have to find out how to implement that using widgets though....

Thankful for advice!

anda_skoa
2nd November 2015, 07:37
It really depends on what kind of UI you are going for.

If you just want to rebuild the application as it is now, then using QtWidgets is far easier.

If you want to re-do the UI, make it change dynamically a lot, then QtQuick.Controls should be good enough for the desktop Look&Feel and provide you with the dynamic aspects.
You will still run into weird things, but it is managable once you build up expertise.

Slide-out panel with widgets is also not that difficult. Should be doable with a simple widget that is a child of the window but not in the layout.

Cheers,
_

Moppel
2nd November 2015, 20:09
Oh, thankyou.
I probably opt for the QtWidget-Route than.
Anyway, this is how far I got with the QtQuick-Controls.
https://github.com/cyc1ingsir/cutecom-qml
It looks somehow quirky. And the SplitView is behaving in way not excepted. :(