Does QML support native look-and-feel on Windows?
-
I am working on a little application that should (in the end) run on Windows 7 through 10 and some Linux distributions.
With Widgets, I am pretty much used to getting the native look and feel by default. With QML, I only see the styles "Default", "Material" and "Universal". Does QML not support native styling out-of-the-box?
-
@Asperamanca
you need to use the QtQuick.Controls module
Those docs say:Note: We are using QApplication and not QGuiApplication in this example. Though you can use QGuiApplication instead, doing this will eliminate platform-dependent styling. This is because it is relying on the widget module to provide the native look and feel.
-
@raven-worx said in Does QML support native look-and-feel on Windows?:
@Asperamanca
you need to use the QtQuick.Controls module
Those docs say:Note: We are using QApplication and not QGuiApplication in this example. Though you can use QGuiApplication instead, doing this will eliminate platform-dependent styling. This is because it is relying on the widget module to provide the native look and feel.
I was looking at the Gallery sample, but the one for Qt Quick Controls 2. There, I don't have any native style.
Does that mean that native styling is only supported by Qt Quick Controls 1? -
@Asperamanca said in Does QML support native look-and-feel on Windows?:
Does that mean that native styling is only supported by Qt Quick Controls 1?
yes
-
Thanks for clarifying that.
My enthusiasm trying out QML just took a hit. Sure, I can stick to Qt Quick Controls 1, but they are not extended anymore, so I might as well stick to widgets.
-
@Asperamanca
my personal preference is
QtWidgets for Desktop
QML for mobile/touch devices -
@raven-worx said in Does QML support native look-and-feel on Windows?:
@Asperamanca
my personal preference is
QtWidgets for Desktop
QML for mobile/touch devicesBo Thorsen also expressed a similar view back in 2015: https://lists.qt-project.org/pipermail/interest/2015-June/017412.html
It's 2019, do you still hold the same view that Qt Widgets is best for native looking Desktop(Win,Mac,Linux) applications and Qt Quick/QML is best for Mobile & Embedded. Qt Designer is the drag and drop tool(rapid prototyping) for Qt Widgets, is it in active development? I'm asking this because on Qt website about UI tools it's not listed. https://www.qt.io/design I was thinking if Qt Widgets is still in use then Qt Designer should be added there.
-
@raven-worx said in Does QML support native look-and-feel on Windows?:
@Asperamanca
my personal preference is
QtWidgets for Desktop
QML for mobile/touch devicesAnd what do you do it the same code (logically, not necessary the identical GUI) should run on both?
E.g. either a PC/Notebook or a large touchscreen / touch notebook? -
@KevinMQt said in Does QML support native look-and-feel on Windows?:
It's 2019, do you still hold the same view that Qt Widgets is best for native looking Desktop(Win,Mac,Linux) applications and Qt Quick/QML is best for Mobile & Embedded
yes, i (personally) do.
Qt Designer is the drag and drop tool(rapid prototyping) for Qt Widgets, is it in active development?
it's part of QtCreator, so yes. Also there is QtDesignStudio in the meantime available.
And what do you do it the same code (logically, not necessary the identical GUI) should run on both?
There is no true right/wrong.
It als heavily depends on your UI. Nevertheless its possible to share the same backend (C++ data logic) and only use QtWidgets and QML for the UI (see the MVC pattern for example).
See https://doc.qt.io/qt-5/qtqml-cppintegration-data.html -
@raven-worx said in Does QML support native look-and-feel on Windows?:
@KevinMQt said in Does QML support native look-and-feel on Windows?:
It's 2019, do you still hold the same view that Qt Widgets is best for native looking Desktop(Win,Mac,Linux) applications and Qt Quick/QML is best for Mobile & Embedded
yes, i (personally) do.
Qt Designer is the drag and drop tool(rapid prototyping) for Qt Widgets, is it in active development?
it's part of QtCreator, so yes. Also there is QtDesignStudio in the meantime available.
And what do you do it the same code (logically, not necessary the identical GUI) should run on both?
There is no true right/wrong.
It als heavily depends on your UI. Nevertheless its possible to share the same backend (C++ data logic) and only use QtWidgets and QML for the UI (see the MVC pattern for example).
See https://doc.qt.io/qt-5/qtqml-cppintegration-data.htmlDid you share the right link? I don't see any mention of MVC or "model" in the article.
Also, for scenes that have complex logic in the loading code, my impression so far is that generating QML scenes from C++ (via template QML files) must by necessity be very slow compared to creating a scene directly in GraphicsView. -
@Asperamanca said in Does QML support native look-and-feel on Windows?:
Did you share the right link? I don't see any mention of MVC or "model" in the article.
MVC is a generic software pattern to separate logic from representation (UI).
https://en.wikipedia.org/wiki/Model–view–controller -
@raven-worx said in Does QML support native look-and-feel on Windows?:
@Asperamanca said in Does QML support native look-and-feel on Windows?:
Did you share the right link? I don't see any mention of MVC or "model" in the article.
MVC is a generic software pattern to separate logic from representation (UI).
https://en.wikipedia.org/wiki/Model–view–controllerYeah, I know that one. I was just wondering what the link you originally shared had to do with it.
-
@Asperamanca said in Does QML support native look-and-feel on Windows?:
I was just wondering what the link you originally shared had to do with it.
it is about how C++ data types (backend) can be sent to QML (UI) and vice versa.