Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt Quick Controls apps support #198

Open
versusvoid opened this issue Jan 18, 2024 · 0 comments
Open

Qt Quick Controls apps support #198

versusvoid opened this issue Jan 18, 2024 · 0 comments

Comments

@versusvoid
Copy link

versusvoid commented Jan 18, 2024

After setting QT_STYLE_OVERRIDE=Adwaita (or -style Adwaita) Qt Quick Controls app will fail to start (testing on Text Editor example)

$ env QT_DEBUG_PLUGINS=1 QML_IMPORT_TRACE=1 QT_STYLE_OVERRIDE=Adwaita ./texteditorexample
...
qt.core.plugin.loader: Found metadata in lib /usr/lib/qt6/plugins/styles/adwaita.so, metadata=
{
    "IID": "org.qt-project.Qt.QStyleFactoryInterface",
    "MetaData": {
        "Keys": [
            "Adwaita",
            "Adwaita-Dark",
            "Adwaita-HighContrast",
            "Adwaita-HighContrastInverse",
            "HighContrast",
            "HighContrastInverse"
        ]
    },
    "archlevel": 3,
    "className": "StylePlugin",
    "debug": false,
    "version": 394752
}
...
QQmlApplicationEngine failed to load component
qrc:/qml/texteditor.qml: module "Adwaita" is not installed

This is due Qt Quick Controls using the name of global style override to search for QML module implementing the style.
(this only happens if such style plugin exists, with QT_STYLE_OVERRIDE=non-existent app will run fine)

To allow app to run there should exist QML module for custom style /usr/lib/qt6/qml/Adwaita/qmldir:

module "Adwaita"
ApplicationWindow 1.0 ApplicationWindow.qml

with at least one .qml file (using ApplicationWindow as example)

//  /usr/lib/qt6/qml/Adwaita/ApplicationWindow.qml
import QtQuick
import QtQuick.Templates as T

T.ApplicationWindow {
    color: 'black'
}

(and analogous for Adwaita-Dark)


Not sure if you actually should implement such, more of heads up to people stumbling on same problem.

@versusvoid versusvoid changed the title Qt Quick apps support Qt Quick Controls apps support Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant