Be careful with this one -- my recollection is that QRegularExpression does not exist in 5.9, so to support both 5.9 and 6.2 you will actually need to have both pieces of code in there, with a preprocessor (C++) or if/else (Python) branch statement controlling which is chosen.
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?
Re: Supporting Qt 6 - What's needed?
I checked it already; it says in the docs that QRegularExpression was introduced already in Qt 5.0, and Qt4 is going to be dropped in FreeCAD 0.20. So, no need to use macros there!chennes wrote: ↑Fri Jan 21, 2022 4:49 pm Be careful with this one -- my recollection is that QRegularExpression does not exist in 5.9, so to support both 5.9 and 6.2 you will actually need to have both pieces of code in there, with a preprocessor (C++) or if/else (Python) branch statement controlling which is chosen.
https://doc.qt.io/qt-5/qregularexpression.html
Re: Supporting Qt 6 - What's needed?
Thanks! It was the QRegularExpression-taking "setFilterRegularExpression()" function from QSortFilterProxyModel that I had remembered biting me (that was only added in Qt 5.12).
Re: Supporting Qt 6 - What's needed?
Hi all,
I had issues running FreeCAD on my 2020 MacBook Pro with the M1 Apple Silicon (and wanted it nativ, not using Rosetta).
Therefore (because of the Lack of Python 3.7 support) I had to migrate to QT6!
I did lots of the mentioned work, some things are still missing though.
Please have a look at:
https://github.com/StStME/FreeCAD/tree/migrate/pyside6
it might be much easier to build on a X86_64 linux machine.
I Introduced the cmake variable "BUILD_QT6" and you need to enable "BUILD_GUI"
Any feedback is welcome
I had issues running FreeCAD on my 2020 MacBook Pro with the M1 Apple Silicon (and wanted it nativ, not using Rosetta).
Therefore (because of the Lack of Python 3.7 support) I had to migrate to QT6!
I did lots of the mentioned work, some things are still missing though.
Please have a look at:
https://github.com/StStME/FreeCAD/tree/migrate/pyside6
it might be much easier to build on a X86_64 linux machine.
I Introduced the cmake variable "BUILD_QT6" and you need to enable "BUILD_GUI"
Any feedback is welcome
Re: Supporting Qt 6 - What's needed?
Nice work StSt94! I notice we've done a lot of redundant work
What's left to do in your branch regarding functionality? And are you planning on getting this cleaned up and sent upstream too?
I think we should try to simplify the cmake files and remove old legacy code while we're at it.
For instance, I don't think we need a new build option (BUILD_QT6), in fact, we should probably remove the BUILD_QT5 option as well as qt4 isn't supported anymore.
We also have support for qwebkit and qglwidget which has been deprecated since long.
I think a first step to get this to the main branch is to locate and remove deprecated libraries and use modern ones that are supported on Qt 5.9 (minimum qt version for freecad 0.20) and create a PR for that.
After having a cleaned and refactored version of freecad, we could bolt on qt6-only alternative where needed in a second PR.
I think that doing it this way would make it a bit easier to code review.
Any thoughts?
What's left to do in your branch regarding functionality? And are you planning on getting this cleaned up and sent upstream too?
I think we should try to simplify the cmake files and remove old legacy code while we're at it.
For instance, I don't think we need a new build option (BUILD_QT6), in fact, we should probably remove the BUILD_QT5 option as well as qt4 isn't supported anymore.
We also have support for qwebkit and qglwidget which has been deprecated since long.
I think a first step to get this to the main branch is to locate and remove deprecated libraries and use modern ones that are supported on Qt 5.9 (minimum qt version for freecad 0.20) and create a PR for that.
After having a cleaned and refactored version of freecad, we could bolt on qt6-only alternative where needed in a second PR.
I think that doing it this way would make it a bit easier to code review.
Any thoughts?
Re: Supporting Qt 6 - What's needed?
Agree. But we still might need an option for people wanting to build with an older version of Qt (for ex. the "stable" one) even if a newer version (a "development" one) is found on the system. I can image for ex Linux distro package maintainers needing that. Maybe just an option to force a particular Qt version number? If empty, it would use the highest found.
Yes, that seems like a perfect path.
Re: Supporting Qt 6 - What's needed?
Thanks! Well I should have had a look at the forum before starting, I might have used lots of your work as starting point..
but yes, of course, if accepted, I would gladly contribute a cleaned version.
So what's left regarding functionality... well, as I wrote in my latest commit Message: "launches, can create a cube.. "
That said, the Measure, TechDraw and WebGui Mod is still not ready.
I was trying to get the WebGui up and running but I miss symbols for arm64 so next step is to compile chromium for qt6 webengine.
And: Testing, Testing, Testing.
As I do not have a amd64 computer I would ask anyone to try to build what I have already done and to check if It is working as well.
I totally agree with you here! I introduced the BUILD_QT6 option to be able to selectively enable and disable things during the development phase.hyarion wrote: ↑Wed Jan 26, 2022 10:43 pm I think we should try to simplify the cmake files and remove old legacy code while we're at it.
For instance, I don't think we need a new build option (BUILD_QT6), in fact, we should probably remove the BUILD_QT5 option as well as qt4 isn't supported anymore.
We also have support for qwebkit and qglwidget which has been deprecated since long.
I would go with this. But might keep it until everything works so we don't have too many uncertainties.
Lets start
I would compare our both repos and combine the changes to have a common base.
And if it is done I might buy a iPad Pro with Apple Silicon and use FreeCAD on a Tablet with a Pen
Re: Supporting Qt 6 - What's needed?
Measure and TechDraw are also alive now.
So what would be really helpful if someone could try to build this on a (amd64) Linux machine where build dependencies are available to see whether WebGUI can be built as well. Since in my case it fails linking because of missing arm64 symbols it might be good.
- babaroga
- Posts: 180
- Joined: Sun Aug 14, 2016 6:52 pm
- Location: Banja Luka, Republic of Srpska, Bosnia and Herzegovina
Re: Supporting Qt 6 - What's needed?
Hello @StSt94
I managed to build FreeCAD from your source on Manjaro.
I had to comment out two lines in .CMakeLists.txt
Also in src/Gui/CMakeLists.txt i had to manually add path to Qt6 moc
Also i had to manually point to Pyside6 rcc and uic.
Part, PartDesign, Sketcher, Techdraw works.
Path, Draft and Arch is not working. Start is not working ("No module named WebGUI")
There is no icons in tree view.
It is late so i will test it more tomorrow. Let me know if I can test something or help in some other way.
I managed to build FreeCAD from your source on Manjaro.
Code: Select all
OS: Manjaro Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.27103 (Git)
Build type: Release
Branch: migrate/pyside6
Hash: a059b5d1b9015a40a0283854e701b7b723aea068
Python version: 3.10.1
Qt version: 6.2.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)
I had to comment out two lines in .CMakeLists.txt
Code: Select all
#/Users/stefan.steinmueller/workspace/pyside-setup/build/qfp-py3.9-qt6.2.2-64bit-release/build/shiboken6/libshiboken/libshiboken6.cpython-39-darwin.6.0.0.dylib
#/Users/stefan.steinmueller/workspace/pyside-setup/build/qfp-py3.9-qt6.2.2-64bit-release/build/pyside6/libpyside/libpyside6.cpython-39-darwin.6.0.0.dylib
Code: Select all
## hacky hack:
#qt/libexec/moc
#/opt/homebrew/Cellar/qt/6.2.2/share/qt/libexec/moc
set(Qt6Core_MOC_EXECUTABLE /usr/lib/qt6/moc)
Part, PartDesign, Sketcher, Techdraw works.
Path, Draft and Arch is not working. Start is not working ("No module named WebGUI")
There is no icons in tree view.
It is late so i will test it more tomorrow. Let me know if I can test something or help in some other way.