-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix QT version checking macros #81
Conversation
#if (QT_VERSION < 0x051500) is very different from #if (QT_VERSION < QT_VERSION_CHECK(5,15,0)) because 0x051500 != ((5<<15) + (15<<8) + (0)), which is how Qt calculates QT_VERSION. See qglobal.h. This correction uncovered a bug in src/QxDao/QxSqlRelationLinked.cpp, where some template arguments were missing. Also corrected the version checks for QLinkedList. This class was deprecated in 5.15.0, and QxOrm was checking against 6.0.0
Hello, Thx you are right : 0x051500 doesn't mean 5.15 Qt version because this is not an hexa value. All checks in QxOrm library should be OK until 5.9 Qt version (because hexa value equals to decimal value). |
That was a problem with the Qt4 MOC, but hasn't been a problem since Qt5. QT_VERSION_CHECK is the canonical way to do the check. It will function even if Qt changes the internal format of the version specifier. |
I have some customers who are still using Qt4 : this is why I would prefer to change some version checks to hexa value. |
This reverts commit 14505ca.
- QLinkedList class was deprecated in qt-5.15 - QHash::unite() was deprecated in qt-5.15 - QRegion::rects() was deprecated in qt-5.11
Updated the branch to use hex values instead of the macro. Few other bug fixes too. |
Thank you very much, I will take a look on that when I will have some time :) |
Done in the latest commit. |
- Fix compilation issue with Qt 6.2+ (due to Qt JIRA : https://bugreports.qt.io/browse/QTBUG-92910), more details in GitHub issue #54 - Support QSqlQuery::execBatch() method to improve performance inserting/updating/deleting a list of C++ instances in database (new optional parameter 'bUseExecBatch' available for functions : qx::dao::insert, qx::dao::update, qx::dao::delete_by_id) - New method in qx::QxSqlQuery class named setFctOnBeforeSqlPrepare() to define a custom callback function to modify SQL query before preparing in database - New callbacks functions available in qx::IxDataMember interface to customize SQL generated per data member (see an example in ./test/qxBlogCompositeKey/src/blog.cpp file) - Fix an issue in qx::QxSqlRelationLinked::hierarchyResolveOutput() which could call getIdFromQuery() for nothing, which could generate some warnings in Qt SQL driver (for example : QPSQLResult::data: column XX out of range) - Fix a compilation issue of QxRestApi and QxHttpTransaction modules with Qt QStringBuilder option enabled (GitHub issues #50, #83) - Improve SQL DISTINCT to support relationships (unit test available in qxBlog sample project) - New feature to fetch relationships only in LEFT OUTER/INNER JOIN and WHERE clauses (so no columns in SELECT part) : use {NULL} syntax to define no relation columns in SELECT part (unit test available in qxBlog sample project) - Fix a crash which could occur using qx::QxSession and multi-threaded environment - Add a new parameter caseSensitive (default value : false) to the method qx::QxSqlQuery::getSqlResultAt() - Fix an issue with JSON REST API (QxRestApi module) and MongoDB database (more details in GitHub issue #70) - Improve qx::QxClassX::registerAllClasses() : init all validator instances (can fix some issues in a multi-thread environment) - New settings available in the qx::QxSqlDatabase singleton class (setSqlDelimiterForTableNameAlias() and setSqlDelimiterForColumnNameAlias()) to add delimiters to SQL aliases (more details in GitHub issue #57) - Fix linking error which could occur with Qt6 and MSVC2019 (should fix GitHub issues #98, #91, #89, #90, #62, #65) - Fix all checks with QT_VERSION (using macro QT_VERSION_CHECK), should fix checks from Qt 5.10 to Qt 5.15 (GitHub issue #81)
#if (QT_VERSION < 0x051500)
is very different from
#if (QT_VERSION < QT_VERSION_CHECK(5,15,0))
because 0x051500 != ((5<<15) + (15<<8) + (0)), which is how Qt calculates QT_VERSION. See qglobal.h.
This correction uncovered a bug in src/QxDao/QxSqlRelationLinked.cpp, where some template arguments were missing.
Also corrected the version checks for QLinkedList. This class was deprecated in 5.15.0, and QxOrm was checking against 6.0.0