Supporting Qt5
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Supporting Qt5
Hey,
There is some important Mac fixes in Qt5, so it would be really nice to able build FreeCAD with Qt5. Does anyone know if it would require a lot of changes to support both Qt4 and Qt5?
~ Peter
There is some important Mac fixes in Qt5, so it would be really nice to able build FreeCAD with Qt5. Does anyone know if it would require a lot of changes to support both Qt4 and Qt5?
~ Peter
- tanderson69
- Veteran
- Posts: 1626
- Joined: Thu Feb 18, 2010 1:07 am
Re: Supporting Qt5
I don't think anybody has tried it. I am guessing it won't be huge. a good place to start: http://qt-project.org/wiki/Transition_f ... 4.x_to_Qt5
Re: Supporting Qt5
Cool, I think I will give it a try.
- tanderson69
- Veteran
- Posts: 1626
- Joined: Thu Feb 18, 2010 1:07 am
Re: Supporting Qt5
great! create a branch and push it somewhere. Keep us "in the know". I will do some trial builds on kubuntu when needed.
Re: Supporting Qt5
Okay, will do.
Does anyone have a preference on how I do the conditional code?
Does anyone have a preference on how I do the conditional code?
Code: Select all
#if QT_VERSION >= 0x050000
//Qt 5 stuff
#else
//Qt 4 stuff
#endif
Code: Select all
#if QT_VERSION < 0x050000
//Qt 4 stuff
#else
//Qt 5 stuff
#endif
Re: Supporting Qt5
Both methods are fine.Does anyone have a preference on how I do the conditional code?
Re: Supporting Qt5
Progress update: I have SoQt working with Qt5 now https://bitbucket.org/peterl94/soqt. Configure with --with-qt5 to enable. I haven't tested it yet on any other platforms besides Mac OS X 10.6.
-
- Posts: 655
- Joined: Fri Jul 22, 2011 8:37 pm
- Contact:
Re: Supporting Qt5
from what I remember, there will need to be substantial changes to the 3D View / SoQt to support Qt5 because of the change to the underlying presentation framework - Lighthouse project. I think these are QWindow and QScreen.
I think the rest of FreeCAD should be fairly straightforward to port.
There's a compile flag that might be an issue with Cmake and shared libraries - see '-fpic'
http://www.kdab.com/using-cmake-with-qt-5/
It will be interesting in the long run, Qt 5.2 now supports QML desktop widgets, which will be really good for the task view windows rather than the QtDesigner ones. KDE Framework 5 will be released in Summer, but I doubt it will be ready for the masses.
I think the rest of FreeCAD should be fairly straightforward to port.
There's a compile flag that might be an issue with Cmake and shared libraries - see '-fpic'
http://www.kdab.com/using-cmake-with-qt-5/
It will be interesting in the long run, Qt 5.2 now supports QML desktop widgets, which will be really good for the task view windows rather than the QtDesigner ones. KDE Framework 5 will be released in Summer, but I doubt it will be ready for the masses.
Development blog - http://freecadamusements.blogspot.co.uk/
Re: Supporting Qt5
Okay, so now I have the core app and the part workbench working with Qt 5. Thankfully, the Qt devs did a pretty good job at keeping compatibility with Qt 4. I pushed the changes to peterl94/qt5. Again, I've only tested this on OS X, and only a little at that. To build with Qt 5, set FREECAD_USE_QT5 cmake option. (Note: I used features that are only available in CMake >= 2.8.11)
It's going to be a long time before there will a complete FreeCAD running with Qt 5 -- there is no PySide version for Qt 5, and from what I've read, the PySide devs don't have an interest in doing it (or at least it's very low on their priority list).
There are a couple changes I did that I wasn't sure about. The first one being changing QCoreApplication::translate to QObject::tr, because the Qt docs made it sound like they were equivalent, but then I was thinking the class name passed to QCoreApplication::translate is need for something? The second one was to PropertyModel::buildUp. I wasn't sure if I put QAbstractItemModel::begin/endResetModel in the right place.
It's going to be a long time before there will a complete FreeCAD running with Qt 5 -- there is no PySide version for Qt 5, and from what I've read, the PySide devs don't have an interest in doing it (or at least it's very low on their priority list).
There are a couple changes I did that I wasn't sure about. The first one being changing QCoreApplication::translate to QObject::tr, because the Qt docs made it sound like they were equivalent, but then I was thinking the class name passed to QCoreApplication::translate is need for something? The second one was to PropertyModel::buildUp. I wasn't sure if I put QAbstractItemModel::begin/endResetModel in the right place.
Re: Supporting Qt5
Great you look into this. But I feel no need to switch to Qt5. The 5 was mainly driven by Nokias need for mobile platform. I see little to nothing to gain for C++ desktop applications. Or am I wrong!?
Stop whining - start coding!