[Interest] best base style for dual Qt5/Qt6 QML app

Mike Trahearn mtrahearn at topcon.com
Sun Feb 4 21:11:24 CET 2024


The only one which "might" look the same is Qt5 Default and Qt6 Basic (same but renamed). But otherwise, no. You may be better to make a custom style defined for your specific use case so you can be confident in your assumptions. However, doing that itself has a different approach in Qt5 and Qt6.
Whenever I build new styles (and I have made a lot over the years) I always start from Basic and build upwards as it is the vanilla and least complex base point to understand how the templates work. Which, have also changed between Qt5 and Qt6, so you may even find yourself basically having two very distinct versions of your same style - and you still may have odd quirks between them. Here's a good one - ComboBox and it's currentValue and currentText properties and associated role properties. You should try doing that in Qt5. I did, and succeeded, but it wasn't nice. So even having to hand adjust your style implementation to look the same will still be at the mercy of the template differences - and your application logic will also be dependent on those APIs as well. I appreciate that you have a tough job!

________________________________
From: Interest <interest-bounces at qt-project.org> on behalf of Frank Mertens <frank at cyblogic.de>
Sent: Monday, February 5, 2024 1:39:05 AM
To: interest at qt-project.org <interest at qt-project.org>
Subject: Re: [Interest] best base style for dual Qt5/Qt6 QML app

On 2/4/24 14:27, Александр Иваш wrote:
> I need to support Qt5 & Qt6 builds of the same desktop QML
> application. Everything works already except QML components styling.
> The issue is that the original Qt5 application was based on 'Material'
> style, which dramatically changed in Qt6.
>
> Question 1: Is there any way to make Qt6 'Material' look like Qt5 one
> (or vice versa)?
> Question 2: If not, what is the best candidate for base style for
> creating cross-platform UI which would look the same on all the
> desktop platforms in both Qt 5 and Qt 6?
>

Yeah, Material design is quite demanding and still evolving.
I found the Universal style to be more portable and less taxing.
Universal also works better on software rendering and I favor it when
writing desktop apps. For Qt5 there is also community maintained
dark CSS styles which works great in mixed QWidgets/QtQuick applications
when using the Universal dark theme.

--
Frank

_______________________________________________
Interest mailing list
Interest at qt-project.org
https://urldefense.com/v3/__https://lists.qt-project.org/listinfo/interest__;!!Nbma_1s!rLJveX92WbfP9QwEOcxaB3V0vIKDZDl8B8fpgbhXkjKqzsbGZJqvvOTYt1uq2HhEQnKhGoqMqo8X4xwfng$
Confidentiality Notice: This message (including attachments) is a private communication solely for use of the intended recipient(s). If you are not the intended recipient(s) or believe you received this message in error, notify the sender immediately and then delete this message. Any other use, retention, dissemination or copying is prohibited and may be a violation of law, including the Electronic Communication Privacy Act of 1986.   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240204/ce1c91f5/attachment.htm>


More information about the Interest mailing list