summaryrefslogtreecommitdiff
path: root/libraries/qt5/patches/QTBUG-39047.patch
blob: ee6e4ad40ef6f7c97011e07b5a3313023b781abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From 009ad875f89d7d7bc4447e18c2fbbd485a75e0b5 Mon Sep 17 00:00:00 2001
From: Oleg Shparber <trollixx@gmail.com>
Date: Mon, 19 May 2014 00:53:39 -0700
Subject: [PATCH] Fix improper antialiasing property behavior

For components antialiased by default the property was returned
as false if default true value was set to true again.

Task-number: QTBUG-39047
Change-Id: I16960a12b6d38a0d9e487fc6612610c39c4949d4
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
---
 src/quick/items/qquickitem.cpp                 |    8 +++++---
 tests/auto/quick/qquicktext/tst_qquicktext.cpp |    7 +++++++
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 3f0dae8..ef2eac4 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -5691,10 +5691,12 @@ void QQuickItem::setAntialiasing(bool aa)
 {
     Q_D(QQuickItem);
 
-    bool changed = (aa != antialiasing());
-    d->antialiasingValid = true;
+    if (!d->antialiasingValid) {
+        d->antialiasingValid = true;
+        d->antialiasing = d->implicitAntialiasing;
+    }
 
-    if (!changed)
+    if (aa == d->antialiasing)
         return;
 
     d->antialiasing = aa;
diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
index 0b69981..d36c55d 100644
--- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp
+++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp
@@ -1334,6 +1334,13 @@ void tst_qquicktext::antialiasing()
     text->resetAntialiasing();
     QCOMPARE(text->antialiasing(), true);
     QCOMPARE(spy.count(), 2);
+
+    // QTBUG-39047
+    component.setData("import QtQuick 2.0\n Text { antialiasing: true }", QUrl());
+    object.reset(component.create());
+    text = qobject_cast<QQuickText *>(object.data());
+    QVERIFY(text);
+    QCOMPARE(text->antialiasing(), true);
 }
 
 void tst_qquicktext::weight()
-- 
1.7.1