Supporting Qt 6 - What's needed?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Supporting Qt 6 - What's needed?

Post by Kunda1 »

@realthunder can you weigh-in on this topic since you're working toward a toponaming merge. Should we focus on qt6 post-toponaming or can we do it concurrently?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
Kuzma30
Posts: 163
Joined: Wed Oct 24, 2018 11:50 am
Location: Ukraine

Re: Supporting Qt 6 - What's needed?

Post by Kuzma30 »

I follow https://doc.qt.io/qt-6/porting-to-qt6-using-clazy.html
https://github.com/Kuzma30/FreeCAD/tree/qt6
I apply 4 checks as shown on "How to apply Clazy checks within Qt Creator" chapter.
Some of files is failed (600+) But QtCreator not save failed files list. (or I make mistake and not found where)

Edit
Run checks without strings convertion
https://github.com/Kuzma30/FreeCAD/tree/qt6v1
RealThunder's A3 Wiki translation, join the project https://crowdin.com/project/freecad-asm3-wiki
User avatar
Kuzma30
Posts: 163
Joined: Wed Oct 24, 2018 11:50 am
Location: Ukraine

Re: Supporting Qt 6 - What's needed?

Post by Kuzma30 »

I decide start from "Disable use of C++ API deprecated in Qt 5.15" chapter
https://github.com/Kuzma30/FreeCAD/tree/qt5.15

I use globalStrut as QSize (0,0) (defaults value). I think this is not correct. I don't know correct values.

P.S. During replace obsolete function I see many files with different newline style (Dos, Unix-way). Also there are different code style formatting. May be we cleanup our code with dos2unix or unix2dos?
RealThunder's A3 Wiki translation, join the project https://crowdin.com/project/freecad-asm3-wiki
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Supporting Qt 6 - What's needed?

Post by Kunda1 »

Kuzma30 wrote: Sat Jul 09, 2022 12:10 pm P.S. During replace obsolete function I see many files with different newline style (Dos, Unix-way). Also there are different code style formatting. May be we cleanup our code with dos2unix or unix2dos?
Not worth it. Should be a separate PR. Remember we are also trying to integrate Toponaming.


Edit: let's try to avoid eating baby kittens AKA context swicthing: https://webchick.net/please-stop-eating-baby-kittens
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Supporting Qt 6 - What's needed?

Post by adrianinsaval »

Kuzma30 wrote: Sat Jul 09, 2022 10:10 am I follow https://doc.qt.io/qt-6/porting-to-qt6-using-clazy.html
https://github.com/Kuzma30/FreeCAD/tree/qt6
I apply 4 checks as shown on "How to apply Clazy checks within Qt Creator" chapter.
Some of files is failed (600+) But QtCreator not save failed files list. (or I make mistake and not found where)

Edit
Run checks without strings convertion
https://github.com/Kuzma30/FreeCAD/tree/qt6v1
are those changes still compatible with qt 5.9?
User avatar
Kuzma30
Posts: 163
Joined: Wed Oct 24, 2018 11:50 am
Location: Ukraine

Re: Supporting Qt 6 - What's needed?

Post by Kuzma30 »

adrianinsaval wrote: Sat Jul 09, 2022 9:30 pm
Kuzma30 wrote: Sat Jul 09, 2022 10:10 am I follow https://doc.qt.io/qt-6/porting-to-qt6-using-clazy.html
https://github.com/Kuzma30/FreeCAD/tree/qt6
I apply 4 checks as shown on "How to apply Clazy checks within Qt Creator" chapter.
Some of files is failed (600+) But QtCreator not save failed files list. (or I make mistake and not found where)

Edit
Run checks without strings convertion
https://github.com/Kuzma30/FreeCAD/tree/qt6v1
are those changes still compatible with qt 5.9?
No.
It will compile with qt6 only. I made it to see how clazy porting tool work.
If we follow porting guide than we must disable obsolete function for qt5.15 not 5.9. (read my previous post)
RealThunder's A3 Wiki translation, join the project https://crowdin.com/project/freecad-asm3-wiki
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Supporting Qt 6 - What's needed?

Post by heda »

disclaimer - i do not do c...

but is it not the https://www.qt.io/blog/porting-from-qt- ... at-library that is needed for fc at this point in time, both 5 & 6 compilation and runtimes?

in my amateur eyes clazy seems to be aimed at porting to 6 and ditching 5...

this whole story also raises the hypothetical question if fc should still keep pyside - alias, or switch to pyside2 (and lock the door on 4) - sort of implies that also in c one could go for 5 instead of 4 base...
had one edge use case (on linux) where i could not get imports working (forgot what it was - probably a not very important use case), since the fc code base uses pyside imports while in reality the installed package is pyside2...

if someone finds the time, just out of personal interest,
how is the shiboken/pivy deps influenced by 5 or 6 (other than that it obviously has to be complied to matching qt and py versions)?
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Supporting Qt 6 - What's needed?

Post by adrianinsaval »

heda wrote: Sun Jul 10, 2022 8:20 am in my amateur eyes clazy seems to be aimed at porting to 6 and ditching 5...
yes but we can't take the suggestion, keep those that are compatible with both as is and those qt6 specific inside if else blocks
this whole story also raises the hypothetical question if fc should still keep pyside - alias, or switch to pyside2 (and lock the door on 4) - sort of implies that also in c one could go for 5 instead of 4 base...
the door for qt4 is already closed, minimum supported version is qt 5.9 currently, using pyside2 might be problematic because we now need pyside6 for qt6, perhaps we can have an alias that is set to pyside2 or pyside6 depending on the chosen qt version? I don't know much of how this part works.
how is the shiboken/pivy deps influenced by 5 or 6 (other than that it obviously has to be complied to matching qt and py versions)?
There is shiboken6, I guess we need pivy compiled against qt6 too.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Supporting Qt 6 - What's needed?

Post by Kunda1 »

adrianinsaval wrote: Sun Jul 10, 2022 6:33 pm There is shiboken6, I guess we need pivy compiled against qt6 too.
Someone volunteer to open an upstream Pivy ticket for this?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
grd
Posts: 328
Joined: Wed Apr 13, 2022 5:13 am
Location: Eindhoven, The Netherlands

Re: Supporting Qt 6 - What's needed?

Post by grd »

chennes wrote: Fri Jan 07, 2022 4:01 am Are there other sticking points to be aware of?
Three questions:
1. What about Python itself? Which version is gonna be the default for 0.21? 3.10 has some interesting new stuff with switch/case.
2. About PySide6. Why is that "required" for external WB instead of just "Qt-6" when you already use it internally?
3. Is Qt-6 gonna be used in 0.21 ?
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
Post Reply