[graphics/krita] /: MSVC: Disable strict Qt iterators for Qt 5.13+

L. E. Segovia null at kde.org
Mon Jan 9 02:59:04 GMT 2023


Git commit 6ecd7887275892f35426fb44fe468d7d80962a1c by L. E. Segovia.
Committed on 09/01/2023 at 02:51.
Pushed by lsegovia into branch 'master'.

MSVC: Disable strict Qt iterators for Qt 5.13+

MSVC is unable to disambiguate between definitions of QVector<QPointF>
and QPolygonF. This is a known upstream bug, e.g.:

- https://phabricator.kde.org/D21314
- https://codereview.qt-project.org/c/qt/qtbase/+/180229

Starting with Qt 5.13, it is impossible to use strict iterators
wholesale because of the following commit:

commit 972f8845a85d6a07140025e4257cb8a1a2699b5d
Author: Lars Knoll <lars.knoll at qt.io>
Date:   Mon Oct 8 11:55:13 2018 +0200

    Invert include dependencies between QList and QVector

    This is a very slight source incompatibility, but required as
    a preparation for Qt 6, where QList should inherit QVector or
    share the implementation with it.

    This requires some special work to correctly instantiate and
    export QVector<QPoint> from Qt Core on MSVC.

    Change-Id: I1d042c5fafdde7afe59409eda2580871d4832fcd
    Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>

This emergency change is necessary because otherwise the build won't
even get past kritaglobal, which uses that one specific class.

CCMAIL: kimageshop at kde.org

M  +10   -1    CMakeLists.txt

https://invent.kde.org/graphics/krita/commit/6ecd7887275892f35426fb44fe468d7d80962a1c

diff --git a/CMakeLists.txt b/CMakeLists.txt
index dc3a9c6c5e..08d3ef6562 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -529,13 +529,22 @@ endif()
 
 add_definitions(
   -DQT_USE_QSTRINGBUILDER
-  -DQT_STRICT_ITERATORS
   -DQT_NO_SIGNALS_SLOTS_KEYWORDS
   -DQT_NO_URL_CAST_FROM_STRING
   -DQT_USE_FAST_CONCATENATION 
   -DQT_USE_FAST_OPERATOR_PLUS
 )
 
+# MSVC is unable to disambiguate between definitions of QVector<QPointF> 
+# and QPolygonF. This is a known upstream bug e.g.:
+# - https://phabricator.kde.org/D21314
+# - https://codereview.qt-project.org/c/qt/qtbase/+/180229
+# Starting with Qt 5.13, it is impossible to use strict iterators
+# wholesale because of:
+# https://github.com/qt/qtbase/commit/972f8845a85d6a07140025e4257cb8a1a2699b5d
+if (NOT MSVC OR ${Qt5_VERSION} VERSION_LESS "5.13.0")
+  add_definitions(-DQT_STRICT_ITERATORS)
+endif()
 
 #if (${Qt5_VERSION} VERSION_GREATER "5.14.0" )
 #    add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x50F00)


More information about the kimageshop mailing list