Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/visualRoot into lp:ubuntu-ui-toolkit/staging
- visualRoot
- Merge into staging
Status: | Merged |
---|---|
Approved by: | Tim Peeters |
Approved revision: | 2070 |
Merged at revision: | 2159 |
Proposed branch: | lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/visualRoot |
Merge into: | lp:ubuntu-ui-toolkit/staging |
Prerequisite: | lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/outTheWindow |
Diff against target: |
218 lines (+99/-2) 7 files modified
src/UbuntuToolkit/quickutils.cpp (+9/-0) src/UbuntuToolkit/ucmainwindow.cpp (+26/-0) src/UbuntuToolkit/ucmainwindow_p.h (+7/-0) src/UbuntuToolkit/ucmainwindow_p_p.h (+1/-0) src/imports/Components/Popups/1.3/popupUtils.js (+6/-1) tests/unit/mainwindow/VisualRoot.qml (+36/-0) tests/unit/mainwindow/tst_mainwindow.cpp (+14/-1) |
To merge this branch: | bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/visualRoot |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
ubuntu-sdk-build-bot | continuous-integration | Approve | |
Tim Peeters | Approve | ||
Zsombor Egri | Needs Information | ||
Review via email: mp+314684@code.launchpad.net |
Commit message
Add visualRoot property to MainWindow
Description of the change
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2066
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2066
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2066
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2066
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Tim Peeters (tpeeters) wrote : | # |
Let's add documentation in PopupUtils and the popup components on how to change the root item. Also an example/use case would be useful.
- 2067. By Cris Dywan
- 2068. By Cris Dywan
-
Document the role of visualRoot in QuickUtils and popupUtils
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2068
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2068
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2068
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2068
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
FAILED: Continuous integration, rev:2068
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
- 2069. By Cris Dywan
-
Tweak quickutils header include in tst_mainwindow
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2069
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
Tim Peeters (tpeeters) wrote : | # |
some small suggestions for the docs in the inline comments below.
- 2070. By Cris Dywan
-
Reword documentation of visualRoot for clarity
Cris Dywan (kalikiana) wrote : | # |
> > The property holds the window's visual root,
> > as opposed to the root item.
> Should we prepend this sentence with 'If set,'?
> To make it clear that visualRoot is ignored
> when it is null? Or say 'set to null in order
> to use the root item....'.
I moved the If to the start of the sentence.
> > If set, popups (popovers, dialogs, menus) will
> > reparent to it when opened via
> They won't be reparented, they will be created
> as children of visualRoot (as you say in the
> docs of popupUtils).
Yes and no. popupUtils.open creates them initially with the parent. show() on the other hand does reparent after the fact if reparentToRootItem is true.
I made this more explicit now.
> > - QQuickItem *testItem(
> > + QQuickItem *testItem(QObject *that, const QString &identifier)
> why does this have to be changed?
A QQuickWindow is not a QQuickItem. Properties and children are however implemented in QObject and aren't specific to items at all. So we can use them with a window just fine, so long as we don't try to cast it to something unrelated that it isn't.
Zsombor Egri (zsombi) wrote : | # |
A small comment about the property, perhaps we would want to use the QQC2 ApplicationWindow's contentItem as property name?
http://
Cris Dywan (kalikiana) wrote : | # |
> A small comment about the property, perhaps we would want to use the QQC2
> ApplicationWindow's contentItem as property name?
>
> http://
> #contentItem-prop
QQuickWindow already has a contentItem property and it's not the same as what we want for the visualItem to be.
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2070
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2070
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2070
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Tim Peeters (tpeeters) wrote : | # |
Looks good, thanks!
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2070
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2070
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
None: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2070
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2070
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2070
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote : | # |
PASSED: Continuous integration, rev:2070
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'src/UbuntuToolkit/quickutils.cpp' | |||
2 | --- src/UbuntuToolkit/quickutils.cpp 2016-11-11 06:57:56 +0000 | |||
3 | +++ src/UbuntuToolkit/quickutils.cpp 2017-01-18 15:22:13 +0000 | |||
4 | @@ -29,6 +29,8 @@ | |||
5 | 29 | #include <QtQuick/private/qquicktextedit_p.h> | 29 | #include <QtQuick/private/qquicktextedit_p.h> |
6 | 30 | #include <QtSystemInfo/QInputInfoManager> | 30 | #include <QtSystemInfo/QInputInfoManager> |
7 | 31 | 31 | ||
8 | 32 | #include <UbuntuToolkit/private/ucmainwindow_p.h> | ||
9 | 33 | |||
10 | 32 | UT_NAMESPACE_BEGIN | 34 | UT_NAMESPACE_BEGIN |
11 | 33 | 35 | ||
12 | 34 | QuickUtils *QuickUtils::m_instance = nullptr; | 36 | QuickUtils *QuickUtils::m_instance = nullptr; |
13 | @@ -170,11 +172,18 @@ | |||
14 | 170 | * \internal | 172 | * \internal |
15 | 171 | * Returns the root item of a given item. In case there is a QQuickWindow (Window) | 173 | * Returns the root item of a given item. In case there is a QQuickWindow (Window) |
16 | 172 | * found in the hierarchy, the function will return the contentItem of the window. | 174 | * found in the hierarchy, the function will return the contentItem of the window. |
17 | 175 | * If the root item is a \b MainWindow, the visualRoot property will be respected. | ||
18 | 173 | */ | 176 | */ |
19 | 174 | QQuickItem *QuickUtils::rootItem(QObject *object) | 177 | QQuickItem *QuickUtils::rootItem(QObject *object) |
20 | 175 | { | 178 | { |
21 | 176 | // make sure we have the m_rootView updated | 179 | // make sure we have the m_rootView updated |
22 | 177 | lookupQuickView(); | 180 | lookupQuickView(); |
23 | 181 | |||
24 | 182 | UCMainWindow *mainWindow(qobject_cast<UCMainWindow*>(m_rootWindow)); | ||
25 | 183 | if (mainWindow && mainWindow->visualRoot()) { | ||
26 | 184 | return mainWindow->visualRoot(); | ||
27 | 185 | } | ||
28 | 186 | |||
29 | 178 | if (!object) { | 187 | if (!object) { |
30 | 179 | return m_rootView ? m_rootView->rootObject() : (m_rootWindow ? m_rootWindow->contentItem() : 0); | 188 | return m_rootView ? m_rootView->rootObject() : (m_rootWindow ? m_rootWindow->contentItem() : 0); |
31 | 180 | } | 189 | } |
32 | 181 | 190 | ||
33 | === modified file 'src/UbuntuToolkit/ucmainwindow.cpp' | |||
34 | --- src/UbuntuToolkit/ucmainwindow.cpp 2017-01-17 08:50:14 +0000 | |||
35 | +++ src/UbuntuToolkit/ucmainwindow.cpp 2017-01-18 15:22:13 +0000 | |||
36 | @@ -238,6 +238,32 @@ | |||
37 | 238 | return d_func()->m_actionContext; | 238 | return d_func()->m_actionContext; |
38 | 239 | } | 239 | } |
39 | 240 | 240 | ||
40 | 241 | /*! | ||
41 | 242 | \qmlproperty Item MainWindow::visualRoot | ||
42 | 243 | |||
43 | 244 | If set, the property holds the window's visual root, as opposed to root item | ||
44 | 245 | of the scene. | ||
45 | 246 | Popups (popovers, dialogs, menus) opened with popupUtils.open() will be | ||
46 | 247 | children of the visual root, or the root item otherwise. | ||
47 | 248 | Popups shown via show() may respectively reparent to the visual root, if it | ||
48 | 249 | is set, or the root item otherwise, if reparentToRootItem is set. | ||
49 | 250 | */ | ||
50 | 251 | QQuickItem *UCMainWindow::visualRoot() const | ||
51 | 252 | { | ||
52 | 253 | return d_func()->m_visualRoot; | ||
53 | 254 | } | ||
54 | 255 | |||
55 | 256 | void UCMainWindow::setVisualRoot(QQuickItem *visualRoot) | ||
56 | 257 | { | ||
57 | 258 | Q_D(UCMainWindow); | ||
58 | 259 | |||
59 | 260 | if (d->m_visualRoot == visualRoot) | ||
60 | 261 | return; | ||
61 | 262 | |||
62 | 263 | d->m_visualRoot = visualRoot; | ||
63 | 264 | Q_EMIT visualRootChanged(visualRoot); | ||
64 | 265 | } | ||
65 | 266 | |||
66 | 241 | UT_NAMESPACE_END | 267 | UT_NAMESPACE_END |
67 | 242 | 268 | ||
68 | 243 | #include "moc_ucmainwindow_p.cpp" | 269 | #include "moc_ucmainwindow_p.cpp" |
69 | 244 | 270 | ||
70 | === modified file 'src/UbuntuToolkit/ucmainwindow_p.h' | |||
71 | --- src/UbuntuToolkit/ucmainwindow_p.h 2017-01-12 15:20:31 +0000 | |||
72 | +++ src/UbuntuToolkit/ucmainwindow_p.h 2017-01-18 15:22:13 +0000 | |||
73 | @@ -37,10 +37,12 @@ | |||
74 | 37 | Q_PROPERTY(UT_PREPEND_NAMESPACE(UCUnits)* units READ units NOTIFY unitsChanged) | 37 | Q_PROPERTY(UT_PREPEND_NAMESPACE(UCUnits)* units READ units NOTIFY unitsChanged) |
75 | 38 | Q_PROPERTY(UT_PREPEND_NAMESPACE(UbuntuI18n)* i18n READ i18n NOTIFY i18nChanged) | 38 | Q_PROPERTY(UT_PREPEND_NAMESPACE(UbuntuI18n)* i18n READ i18n NOTIFY i18nChanged) |
76 | 39 | Q_PROPERTY(UT_PREPEND_NAMESPACE(UCPopupContext)* actionContext READ actionContext NOTIFY actionContextChanged) | 39 | Q_PROPERTY(UT_PREPEND_NAMESPACE(UCPopupContext)* actionContext READ actionContext NOTIFY actionContextChanged) |
77 | 40 | Q_PROPERTY(UT_PREPEND_NAMESPACE(QQuickItem)* visualRoot READ visualRoot WRITE setVisualRoot NOTIFY visualRootChanged) | ||
78 | 40 | #else | 41 | #else |
79 | 41 | Q_PROPERTY(UCUnits* units READ units NOTIFY unitsChanged) | 42 | Q_PROPERTY(UCUnits* units READ units NOTIFY unitsChanged) |
80 | 42 | Q_PROPERTY(UbuntuI18n* i18n READ i18n NOTIFY i18nChanged) | 43 | Q_PROPERTY(UbuntuI18n* i18n READ i18n NOTIFY i18nChanged) |
81 | 43 | Q_PROPERTY(UCPopupContext* actionContext READ actionContext NOTIFY actionContextChanged) | 44 | Q_PROPERTY(UCPopupContext* actionContext READ actionContext NOTIFY actionContextChanged) |
82 | 45 | Q_PROPERTY(QQuickItem* visualRoot READ visualRoot WRITE setVisualRoot NOTIFY visualRootChanged) | ||
83 | 44 | #endif | 46 | #endif |
84 | 45 | 47 | ||
85 | 46 | public: | 48 | public: |
86 | @@ -57,6 +59,9 @@ | |||
87 | 57 | 59 | ||
88 | 58 | UCPopupContext* actionContext() const; | 60 | UCPopupContext* actionContext() const; |
89 | 59 | 61 | ||
90 | 62 | QQuickItem* visualRoot() const; | ||
91 | 63 | void setVisualRoot(QQuickItem*); | ||
92 | 64 | |||
93 | 60 | Q_SIGNALS: | 65 | Q_SIGNALS: |
94 | 61 | void applicationNameChanged(QString applicationName); | 66 | void applicationNameChanged(QString applicationName); |
95 | 62 | void organizationNameChanged(QString applicationName); | 67 | void organizationNameChanged(QString applicationName); |
96 | @@ -64,8 +69,10 @@ | |||
97 | 64 | void unitsChanged(); | 69 | void unitsChanged(); |
98 | 65 | #ifndef Q_QDOC | 70 | #ifndef Q_QDOC |
99 | 66 | void actionContextChanged(UT_PREPEND_NAMESPACE(UCPopupContext)* actionContext); | 71 | void actionContextChanged(UT_PREPEND_NAMESPACE(UCPopupContext)* actionContext); |
100 | 72 | void visualRootChanged(UT_PREPEND_NAMESPACE(QQuickItem)* visualRoot); | ||
101 | 67 | #else | 73 | #else |
102 | 68 | void actionContextChanged(UCPopupContext* actionContext); | 74 | void actionContextChanged(UCPopupContext* actionContext); |
103 | 75 | void visualRootChanged(QQuickItem* visualRoot); | ||
104 | 69 | #endif | 76 | #endif |
105 | 70 | 77 | ||
106 | 71 | private: | 78 | private: |
107 | 72 | 79 | ||
108 | === modified file 'src/UbuntuToolkit/ucmainwindow_p_p.h' | |||
109 | --- src/UbuntuToolkit/ucmainwindow_p_p.h 2017-01-12 15:20:31 +0000 | |||
110 | +++ src/UbuntuToolkit/ucmainwindow_p_p.h 2017-01-18 15:22:13 +0000 | |||
111 | @@ -40,6 +40,7 @@ | |||
112 | 40 | QString m_organizationName; | 40 | QString m_organizationName; |
113 | 41 | UCPopupContext* m_actionContext = nullptr; | 41 | UCPopupContext* m_actionContext = nullptr; |
114 | 42 | UCUnits* m_units = nullptr; | 42 | UCUnits* m_units = nullptr; |
115 | 43 | QQuickItem* m_visualRoot = nullptr; | ||
116 | 43 | 44 | ||
117 | 44 | }; | 45 | }; |
118 | 45 | 46 | ||
119 | 46 | 47 | ||
120 | === modified file 'src/imports/Components/Popups/1.3/popupUtils.js' | |||
121 | --- src/imports/Components/Popups/1.3/popupUtils.js 2017-01-05 14:11:37 +0000 | |||
122 | +++ src/imports/Components/Popups/1.3/popupUtils.js 2017-01-18 15:22:13 +0000 | |||
123 | @@ -32,7 +32,12 @@ | |||
124 | 32 | \a caller should be given when a \l ComposerSheet or \l Dialog is specified using a URL | 32 | \a caller should be given when a \l ComposerSheet or \l Dialog is specified using a URL |
125 | 33 | and opened inside a \b Window. If not, the application's root item will be the dismiss area. | 33 | and opened inside a \b Window. If not, the application's root item will be the dismiss area. |
126 | 34 | 34 | ||
128 | 35 | Returns a popop object, which can be closed using \l close. | 35 | Returns a popup object, which can be closed using \l close. |
129 | 36 | |||
130 | 37 | Note that popups created from a file or component will be created as children | ||
131 | 38 | of the root item. If that's not a good choice, a \b MainWindow used as the | ||
132 | 39 | root item can set the \b visualRoot property an arbitrary \b Item that acts | ||
133 | 40 | as the parent of all popups. | ||
134 | 36 | 41 | ||
135 | 37 | \qml | 42 | \qml |
136 | 38 | import Ubuntu.Components 1.3 | 43 | import Ubuntu.Components 1.3 |
137 | 39 | 44 | ||
138 | === added file 'tests/unit/mainwindow/VisualRoot.qml' | |||
139 | --- tests/unit/mainwindow/VisualRoot.qml 1970-01-01 00:00:00 +0000 | |||
140 | +++ tests/unit/mainwindow/VisualRoot.qml 2017-01-18 15:22:13 +0000 | |||
141 | @@ -0,0 +1,36 @@ | |||
142 | 1 | /* | ||
143 | 2 | * Copyright 2013-2017 Canonical Ltd. | ||
144 | 3 | * | ||
145 | 4 | * This program is free software; you can redistribute it and/or modify | ||
146 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
147 | 6 | * the Free Software Foundation; version 3. | ||
148 | 7 | * | ||
149 | 8 | * This program is distributed in the hope that it will be useful, | ||
150 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
151 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
152 | 11 | * GNU Lesser General Public License for more details. | ||
153 | 12 | * | ||
154 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
155 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
156 | 15 | */ | ||
157 | 16 | |||
158 | 17 | import QtQuick 2.4 | ||
159 | 18 | import Ubuntu.Components 1.3 | ||
160 | 19 | import Ubuntu.Components.Labs 1.0 | ||
161 | 20 | |||
162 | 21 | MainWindow { | ||
163 | 22 | objectName: "visualRoot" | ||
164 | 23 | applicationName: "org.gnu.wildebeest" | ||
165 | 24 | visualRoot: myRoot | ||
166 | 25 | |||
167 | 26 | Rectangle { | ||
168 | 27 | id: myRoot | ||
169 | 28 | objectName: "myRoot" | ||
170 | 29 | anchors.fill: parent | ||
171 | 30 | |||
172 | 31 | Label { | ||
173 | 32 | objectName: "myLabel" | ||
174 | 33 | text: "Lorem ipsum dolor sit amet" | ||
175 | 34 | } | ||
176 | 35 | } | ||
177 | 36 | } | ||
178 | 0 | 37 | ||
179 | === modified file 'tests/unit/mainwindow/tst_mainwindow.cpp' | |||
180 | --- tests/unit/mainwindow/tst_mainwindow.cpp 2017-01-12 15:20:31 +0000 | |||
181 | +++ tests/unit/mainwindow/tst_mainwindow.cpp 2017-01-18 15:22:13 +0000 | |||
182 | @@ -41,7 +41,9 @@ | |||
183 | 41 | #include <QtQml/QQmlComponent> | 41 | #include <QtQml/QQmlComponent> |
184 | 42 | 42 | ||
185 | 43 | #include <UbuntuToolkit/ubuntutoolkitmodule.h> | 43 | #include <UbuntuToolkit/ubuntutoolkitmodule.h> |
186 | 44 | #include <UbuntuToolkit/private/quickutils_p.h> | ||
187 | 44 | #include <UbuntuToolkit/private/ucapplication_p.h> | 45 | #include <UbuntuToolkit/private/ucapplication_p.h> |
188 | 46 | #include <UbuntuToolkit/private/ucmainwindow_p.h> | ||
189 | 45 | #include <UbuntuToolkit/private/ucunits_p.h> | 47 | #include <UbuntuToolkit/private/ucunits_p.h> |
190 | 46 | 48 | ||
191 | 47 | UT_USE_NAMESPACE | 49 | UT_USE_NAMESPACE |
192 | @@ -90,7 +92,7 @@ | |||
193 | 90 | return window; | 92 | return window; |
194 | 91 | } | 93 | } |
195 | 92 | 94 | ||
197 | 93 | QQuickItem *testItem(QQuickItem *that, const QString &identifier) | 95 | QQuickItem *testItem(QObject *that, const QString &identifier) |
198 | 94 | { | 96 | { |
199 | 95 | if (that->property(identifier.toLocal8Bit()).isValid()) | 97 | if (that->property(identifier.toLocal8Bit()).isValid()) |
200 | 96 | return that->property(identifier.toLocal8Bit()).value<QQuickItem*>(); | 98 | return that->property(identifier.toLocal8Bit()).value<QQuickItem*>(); |
201 | @@ -132,6 +134,17 @@ | |||
202 | 132 | QCOMPARE(organizationName, mainWindow->property("organizationName").toString()); | 134 | QCOMPARE(organizationName, mainWindow->property("organizationName").toString()); |
203 | 133 | QCOMPARE(organizationName, QCoreApplication::organizationName()); | 135 | QCOMPARE(organizationName, QCoreApplication::organizationName()); |
204 | 134 | } | 136 | } |
205 | 137 | |||
206 | 138 | void testCase_VisualRoot() | ||
207 | 139 | { | ||
208 | 140 | QString applicationName("tv.island.pacific"); | ||
209 | 141 | QQuickWindow *mainWindow(loadTest("VisualRoot.qml")); | ||
210 | 142 | QVERIFY(mainWindow); | ||
211 | 143 | QQuickItem* myLabel(testItem(mainWindow, "myLabel")); | ||
212 | 144 | QQuickItem* visualRoot(QuickUtils::instance()->rootItem(myLabel)); | ||
213 | 145 | QQuickItem* myRoot(testItem(mainWindow, "myRoot")); | ||
214 | 146 | QCOMPARE(visualRoot, myRoot); | ||
215 | 147 | } | ||
216 | 135 | }; | 148 | }; |
217 | 136 | 149 | ||
218 | 137 | QTEST_MAIN(tst_MainWindow) | 150 | QTEST_MAIN(tst_MainWindow) |
FAILED: Continuous integration, rev:2066 /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-amd64- stable/ 1608/ /jenkins. ubuntu. com/ubuntu- sdk/job/ generic- update- mp/7421/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/ubuntu- sdk/job/ ubuntu- ui-toolkit- ci-amd64- stable/ 1608/rebuild
https:/