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!
berniev
Posts: 247
Joined: Wed Apr 13, 2022 10:45 pm
Location: Oz

Re: Supporting Qt 6 - What's needed?

Post by berniev »

For a bit of fun, and figuring that if I am going to learn stuff it might as well be good future stuff ...

I am attempting build with Qt6.31, Pyside6, Shiboken6, Python3.10, C++20.

Seems like a reasonable goal!!

Of course I'm hitting bumps all over the place. Anyone wanna talk about it? (very quiet here lately)

VTK is not python3.10, but close.

Bunch of deprecations in Qt6 which are used quite a bit in FC
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Supporting Qt 6 - What's needed?

Post by chennes »

Are you using the Clazy-Qt6 checks? That would be an easy place to start -- I mean, it's going to mean a lot of code, but conceptually anyway it's not difficult, we just have to make sure to continue to support Qt 5.9, so lots of preprocessor directives in C++, and probably hasattr in Python (at least, that's how I've handled the QRegExp/QRegularExpression stuff).

We can start committing this stuff anytime, since we aren't removing support for older Qt versions, just adding support for the new one, and it doesn't have to happen all at once. Once we have enough we'll turn on the Clazy-Qt6 stuff in our own CI.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
berniev
Posts: 247
Joined: Wed Apr 13, 2022 10:45 pm
Location: Oz

Re: Supporting Qt 6 - What's needed?

Post by berniev »

make sure to continue to support Qt 5.9
For how long?

Is this the accepted plan, or your thoughts?
so lots of preprocessor directives in C++
That would be horrible!
how I've handled the QRegExp/QRegularExpression stuff
Twice, and duplicated the code.

Have you looked at Qt6 Core5Compat?
User avatar
chennes
Veteran
Posts: 3876
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Supporting Qt 6 - What's needed?

Post by chennes »

berniev wrote: Tue Sep 27, 2022 1:31 pm
make sure to continue to support Qt 5.9
For how long?
Until Ubuntu 18.04 LTS end of life (so something like six months from now) as I recall. We discussed this when we were releasing 0.20, but maybe @wmayer would care to weigh in. It would make life a lot easier if we could advance that (since I think it's unlikely that 1.0 will be ready before 18.04 is EOL).
so lots of preprocessor directives in C++
That would be horrible!
Yes, having to support two versions of Qt is ugly, but there isn't a way around it. Even if we were to advance all the way to 5.15 as the minimum (and I think 5.12 is more likely) I believe there are still some things that will have to be conditionally compiled in C++. As far as I'm concerned the situation in Python is even worse, because it's not as well documented, and PySide6 does things like drop support for the Qt resource system entirely.
how I've handled the QRegExp/QRegularExpression stuff
Twice, and duplicated the code.
Right -- if I have to do it a third time I guess I'll get around to refactoring :).
Have you looked at Qt6 Core5Compat?
I knew it existed, but I haven't used it for anything.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Supporting Qt 6 - What's needed?

Post by adrianinsaval »

I see no point in supporting 18.04 in git master, it's not going to be released before it reaches EOL and the daily ppa is broken anyways. Plus nowadays the rare users of it can resort to appimage/snap/flatpak/conda
berniev
Posts: 247
Joined: Wed Apr 13, 2022 10:45 pm
Location: Oz

Re: Supporting Qt 6 - What's needed?

Post by berniev »

Code: Select all

PySide6 does things like drop support for the Qt resource system entirely. 
Apparently that is no longer the problem it was:
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Supporting Qt 6 - What's needed?

Post by adrianinsaval »

I don't know if this was an issue for pyside too but note that the stackoverflow question and answer are about pyqt, FreeCAD uses pyside, not pyqt
berniev
Posts: 247
Joined: Wed Apr 13, 2022 10:45 pm
Location: Oz

Re: Supporting Qt 6 - What's needed?

Post by berniev »

adrianinsaval wrote: Tue Sep 27, 2022 3:58 pm I don't know if this was an issue for pyside too but note that the stackoverflow question and answer are about pyqt, FreeCAD uses pyside, not pyqt
Oops. Thanks for pointing that out! Back to Mr Google ..
berniev
Posts: 247
Joined: Wed Apr 13, 2022 10:45 pm
Location: Oz

Re: Supporting Qt 6 - What's needed?

Post by berniev »

PySide6 does things like drop support for the Qt resource system entirely
In my searching I'm not seeing an issue. Could someone expand on this a bit?
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Supporting Qt 6 - What's needed?

Post by wmayer »

Until Ubuntu 18.04 LTS end of life (so something like six months from now) as I recall. We discussed this when we were releasing 0.20, but maybe @wmayer would care to weigh in. It would make life a lot easier if we could advance that (since I think it's unlikely that 1.0 will be ready before 18.04 is EOL).
Sure, I can upgrade to Ubuntu 20.04 but this will take me some time to do that.
Yes, having to support two versions of Qt is ugly, but there isn't a way around it.
That is a fact we always have to deal with independent if the lowest Qt version is 5.9 or 5.12 because between two Qt versions there is always an API change. And if we support Qt5 and Qt6 then there will be even more #ifdef's. To reduce them in our code base we can implement some convenience functions. AFAIK in Qt 5.15 all classes or functions are marked deprecated that will be removed in Qt6 and therefore a couple of convenience functions have been implemented e.g. Base/Mutex.h, Base/QtTools, Gui/Tools.h, ...
and PySide6 does things like drop support for the Qt resource system entirely.
Is there a reason for it? And what about Qt itself? Or is it rather that the Qt tools can be directly used for Python code?
Have you looked at Qt6 Core5Compat?
The question is how useful it is. I remember that for the move from Qt3 to Qt4 there also was a support library but its main purpose was that you didn't get compile errors but functionality-wise pretty much everything was broken. So, there was no alternative than fully porting to Qt4 as soon as possible.
Post Reply