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?
-
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.
-
@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? -
@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.
-
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 -
@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.
-
@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 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? -
@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.
@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 -
@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. -
@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 -
@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.
-
@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.
-
@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
Does that mean that native styling is only supported by Qt Quick Controls 1?
Yes.
@raven-worx, is this still true? I ask because I want to commit to Qt 6, but it's really, really difficult when native style support is so inconsistent. I see that QtWidgets, which inherits the native
QStyle
is deprecated in favour of QML, but solely the deprecatedQtQuickControls 1
appears to provide nativeQQuickStyle
, for its replacement – at least,QtQuickControls 2
– does not appear to.I'm using KDE Plasma 6 as my development and deployment environment, so native "application style" (as
kcm_style
phrases it) is important to me (until at least KDE's Union can unify theQStyle
andQQuickStyle
s). If not, I'll convert to something likewxQt
/wxMSW
(post/822753
) per-platform. -
Does that mean that native styling is only supported by Qt Quick Controls 1?
Yes.
@raven-worx, is this still true? I ask because I want to commit to Qt 6, but it's really, really difficult when native style support is so inconsistent. I see that QtWidgets, which inherits the native
QStyle
is deprecated in favour of QML, but solely the deprecatedQtQuickControls 1
appears to provide nativeQQuickStyle
, for its replacement – at least,QtQuickControls 2
– does not appear to.I'm using KDE Plasma 6 as my development and deployment environment, so native "application style" (as
kcm_style
phrases it) is important to me (until at least KDE's Union can unify theQStyle
andQQuickStyle
s). If not, I'll convert to something likewxQt
/wxMSW
(post/822753
) per-platform.@RokeJulianLockhart said in Does QML support native look-and-feel on Windows?:
@raven-worx, is this still true? I ask because I want to commit to Qt 6, but it's really, really difficult when native style support is so inconsistent.
In Qt 6, Qt Quick Controls offers the
Windows
style (Windows 10 style) as well as theFluentWinUI3
style (Windows 11 style): https://doc.qt.io/qt-6/qtquickcontrols-styles.html#windows-styleI see that QtWidgets, which inherits the native
QStyle
is deprecated in favour of QMLWidgets aren't going anywhere anytime soon. They are still fully maintained, and are even getting a new style: https://wiki.qt.io/QtCS25_-_UnifiedStyling
-
Does that mean that native styling is only supported by Qt Quick Controls 1?
Yes.
@raven-worx, is this still true? I ask because I want to commit to Qt 6, but it's really, really difficult when native style support is so inconsistent. I see that QtWidgets, which inherits the native
QStyle
is deprecated in favour of QML, but solely the deprecatedQtQuickControls 1
appears to provide nativeQQuickStyle
, for its replacement – at least,QtQuickControls 2
– does not appear to.I'm using KDE Plasma 6 as my development and deployment environment, so native "application style" (as
kcm_style
phrases it) is important to me (until at least KDE's Union can unify theQStyle
andQQuickStyle
s). If not, I'll convert to something likewxQt
/wxMSW
(post/822753
) per-platform.@RokeJulianLockhart said in Does QML support native look-and-feel on Windows?:
... I want to commit to Qt 6, ..., but solely the deprecated
QtQuickControls 1
appears to provide nativeQQuickStyle
, for its replacementJust to note that
QtQuickControls 1
is more than deprecated in Qt 6. The deprecation happened in Qt 5 in advance of its removal in Qt 6. -
@RokeJulianLockhart said in Does QML support native look-and-feel on Windows?:
@raven-worx, is this still true? I ask because I want to commit to Qt 6, but it's really, really difficult when native style support is so inconsistent.
In Qt 6, Qt Quick Controls offers the
Windows
style (Windows 10 style) as well as theFluentWinUI3
style (Windows 11 style): https://doc.qt.io/qt-6/qtquickcontrols-styles.html#windows-styleI see that QtWidgets, which inherits the native
QStyle
is deprecated in favour of QMLWidgets aren't going anywhere anytime soon. They are still fully maintained, and are even getting a new style: https://wiki.qt.io/QtCS25_-_UnifiedStyling
@JKSH, as aforestated, my environment isn't primarily Windows, so a pre-defined WinUI2/3-equivalent
QQuickStyle
is assistive, but not sufficiently comprehensive if I want to utilise QML.However, I'm glad to hear that QtWidgets are in active development.
Though, this rather reminds me of the mess with Microsoft's myriad equivalent GUI endeavours – is all the information I see online about QtWidgets being deprecated in QML's favour (which KDE's push for Kirigami appears to mimic) because that was once true, but isn't anymore?
-
@JKSH, as aforestated, my environment isn't primarily Windows, so a pre-defined WinUI2/3-equivalent
QQuickStyle
is assistive, but not sufficiently comprehensive if I want to utilise QML.However, I'm glad to hear that QtWidgets are in active development.
Though, this rather reminds me of the mess with Microsoft's myriad equivalent GUI endeavours – is all the information I see online about QtWidgets being deprecated in QML's favour (which KDE's push for Kirigami appears to mimic) because that was once true, but isn't anymore?
@RokeJulianLockhart said in Does QML support native look-and-feel on Windows?:
@JKSH, as aforestated, my environment isn't primarily Windows, so a pre-defined WinUI2/3-equivalent
QQuickStyle
is assistive, but not sufficiently comprehensive if I want to utilise QML.Ah, I missed that. This thread is about native look-and-feel on Windows so I answered in that context.
OK, Qt Quick Controls also has native styles for macOS, iOS, and Android. (There's no such thing as a "native" style for Linux)
My suggestion? Give Qt Quick a test run with a simple test project. Decide whether to use it or not based on how it helps you get things done, not just what styles are available.
Other note: The graphics technology is called Qt Quick. The primary language is QML, but you can still use C++ to implement some Qt Quick classes if you wish.
is all the information I see online about QtWidgets being deprecated in QML's favour (which KDE's push for Kirigami appears to mimic) because that was once true, but isn't anymore?
Well, Qt Widgets was never deprecated in the first place.
My guess is that people saw that each new release brought big improvements to Qt Quick but didn't bring big improvements to Qt Widgets, and concluded that widgets are being dumped. What they forgot was this:
- Widgets were a mature, 20-year-old technology that works well and is relied on by many, so there's no room for fancy revolutionary changes.
- Qt Quick was a new young technology, wet around the ears, with lots of room for growth. That's why the growth spurts seem so dramatic.
However, I'm glad to hear that QtWidgets are in active development.
I'm not sure I'd use the term "active development" though. It's being maintained, bugs are fixed, and it's kept working smoothly with new versions of OS'es, but there's no revolution happening.