Congratulations to our 2022 Qt Champions!

Qt 5.5 RC cannot set flat style

  • I am trying to use the QML flat style with qt 5.5 community.
    I understood from the Alpha release notes - - that the flat style should be included in the community edition of QT 5.5. It is also mentioned on this post on the blog:

    I use

    qputenv("QT_QUICK_CONTROLS_STYLE", "Flat");

    in main.cpp, but the style is not applied. I think that this is the correct way to set the style since I can change it by setting "Desktop" instead of "Flat".

    Looking into the QT installation directory I see that there is a directory named mingw492_32\qml\QtQuick\Controls\Styles\Flat , but it contains only two dlls and a qmldir file. The Base and desktop directories instead contain about 40 qml files.

    How can I use the flat style in Qt 5.5 community?


  • I've succeded to use the flat style by adding

    import QtQuick.Controls.Styles.Flat 1.0

    It works with the QT 5.5 RC mingw package, however I cannot see ComboBox. Each time a combo box is shown this error appear:

    qrc:/ExtrasImports/QtQuick/Controls/Styles/Flat/ComboBoxStyle.qml:39:1: module "QtQuick.Extras.Private" is not installed
    qml: Failed to load Style for ComboBox_QMLTYPE_124(0x2c2dc258)

    The same behaviour holds targeting an android device, but the same code does not work with QT 5.5 RC package and this error is shown when the app starts WARNING: Cannot find style "Flat" - fallback: ":/QtQuick/Controls/Styles/Base"

  • I was missing
    import QtQuick.Extras 1.0

    On android and Windows now it works fine, it does not work with winrt

Log in to reply