[Interest] Guide me through the Qt offerings for GUIs

André Pönitz apoenitz at t-online.de
Thu Apr 22 17:22:54 CEST 2021


On Wed, Apr 21, 2021 at 05:42:50PM +0200, Jason H wrote:
>    You probably won't  -- it's too new. Unless you call automotive
>    Infotainment consoles success stories.
>    The lack of proper QtQuick Controls (v2) held it back for a while.
>     
>    Personally, I think the exsting QtQuick element should be scrapped and
>    just focus on QML versions of the existing Widget functionality. I love
>    the QML syntax, hate that it's not just a layer on top of widgets.
>    That said, I still really like both.

If it is *just* the appearance and you don't insist on matching QML syntax
exactly you can throw a few hundred lines of syntactic sugar on top of
QWidgets and make something like 

    CommonOptionsPageWidget() 
    {
        Settings &s = ...;
        using namespace Layouting;

        Column col1 {
            s.useAlternatingRowColors,
            s.useAnnotationsInMainEditor,
            s.useToolTipsInMainEditor,
            s.closeSourceBuffersOnExit,
            s.closeMemoryBuffersOnExit,
            s.raiseOnInterrupt,
            s.breakpointsFullPathByDefault,
            s.warnOnReleaseBuilds,
            Row { s.maximalStackDepth, Stretch() }
        };

        Column col2 {
            s.fontSizeFollowsEditor,
            s.switchModeOnExit,
            s.showQmlObjectTree,
            s.stationaryEditorWhileStepping,
            s.forceLoggingToConsole,
            s.registerForPostMortem,
            Stretch()
        };

        Column {
            Group {
                Title("Behavior"),
                Row { col1, col2, Stretch() }
            },
            s.sourcePathMap,
            Stretch()
        }.attachTo(this);
    }

compile in plain C++, without any background engine interpreting this at
runtime or similar.

Modulo some namespacing hassle it would also be possible to use something like

        PushButton {
            text = "Press me!",
            onPressed = [] {
                qDebug() << "Ouch";
            },
            ...
        };

if you really wanted.

On the other hand, there's also a point where things get too fancy
syntax-wise.

Andre'


More information about the Interest mailing list