Supporting Qt 6 - What's needed?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Supporting Qt 6 - What's needed?
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.
Re: Supporting Qt 6 - What's needed?
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.
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.
Re: Supporting Qt 6 - What's needed?
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?
Re: Supporting Qt 6 - What's needed?
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
https://github.com/FreeCAD/FreeCAD/blob ... .cmake#L68
Re: Supporting Qt 6 - What's needed?
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.
Re: Supporting Qt 6 - What's needed?
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.
Re: Supporting Qt 6 - What's needed?
It's missing. The Qt docs also say it has been added with 5.12:
https://doc.qt.io/qt-5/qsortfilterproxy ... ssion-prop
Re: Supporting Qt 6 - What's needed?
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.
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.
Re: Supporting Qt 6 - What's needed?
@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?
Re: Supporting Qt 6 - What's needed?
You mean the way to still use
instead of
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.
Code: Select all
from PySide import QtCore
Code: Select all
from PySide2 import QtCore