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
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Supporting Qt 6 - What's needed?

Post by chennes »

Sure - I’m talking about Python here, “build” is never an issue. I just want to make sure no one decides to just rip out the QRegExp code without testing it. In Python there is no compiler to catch those things, the code has to actually be exercised.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Supporting Qt 6 - What's needed?

Post by wmayer »

So far I have replaced most of the occurrences of QRegExp with QRegularExpression. The class is still used in the class DlgCreateNewPreferencePackImp and the Path, AddonManager and TechDraw modules.

Btw, my PySide2 package for XUbuntu 18.04 (taken from the PPA) already provides QRegularExpression. So, I don't think it's a problem to also port the Python code.
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Supporting Qt 6 - What's needed?

Post by chennes »

It wasn't QRegularExpression itself that gave me the problems -- it was various "client" classes that only supported the old QRegExp class, and it wasn't well-documented which versions of PySide actually implemented them properly. The one that springs immediately to mind is QRegularExpressionValidator -- can you check if your version of PySide has that now?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Supporting Qt 6 - What's needed?

Post by wmayer »

Too bad. This class is indeed missing. It's supposed to be part of QtGui. But an option is that we implement it in Python and put the code to here:
https://github.com/FreeCAD/FreeCAD/blob ... .cmake#L68
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Supporting Qt 6 - What's needed?

Post by chennes »

Can you also check QSortFilterProxyModel to see if it now supports QRegularExpression? I have a note that says it was added to PySide in Qt 5.12, but I'm not sure of my source for that comment. I'm just checking whether it has setFilterRegularExpression() to see if I can use it or not, rather than pegging to a specific Qt version.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Supporting Qt 6 - What's needed?

Post by chennes »

wmayer wrote: Fri Oct 07, 2022 5:19 pm But an option is that we implement it in Python and put the code to here:
I don't think that is really necessary: the current code already works around the missing class. When used with Qt6 it ought to just work, the QRegExp code path will never get executed if the necessary QRegularExpression functionality exists. It's not as clean as with C++, where we are able to literally "delete" code paths via the preprocessor, but I believe I implemented both instances of QRegExp so that that class will never get instantiated in the Qt6 code paths.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Supporting Qt 6 - What's needed?

Post by wmayer »

chennes wrote: Fri Oct 07, 2022 5:28 pm Can you also check QSortFilterProxyModel to see if it now supports QRegularExpression?
It's missing. The Qt docs also say it has been added with 5.12:
https://doc.qt.io/qt-5/qsortfilterproxy ... ssion-prop
berniev
Posts: 247
Joined: Wed Apr 13, 2022 10:45 pm
Location: Oz

Re: Supporting Qt 6 - What's needed?

Post by berniev »

New roablock is xml stuff in TechDraw.

Thanks to prior work by @StSt94 I have been making some progress but anyone with knowledge of the matter would be much quicker!

As an aside, several people each did a bunch of work on QT6 migration. There was also overwhelming support for collaboration. Pity all were rejected out of hand.
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Supporting Qt 6 - What's needed?

Post by chennes »

@wmayer when we migrated to PySide2, how did we communicate from cMake to the Python code that it should use the new import statements? Was there a variable in FreeCAD or FreeCADGui?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
wmayer
Founder
Posts: 20245
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Supporting Qt 6 - What's needed?

Post by wmayer »

You mean the way to still use

Code: Select all

from PySide import QtCore
instead of

Code: Select all

from PySide2 import QtCore
in Python code? That's achieved by the file SetupShibokenAndPyside.cmake. At configure time it creates some files under Ext/PySide and inside that files the PySide2 modules are loaded.
Post Reply