Hi!
Another week has just passed and I have new things to share. This week was more maintenance work and getting ready before we try to build digiKam with Qt6.
In the last week, I ported a lot of code to Qt 5.15, however we need to maintain compatibility with at least Qt 5.12 LTS. I wrote several pre-processor checks and macros to maintain the required compatibilty. These are some commits:
- Version check for QButtonGroup
- Version check for QWheelEvent
- Version check for QLabel
- Version check for QFlag
- Macro for Qt::endl
- Macro for Qt::SplitBehavior
Next, digiKam had some code that created QSet
objects from a QList
with QList::toSet()
and some calls
to QSet::fromList()
which are deprecated. Qt now enforces the use of QSet
constructor with the container iterators.
This merge request implements this. Thanks to
Alexander Lohnau for pointing out that this patch had the issue of container detachment
because of non const containers.
Prior to this, I had worked only with STL containers and had assumed the iterators to be valid in Qt containers as well. There is always something new to learn everyday in C++.
Now, I’m modernizing the code and using STL algorithms wherever I can to replace for loops
.
cppcheck report of the master branch has a lot of issues. I have to resolve
- qSortCalled
- qrandCalled
- qsrandCalled
- useStlAlgorithm
There is a work-in-progress merge request for this.
Having worked for a few weeks on this project, I can already see the evolution of Qt5 to Qt6. All the deprecations make sense we are moving towards a better Qt. The tasks are intense but I’ve learned a lot.
Thanks for reading! See y’all next week.