[Interest] Preferred way to create custom look-and-feel GUI

André Somers andre at familiesomers.nl
Tue May 10 09:05:56 CEST 2016



Op 08/05/2016 om 16:40 schreef Jan Müller:
> Hello,
>
> I was wondering, what is the preferred way to create a GUI with a 
> custom look-and-feel appearance, similar as e.g. QtCreator.
>
> I have a modestly large application, using a QWidgets approach and I 
> use 'designer' to create the ui/layout.
>
> The application has several modes/screens, which are accessible at the 
> moment through a tabview widget.
>
> At the core of the application there is a QGLWidget, drawing lots of 
> data coming from the C++ core.
>
> I would like to make the application appear a bit more modern, e.g. 
> with custom look-and-feel buttons/spin-boxes etc.
>
> I recently discovered QML. Does it make sense to migrate to a QML 
> based approach? I'm thinking of creating the mainwindow together with 
> buttons to switch between the modes in QML. And instantiate my (c++ 
> implemented) OpenGL widget in QML (and make it derive from QQuickItem).
>
> Or should I stick with the QWidgets approach and use a stylesheet to 
> implement more 'fancy' looking things such as gradients and custom 
> look-and-feel components?
>
> What does QtCreator use to implement the GUI? For example the 
> navigation bar at the left with the "Welcome", "Edit", "Design", etc. 
> buttons. I tried to look into the sources of QtCreator, but got a bit 
> lost.
>
>
There are multiple approaches possible. It depends a bit what you want 
to achieve. I think QML is very promising, but the components are still 
not very mature. That is only illustrated once more by yet another break 
in there with QtQuickControls 2.0. Still, cool things are possible. 
Showing OpenGL in QtQuick is certainly possible.

However, you can also consider a more conservative approach. If widgets 
are serving you well and you just want a different look, you can also 
implement your own style. I would recommend that over using style 
sheets. Doing this will not give you fancy animations, but it will give 
you all the widgets goodness and stability that 
QML/Quick/Components/Controls/WhatEverItIsCalledToday so far is lacking.

André






More information about the Interest mailing list