public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtdeclarative/files/, dev-qt/qtdeclarative/
Date: Wed, 20 Nov 2019 21:21:24 +0000 (UTC)	[thread overview]
Message-ID: <1574284842.c501b6c8adce80fc35e846f4aebfc6e3007f07cc.asturm@gentoo> (raw)

commit:     c501b6c8adce80fc35e846f4aebfc6e3007f07cc
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 16 12:45:21 2019 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 21:20:42 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c501b6c8

dev-qt/qtdeclarative: Handle reads of QQmlPropertyMap correctly

Package-Manager: Portage-2.3.79, Repoman-2.3.17
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...ive-5.13.2-read-QQmlPropertyMap-correctly.patch | 92 ++++++++++++++++++++++
 .../qtdeclarative/qtdeclarative-5.13.2-r1.ebuild   | 57 ++++++++++++++
 2 files changed, 149 insertions(+)

diff --git a/dev-qt/qtdeclarative/files/qtdeclarative-5.13.2-read-QQmlPropertyMap-correctly.patch b/dev-qt/qtdeclarative/files/qtdeclarative-5.13.2-read-QQmlPropertyMap-correctly.patch
new file mode 100644
index 00000000000..63f4235c9e7
--- /dev/null
+++ b/dev-qt/qtdeclarative/files/qtdeclarative-5.13.2-read-QQmlPropertyMap-correctly.patch
@@ -0,0 +1,92 @@
+From bcbc3c9cec1f7d7bb8c9d5f5ea94eb5c81ec2853 Mon Sep 17 00:00:00 2001
+From: Fabian Kosmale <fabian.kosmale@qt.io>
+Date: Wed, 30 Oct 2019 10:15:23 +0100
+Subject: [PATCH] QQmlProperty: handle reads of QQmlPropertyMap correctly
+
+Fixes: QTBUG-79614
+Change-Id: Iaf84c0178dc88072a367da2b42b09554b85c7d57
+Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
+---
+ src/qml/qml/qqmlproperty.cpp                     | 12 +++++++++---
+ tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp | 21 +++++++++++++++++++++
+ 2 files changed, 30 insertions(+), 3 deletions(-)
+
+diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
+index c8166695bad..a394ed1ad9a 100644
+--- a/src/qml/qml/qqmlproperty.cpp
++++ b/src/qml/qml/qqmlproperty.cpp
+@@ -63,6 +63,7 @@
+ #include <private/qqmlvaluetypewrapper_p.h>
+ #include <QtCore/qdebug.h>
+ #include <cmath>
++#include <QtQml/QQmlPropertyMap>
+ 
+ Q_DECLARE_METATYPE(QList<int>)
+ Q_DECLARE_METATYPE(QList<qreal>)
+@@ -331,10 +332,15 @@ void QQmlPropertyPrivate::initProperty(QObject *obj, const QString &name)
+ 
+                 return;
+             } else {
+-                if (!property->isQObject())
+-                    return; // Not an object property
++                if (!property->isQObject()) {
++                    if (auto asPropertyMap = qobject_cast<QQmlPropertyMap*>(currentObject))
++                        currentObject = asPropertyMap->value(path.at(ii).toString()).value<QObject*>();
++                    else
++                        return; // Not an object property, and not a property map
++                } else {
++                    property->readProperty(currentObject, &currentObject);
++                }
+ 
+-                property->readProperty(currentObject, &currentObject);
+                 if (!currentObject) return; // No value
+ 
+             }
+diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+index 27e06c6f674..ed213cd01aa 100644
+--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
++++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+@@ -37,6 +37,7 @@
+ #include <QtCore/qdir.h>
+ #include <QtCore/private/qobject_p.h>
+ #include "../../shared/util.h"
++#include <QtQml/QQmlPropertyMap>
+ 
+ #include <QDebug>
+ class MyQmlObject : public QObject
+@@ -149,6 +150,8 @@ private slots:
+     void floatToStringPrecision();
+ 
+     void copy();
++
++    void nestedQQmlPropertyMap();
+ private:
+     QQmlEngine engine;
+ };
+@@ -2106,6 +2109,24 @@ void tst_qqmlproperty::initTestCase()
+     qmlRegisterType<MyContainer>("Test",1,0,"MyContainer");
+ }
+ 
++void tst_qqmlproperty::nestedQQmlPropertyMap()
++{
++    QQmlPropertyMap mainPropertyMap;
++    QQmlPropertyMap nestedPropertyMap;
++    QQmlPropertyMap deeplyNestedPropertyMap;
++
++    mainPropertyMap.insert("nesting1", QVariant::fromValue(&nestedPropertyMap));
++    nestedPropertyMap.insert("value", 42);
++    nestedPropertyMap.insert("nesting2", QVariant::fromValue(&deeplyNestedPropertyMap));
++    deeplyNestedPropertyMap.insert("value", "success");
++
++    QQmlProperty value{&mainPropertyMap, "nesting1.value"};
++    QCOMPARE(value.read().toInt(), 42);
++
++    QQmlProperty success{&mainPropertyMap, "nesting1.nesting2.value"};
++    QCOMPARE(success.read().toString(), QLatin1String("success"));
++}
++
+ QTEST_MAIN(tst_qqmlproperty)
+ 
+ #include "tst_qqmlproperty.moc"
+-- 
+2.16.3

diff --git a/dev-qt/qtdeclarative/qtdeclarative-5.13.2-r1.ebuild b/dev-qt/qtdeclarative/qtdeclarative-5.13.2-r1.ebuild
new file mode 100644
index 00000000000..90abd95d64f
--- /dev/null
+++ b/dev-qt/qtdeclarative/qtdeclarative-5.13.2-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 2009-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
+inherit python-any-r1 qt5-build
+
+DESCRIPTION="The QML and Quick modules for the Qt5 framework"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86"
+fi
+
+IUSE="gles2 +jit localstorage +widgets"
+
+BDEPEND="${PYTHON_DEPS}"
+# qtgui[gles2=] is needed because of bug 504322
+DEPEND="
+	~dev-qt/qtcore-${PV}
+	~dev-qt/qtgui-${PV}[gles2=]
+	~dev-qt/qtnetwork-${PV}
+	~dev-qt/qttest-${PV}
+	localstorage? ( ~dev-qt/qtsql-${PV} )
+	widgets? ( ~dev-qt/qtwidgets-${PV}[gles2=] )
+"
+RDEPEND="${DEPEND}
+	!<dev-qt/qtquickcontrols-5.7:5
+"
+
+PATCHES=(
+	"${FILESDIR}/${P}-read-QQmlPropertyMap-correctly.patch" # QTBUG-79614
+)
+
+src_prepare() {
+	use jit || PATCHES+=("${FILESDIR}/${PN}-5.4.2-disable-jit.patch")
+
+	qt_use_disable_mod localstorage sql \
+		src/imports/imports.pro
+
+	qt_use_disable_mod widgets widgets \
+		src/src.pro \
+		src/qmltest/qmltest.pro \
+		tests/auto/auto.pro \
+		tools/tools.pro \
+		tools/qmlscene/qmlscene.pro \
+		tools/qml/qml.pro
+
+	qt5-build_src_prepare
+}
+
+src_configure() {
+	local myqmakeargs=(
+		--
+		-qml-debug
+	)
+	qt5-build_src_configure
+}


             reply	other threads:[~2019-11-20 21:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20 21:21 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-09-08  6:01 [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtdeclarative/files/, dev-qt/qtdeclarative/ Ionen Wolkens
2025-06-13 13:37 Ionen Wolkens
2025-06-05  0:03 Ionen Wolkens
2024-11-15 14:44 Ionen Wolkens
2024-11-15  8:04 Ionen Wolkens
2024-11-05  4:29 Ionen Wolkens
2024-10-19 22:20 Ionen Wolkens
2024-10-10  1:27 Ionen Wolkens
2024-10-08 18:19 Ionen Wolkens
2022-12-10 12:25 Andreas Sturmlechner
2021-01-24 13:03 Andreas Sturmlechner
2018-04-15 17:15 Andreas Sturmlechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1574284842.c501b6c8adce80fc35e846f4aebfc6e3007f07cc.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox