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

Qt6 support #111

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Qt6 support #111

wants to merge 15 commits into from

Conversation

moodyhunter
Copy link

@moodyhunter moodyhunter commented May 21, 2021

😒 I tried my best but cannot make Qaterial support both Qt5 and 6 at the same time
In this case, a new branch is needed, to continue working with both 5 and 6.
Since WASM is still under heavy development, I think this PR can be delayed until they stabilize everything in Qt 6.2

See: https://bugreports.qt.io/browse/QTBUG-78647

Changes:

  • added qt5compat Qt extra module in CI configuration, this is required when using QtGraphicalEffects
  • find_package now finds Qt6 only
  • removed all versioned QML imports, Qt6 supports versionless QML import which ensures the latest version is used.
  • updated QOlm to commit OlivierLDff/QOlm@13a6cf9
  • in qml/Qaterial/ApplicationWindow.qml IDK why overlay should be written as Overlay
  • removed qtquick_compiler_add_resources and use qt6_add_resources instead, since https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=36b253eebdf5169709475a8e9b4726f3d19a771b
  • upstream commit 8ab7d46 and 61748ff
  • in qml/Qaterial/Style.qml the != and == is replaced by !== and === (hell no javascript)
  • added template type in src/Qaterial/ColorTheme.cpp, float is used since QColor returns floats rather than double
  • AA_EnableHighDpiScaling attribute is now deprecated and HiDPI scaling is always on

TODOs:

@OlivierLDff
Copy link
Owner

Yes i think we really need 6.2 to merge into master.

  • My idea is when 6.2 will go out, is to only use Qt6 and drop support for Qt5. Since they said everything should be there.
  • QtGraphicalEffects will be build as a standalone library if i understand well, so we won't need compat with Qt6

Thanks for preliminary work.

Maybe some stuff can already premerged:

  • RegExpValidator to RegularExpressionValidator
  • The QColor stuff
  • AA_EnableHighDpiScaling

@OlivierLDff
Copy link
Owner

I'm putting back discord of Qaterial here if you are interested : https://discord.gg/Bb5SeCD7

@moodyhunter
Copy link
Author

moodyhunter commented May 21, 2021

Thanks anyway, but I rarely use Discord, so sorry about that.

BTW I will split those commits up into smaller changesets later today so that parts of this PR can be merged separately.

@moodyhunter
Copy link
Author

moodyhunter commented May 22, 2021

just rearranged the commits, probably 0d1b5bb 7e2e4b9 3181e66 and b63b7cc can be merged now.

@moodyhunter
Copy link
Author

moodyhunter commented May 28, 2021

Hi, the commit 88209d5 removes the need for 5compat module, a self-built Qt6 dev branch can be found here

Tested under Windows, Linux and WASM platform, the new QtGraphicalEffects is fully compatible out-of-box and there's no need for "porting" or "migration".


For now I'll mark this PR ready-to-review but I think it's better to be cherry-picked (as some changes are already merged)

@moodyhunter moodyhunter marked this pull request as ready for review May 28, 2021 00:32
@moodyhunter moodyhunter changed the title draft: Qt6 support Qt6 support May 28, 2021
@Milerius
Copy link
Contributor

Hi, the commit 88209d5 removes the need for 5compat module, a self-built Qt6 dev branch can be found here

Tested under Windows, Linux and WASM platform, the new QtGraphicalEffects is fully compatible out-of-box and there's no need for "porting" or "migration".

For now I'll mark this PR ready-to-review but I think it's better to be cherry-picked (as some changes are already merged)

Thanks for this work, i'm looking forward, once Qt 6.2 is out we will also upgrade https://github.com/KomodoPlatform/atomicDEX-Desktop to the last Qaterial !

@OlivierLDff
Copy link
Owner

Thanks a lot, I will wait for 6.2 before moving Qaterial to Qt6 too!

@Milerius
Copy link
Contributor

Milerius commented Jun 23, 2021

Hi, the commit 88209d5 removes the need for 5compat module, a self-built Qt6 dev branch can be found here

Tested under Windows, Linux and WASM platform, the new QtGraphicalEffects is fully compatible out-of-box and there's no need for "porting" or "migration".

For now I'll mark this PR ready-to-review but I think it's better to be cherry-picked (as some changes are already merged)

This is erroneous, you need to put back the Qt5CompactModule for QtGraphicalEffects, version 6.2 is not usable otherwise.

Suggesting to revert: 88209d5

source: https://doc-snapshots.qt.io/qt6-dev/graphicaleffects5.html

There is no support for a regular include of QtGraphicalEffects in Qt6, you need to use the compat mod

@moodyhunter
Copy link
Author

That's sad. but I was using my personally-built Qt dev branch and found the QtGraphicalEffects is actually working.

https://github.com/moodyhunter/QtSnapshot/actions

I may need further investigation.

@Milerius
Copy link
Contributor

Milerius commented Jun 23, 2021

That's sad. but I was using my personally-built Qt dev branch and found the QtGraphicalEffects is actually working.

https://github.com/moodyhunter/QtSnapshot/actions

I may need further investigation.

It's likely the unofficial way, atleast i was not able to start my app with Qt6 without the Qt5CompatMode using online installer, so i think the official way is to use the good include

Also @OlivierLDff is it possible to merge this pr into a qt6_migration branch ? So projects that use qaterial can try the experimental branch

@moodyhunter
Copy link
Author

Hi all, sorry for the late update, I was not working on QML within last month.
Just reverted the Core5Compat and the old QtGraphicalEffects module back. c3b8f69

@Milerius
Copy link
Contributor

Milerius commented Jul 6, 2021

Hi all, sorry for the late update, I was not working on QML within last month.
Just reverted the Core5Compat and the old QtGraphicalEffects module back. c3b8f69

is it also possible to fix the conflict ?

@@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
version: ['5.15.2']
version: ['6.1.0']
steps:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe 6.2.0 is available as preview now, not sure if it's already supported by your actions

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, lemme try it out, BTW I think WASM builds are ready as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i believe 6.2.0 is available as preview now, not sure if it's already supported by your actions

Yes, seems the build has passed.

@ahmedyarub
Copy link
Contributor

I merged this into my master branch and it worked like a charm! I tested only on Windows so far.

OlivierLDff added a commit that referenced this pull request Jul 18, 2021
OlivierLDff added a commit that referenced this pull request Jul 18, 2021
AA_EnableHighDpiScaling is enabled by default on qt6
merged from : #111
Thanks to @moodyhunter
OlivierLDff added a commit that referenced this pull request Jul 18, 2021
merged from : #111
Thanks to @moodyhunter
⚠️ This commit require Qt6
OlivierLDff added a commit that referenced this pull request Jul 18, 2021
OlivierLDff added a commit that referenced this pull request Jul 18, 2021
merged from : #111
Thanks to @moodyhunter
⚠️ This commit require Qt6
OlivierLDff added a commit that referenced this pull request Jul 18, 2021
merged from : #111
Thanks to @moodyhunter
⚠️ This commit require Qt6
OlivierLDff added a commit that referenced this pull request Jul 18, 2021
OlivierLDff added a commit that referenced this pull request Jul 18, 2021
AA_EnableHighDpiScaling is enabled by default on qt6
merged from : #111
Thanks to @moodyhunter
@OlivierLDff
Copy link
Owner

I started to merge:

OlivierLDff added a commit that referenced this pull request Jul 18, 2021
OlivierLDff added a commit that referenced this pull request Jul 18, 2021
merged from : #111
Thanks to @moodyhunter
⚠️ This commit require Qt6
OlivierLDff added a commit that referenced this pull request Jul 18, 2021
OlivierLDff added a commit that referenced this pull request Jul 18, 2021
OlivierLDff added a commit to OlivierLDff/QaterialHotReload that referenced this pull request Oct 11, 2021
## Bug fix

πŸ› Clipboard: fix potential nullptr access to QGuiApplication::clipboard() (happen in production somehow ...) 
3970f4b81ce43c6506b238aa27345aad72cbc961

πŸ› Fix TextArea.onTextChanged not emitted properly
This fix is temporary. TextArea require entire refactor instead of ugly hack
fix OlivierLDff/Qaterial#114
Thanks to @moodyhunter
9753c72ac41d6f1db35cb286669c4de4c5cad951

πŸ› ColorTheme: Fix potential division by 0
dbd16971397e32494ea0bcf480da7c5795839d70

## Refactor

♻️ QColor *F accessors use float instead of double with Qt6
merged from : OlivierLDff/Qaterial#111
Thanks to @moodyhunter
1210dc9e58f3a1cee9438008106a721e593a9f21

♻️ RegExpValidator to RegularExpressionValidator
merged from : OlivierLDff/Qaterial#111
Thanks to @moodyhunter
db9501b1610f9a49e60a52bd2bcf18bc44ad4deb

♻️ Only set Qt::AA_EnableHighDpiScaling for Qt5
AA_EnableHighDpiScaling is enabled by default on qt6
merged from : OlivierLDff/Qaterial#111
Thanks to @moodyhunter
b5a71770ccebebf8e44eb062288c4d0c20333360

## CMake

πŸ”‡ Disable Qaterial CMake log when project is included.
Log can be enabled by user using `QATERIAL_VERBOSE`
e2640eeed1c834ad0ca6078c3e7dc54633718f88

♻️ Dump cmake config after install commands
d7c4f3b8707d0a491f4697e653ba28620897e07a
OlivierLDff added a commit to OlivierLDff/QaterialHotReload that referenced this pull request Oct 11, 2021
## Bug fix

πŸ› Clipboard: fix potential nullptr access to QGuiApplication::clipboard() (happen in production somehow ...) 
3970f4b81ce43c6506b238aa27345aad72cbc961

πŸ› Fix TextArea.onTextChanged not emitted properly
This fix is temporary. TextArea require entire refactor instead of ugly hack
fix OlivierLDff/Qaterial#114
Thanks to @moodyhunter
9753c72ac41d6f1db35cb286669c4de4c5cad951

πŸ› ColorTheme: Fix potential division by 0
dbd16971397e32494ea0bcf480da7c5795839d70

## Refactor

♻️ QColor *F accessors use float instead of double with Qt6
merged from : OlivierLDff/Qaterial#111
Thanks to @moodyhunter
1210dc9e58f3a1cee9438008106a721e593a9f21

♻️ RegExpValidator to RegularExpressionValidator
merged from : OlivierLDff/Qaterial#111
Thanks to @moodyhunter
db9501b1610f9a49e60a52bd2bcf18bc44ad4deb

♻️ Only set Qt::AA_EnableHighDpiScaling for Qt5
AA_EnableHighDpiScaling is enabled by default on qt6
merged from : OlivierLDff/Qaterial#111
Thanks to @moodyhunter
b5a71770ccebebf8e44eb062288c4d0c20333360

## CMake

πŸ”‡ Disable Qaterial CMake log when project is included.
Log can be enabled by user using `QATERIAL_VERBOSE`
e2640eeed1c834ad0ca6078c3e7dc54633718f88

♻️ Dump cmake config after install commands
d7c4f3b8707d0a491f4697e653ba28620897e07a
@vincent-hui
Copy link

Qt 6.3 released. When will Qaterial support Qt 6?
Thanks

@OlivierLDff
Copy link
Owner

No date for now, I'm not working on UI right now

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

Successfully merging this pull request may close these issues.

None yet

5 participants