[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    =?utf-8?q?=5Bgraphics/krita=5D_/=3A_MSVC=3A_Disable_strict_Qt_iterators_for_Qt_5=2E13+?=
From:       L. E. Segovia <null () kde ! org>
Date:       2023-01-09 2:59:04
Message-ID: 20230109025904.09BAC1241040 () leptone ! kde ! org
[Download RAW message or body]

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@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@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@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)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic