Merge lp:~aacid/unity8/optimize_LVWPH_layout into lp:unity8
- optimize_LVWPH_layout
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~aacid/unity8/optimize_LVWPH_layout |
Merge into: | lp:unity8 |
Diff against target: |
350 lines (+69/-49) 9 files modified
plugins/Dash/listviewwithpageheader.cpp (+35/-26) plugins/Dash/listviewwithpageheader.h (+1/-1) qml/Dash/DashCategoryBase.qml (+3/-11) qml/Dash/GenericScopeView.qml (+2/-2) tests/plugins/Dash/listviewwithpageheadersectionexternalmodeltest.cpp (+2/-2) tests/plugins/Dash/listviewwithpageheadersectiontest.cpp (+17/-2) tests/plugins/Dash/listviewwithpageheadertestsection.qml (+3/-2) tests/plugins/Dash/listviewwithpageheadertestsectionexternalmodel.qml (+2/-1) tests/plugins/Dash/tst_ListViewWithPageHeaderQML.qml (+4/-2) |
To merge this branch: | bzr merge lp:~aacid/unity8/optimize_LVWPH_layout |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity8 CI Bot | continuous-integration | Needs Fixing | |
Josh Arenson | Approve | ||
Andrea Cimitan | Pending | ||
Review via email:
|
This proposal has been superseded by a proposal from 2016-03-24.
Commit message
Don't use context properties but properties of the delegates
This increases a bit the requirements for delegates of the LVWPH but since we control them it's not really a problem.
In ::layout the setContextProperty calls accounted for around 45% according to callgrind, now it's around 10% only.
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
No
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* Did you make sure that your branch does not contain spurious tags?
Yes
* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A
* If you changed the UI, has there been a design review?
N/A
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Josh Arenson (josharenson) wrote : | # |
* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
* Did CI run pass?
No, the usual
* Did you make sure that the branch does not contain spurious tags?
Yes
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2279
https:/
Executed test runs:
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2279
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 2280. By Albert Astals Cid
-
forgot to adapt this test
- 2281. By Albert Astals Cid
-
Merge sectionDelegate
Resizes - 2282. By Albert Astals Cid
-
Merge
Unmerged revisions
Preview Diff
1 | === modified file 'plugins/Dash/listviewwithpageheader.cpp' | |||
2 | --- plugins/Dash/listviewwithpageheader.cpp 2016-02-05 14:56:32 +0000 | |||
3 | +++ plugins/Dash/listviewwithpageheader.cpp 2016-03-24 10:57:49 +0000 | |||
4 | @@ -97,6 +97,7 @@ | |||
5 | 97 | #include <qqmlengine.h> | 97 | #include <qqmlengine.h> |
6 | 98 | #pragma GCC diagnostic push | 98 | #pragma GCC diagnostic push |
7 | 99 | #pragma GCC diagnostic ignored "-pedantic" | 99 | #pragma GCC diagnostic ignored "-pedantic" |
8 | 100 | #include <private/qqmlcontext_p.h> | ||
9 | 100 | #include <private/qqmldelegatemodel_p.h> | 101 | #include <private/qqmldelegatemodel_p.h> |
10 | 101 | #include <private/qqmlglobal_p.h> | 102 | #include <private/qqmlglobal_p.h> |
11 | 102 | #include <private/qquickitem_p.h> | 103 | #include <private/qquickitem_p.h> |
12 | @@ -285,7 +286,7 @@ | |||
13 | 285 | 286 | ||
14 | 286 | m_sectionDelegate = delegate; | 287 | m_sectionDelegate = delegate; |
15 | 287 | 288 | ||
17 | 288 | m_topSectionItem = getSectionItem(QString()); | 289 | m_topSectionItem = getSectionItem(QString(), false /*watchGeometry*/); |
18 | 289 | m_topSectionItem->setZ(3); | 290 | m_topSectionItem->setZ(3); |
19 | 290 | QQuickItemPrivate::get(m_topSectionItem)->setCulled(true); | 291 | QQuickItemPrivate::get(m_topSectionItem)->setCulled(true); |
20 | 291 | connect(m_topSectionItem, &QQuickItem::heightChanged, this, &ListViewWithPageHeader::stickyHeaderHeightChanged); | 292 | connect(m_topSectionItem, &QQuickItem::heightChanged, this, &ListViewWithPageHeader::stickyHeaderHeightChanged); |
21 | @@ -700,8 +701,10 @@ | |||
22 | 700 | 701 | ||
23 | 701 | void ListViewWithPageHeader::releaseItem(ListItem *listItem) | 702 | void ListViewWithPageHeader::releaseItem(ListItem *listItem) |
24 | 702 | { | 703 | { |
27 | 703 | QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(listItem->m_item); | 704 | QQuickItemPrivate::get(listItem->m_item)->removeItemChangeListener(this, QQuickItemPrivate::Geometry); |
28 | 704 | itemPrivate->removeItemChangeListener(this, QQuickItemPrivate::Geometry); | 705 | if (listItem->sectionItem()) { |
29 | 706 | QQuickItemPrivate::get(listItem->sectionItem())->removeItemChangeListener(this, QQuickItemPrivate::Geometry); | ||
30 | 707 | } | ||
31 | 705 | m_itemsToRelease << listItem; | 708 | m_itemsToRelease << listItem; |
32 | 706 | } | 709 | } |
33 | 707 | 710 | ||
34 | @@ -744,14 +747,12 @@ | |||
35 | 744 | return getSectionItem(section); | 747 | return getSectionItem(section); |
36 | 745 | } | 748 | } |
37 | 746 | 749 | ||
39 | 747 | QQuickItem *ListViewWithPageHeader::getSectionItem(const QString §ionText) | 750 | QQuickItem *ListViewWithPageHeader::getSectionItem(const QString §ionText, bool watchGeometry) |
40 | 748 | { | 751 | { |
41 | 749 | QQuickItem *sectionItem = nullptr; | 752 | QQuickItem *sectionItem = nullptr; |
42 | 750 | 753 | ||
43 | 751 | QQmlContext *creationContext = m_sectionDelegate->creationContext(); | 754 | QQmlContext *creationContext = m_sectionDelegate->creationContext(); |
44 | 752 | QQmlContext *context = new QQmlContext(creationContext ? creationContext : qmlContext(this)); | 755 | QQmlContext *context = new QQmlContext(creationContext ? creationContext : qmlContext(this)); |
45 | 753 | context->setContextProperty(QStringLiteral("section"), sectionText); | ||
46 | 754 | context->setContextProperty(QStringLiteral("delegateIndex"), -1); | ||
47 | 755 | QObject *nobj = m_sectionDelegate->beginCreate(context); | 756 | QObject *nobj = m_sectionDelegate->beginCreate(context); |
48 | 756 | if (nobj) { | 757 | if (nobj) { |
49 | 757 | QQml_setParent_noEvent(context, nobj); | 758 | QQml_setParent_noEvent(context, nobj); |
50 | @@ -759,6 +760,8 @@ | |||
51 | 759 | if (!sectionItem) { | 760 | if (!sectionItem) { |
52 | 760 | delete nobj; | 761 | delete nobj; |
53 | 761 | } else { | 762 | } else { |
54 | 763 | sectionItem->setProperty("text", sectionText); | ||
55 | 764 | sectionItem->setProperty("delegateIndex", -1); | ||
56 | 762 | sectionItem->setZ(2); | 765 | sectionItem->setZ(2); |
57 | 763 | QQml_setParent_noEvent(sectionItem, m_clipItem); | 766 | QQml_setParent_noEvent(sectionItem, m_clipItem); |
58 | 764 | sectionItem->setParentItem(m_clipItem); | 767 | sectionItem->setParentItem(m_clipItem); |
59 | @@ -768,7 +771,9 @@ | |||
60 | 768 | } | 771 | } |
61 | 769 | m_sectionDelegate->completeCreate(); | 772 | m_sectionDelegate->completeCreate(); |
62 | 770 | 773 | ||
64 | 771 | // TODO attach to sectionItem so we can accomodate to it changing its height | 774 | if (watchGeometry) { |
65 | 775 | QQuickItemPrivate::get(sectionItem)->addItemChangeListener(this, QQuickItemPrivate::Geometry); | ||
66 | 776 | } | ||
67 | 772 | 777 | ||
68 | 773 | return sectionItem; | 778 | return sectionItem; |
69 | 774 | } | 779 | } |
70 | @@ -792,8 +797,7 @@ | |||
71 | 792 | if (!item->sectionItem()) { | 797 | if (!item->sectionItem()) { |
72 | 793 | item->setSectionItem(getSectionItem(sectionText)); | 798 | item->setSectionItem(getSectionItem(sectionText)); |
73 | 794 | } else { | 799 | } else { |
76 | 795 | QQmlContext *context = QQmlEngine::contextForObject(item->sectionItem())->parentContext(); | 800 | item->sectionItem()->setProperty("text", sectionText); |
75 | 796 | context->setContextProperty(QStringLiteral("section"), sectionText); | ||
77 | 797 | } | 801 | } |
78 | 798 | } else { | 802 | } else { |
79 | 799 | if (item->sectionItem()) { | 803 | if (item->sectionItem()) { |
80 | @@ -914,8 +918,7 @@ | |||
81 | 914 | polish(); | 918 | polish(); |
82 | 915 | } | 919 | } |
83 | 916 | if (listItem->sectionItem()) { | 920 | if (listItem->sectionItem()) { |
86 | 917 | QQmlContext *context = QQmlEngine::contextForObject(listItem->sectionItem())->parentContext(); | 921 | listItem->sectionItem()->setProperty("delegateIndex", modelIndex); |
85 | 918 | context->setContextProperty(QStringLiteral("delegateIndex"), modelIndex); | ||
87 | 919 | } | 922 | } |
88 | 920 | adjustMinYExtent(); | 923 | adjustMinYExtent(); |
89 | 921 | m_contentHeightDirty = true; | 924 | m_contentHeightDirty = true; |
90 | @@ -939,9 +942,10 @@ | |||
91 | 939 | return; | 942 | return; |
92 | 940 | 943 | ||
93 | 941 | item->setParentItem(m_clipItem); | 944 | item->setParentItem(m_clipItem); |
94 | 945 | // FIXME Why do we need the refreshExpressions call? | ||
95 | 942 | QQmlContext *context = QQmlEngine::contextForObject(item)->parentContext(); | 946 | QQmlContext *context = QQmlEngine::contextForObject(item)->parentContext(); |
98 | 943 | context->setContextProperty(QStringLiteral("ListViewWithPageHeader"), this); | 947 | QQmlContextPrivate::get(context)->data->refreshExpressions(); |
99 | 944 | context->setContextProperty(QStringLiteral("heightToClip"), QVariant::fromValue<int>(0)); | 948 | item->setProperty("heightToClip", QVariant::fromValue<int>(0)); |
100 | 945 | if (modelIndex == m_asyncRequestedIndex) { | 949 | if (modelIndex == m_asyncRequestedIndex) { |
101 | 946 | createItem(modelIndex, false); | 950 | createItem(modelIndex, false); |
102 | 947 | refill(); | 951 | refill(); |
103 | @@ -1107,8 +1111,7 @@ | |||
104 | 1107 | for (int i = 0; i < m_visibleItems.count(); ++i) { | 1111 | for (int i = 0; i < m_visibleItems.count(); ++i) { |
105 | 1108 | ListItem *item = m_visibleItems[i]; | 1112 | ListItem *item = m_visibleItems[i]; |
106 | 1109 | if (item->sectionItem()) { | 1113 | if (item->sectionItem()) { |
109 | 1110 | QQmlContext *context = QQmlEngine::contextForObject(item->sectionItem())->parentContext(); | 1114 | item->sectionItem()->setProperty("delegateIndex", m_firstVisibleIndex + i); |
108 | 1111 | context->setContextProperty(QStringLiteral("delegateIndex"), m_firstVisibleIndex + i); | ||
110 | 1112 | } | 1115 | } |
111 | 1113 | } | 1116 | } |
112 | 1114 | 1117 | ||
113 | @@ -1126,15 +1129,23 @@ | |||
114 | 1126 | } | 1129 | } |
115 | 1127 | } | 1130 | } |
116 | 1128 | 1131 | ||
118 | 1129 | void ListViewWithPageHeader::itemGeometryChanged(QQuickItem * /*item*/, const QRectF &newGeometry, const QRectF &oldGeometry) | 1132 | void ListViewWithPageHeader::itemGeometryChanged(QQuickItem *item, const QRectF &newGeometry, const QRectF &oldGeometry) |
119 | 1130 | { | 1133 | { |
120 | 1131 | const qreal heightDiff = newGeometry.height() - oldGeometry.height(); | 1134 | const qreal heightDiff = newGeometry.height() - oldGeometry.height(); |
121 | 1132 | if (heightDiff != 0) { | 1135 | if (heightDiff != 0) { |
123 | 1133 | if (!m_inContentHeightKeepHeaderShown && oldGeometry.y() + oldGeometry.height() + m_clipItem->y() <= contentY() && !m_visibleItems.isEmpty()) { | 1136 | if (!m_visibleItems.isEmpty()) { |
124 | 1134 | ListItem *firstItem = m_visibleItems.first(); | 1137 | ListItem *firstItem = m_visibleItems.first(); |
128 | 1135 | firstItem->setY(firstItem->y() - heightDiff); | 1138 | const auto prevFirstItemY = firstItem->y(); |
129 | 1136 | adjustMinYExtent(); | 1139 | if (!m_inContentHeightKeepHeaderShown && oldGeometry.y() + oldGeometry.height() + m_clipItem->y() <= contentY()) { |
130 | 1137 | layout(); | 1140 | firstItem->setY(firstItem->y() - heightDiff); |
131 | 1141 | } else if (item == firstItem->sectionItem()) { | ||
132 | 1142 | firstItem->setY(firstItem->y() + heightDiff); | ||
133 | 1143 | } | ||
134 | 1144 | |||
135 | 1145 | if (firstItem->y() != prevFirstItemY) { | ||
136 | 1146 | adjustMinYExtent(); | ||
137 | 1147 | layout(); | ||
138 | 1148 | } | ||
139 | 1138 | } | 1149 | } |
140 | 1139 | refill(); | 1150 | refill(); |
141 | 1140 | adjustMinYExtent(); | 1151 | adjustMinYExtent(); |
142 | @@ -1270,8 +1281,7 @@ | |||
143 | 1270 | } else { | 1281 | } else { |
144 | 1271 | // Update the top sticky section header | 1282 | // Update the top sticky section header |
145 | 1272 | const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty); | 1283 | const QString section = m_delegateModel->stringValue(modelIndex, m_sectionProperty); |
148 | 1273 | QQmlContext *context = QQmlEngine::contextForObject(m_topSectionItem)->parentContext(); | 1284 | m_topSectionItem->setProperty("text", section); |
147 | 1274 | context->setContextProperty(QStringLiteral("section"), section); | ||
149 | 1275 | 1285 | ||
150 | 1276 | QQuickItemPrivate::get(m_topSectionItem)->setCulled(false); | 1286 | QQuickItemPrivate::get(m_topSectionItem)->setCulled(false); |
151 | 1277 | m_topSectionItem->setY(topSectionStickPos); | 1287 | m_topSectionItem->setY(topSectionStickPos); |
152 | @@ -1283,19 +1293,18 @@ | |||
153 | 1283 | break; | 1293 | break; |
154 | 1284 | delegateIndex--; | 1294 | delegateIndex--; |
155 | 1285 | } | 1295 | } |
157 | 1286 | context->setContextProperty(QStringLiteral("delegateIndex"), delegateIndex); | 1296 | m_topSectionItem->setProperty("delegateIndex", delegateIndex); |
158 | 1287 | if (item->sectionItem()) { | 1297 | if (item->sectionItem()) { |
159 | 1288 | QQuickItemPrivate::get(item->sectionItem())->setCulled(true); | 1298 | QQuickItemPrivate::get(item->sectionItem())->setCulled(true); |
160 | 1289 | } | 1299 | } |
161 | 1290 | } | 1300 | } |
162 | 1291 | } | 1301 | } |
163 | 1292 | } | 1302 | } |
164 | 1293 | QQmlContext *context = QQmlEngine::contextForObject(item->m_item)->parentContext(); | ||
165 | 1294 | const qreal clipFrom = visibleFrom + (!item->sectionItem() && m_topSectionItem && !QQuickItemPrivate::get(m_topSectionItem)->culled ? m_topSectionItem->height() : 0); | 1303 | const qreal clipFrom = visibleFrom + (!item->sectionItem() && m_topSectionItem && !QQuickItemPrivate::get(m_topSectionItem)->culled ? m_topSectionItem->height() : 0); |
166 | 1295 | if (!cull && pos < clipFrom) { | 1304 | if (!cull && pos < clipFrom) { |
168 | 1296 | context->setContextProperty(QStringLiteral("heightToClip"), clipFrom - pos); | 1305 | item->m_item->setProperty("heightToClip", clipFrom - pos); |
169 | 1297 | } else { | 1306 | } else { |
171 | 1298 | context->setContextProperty(QStringLiteral("heightToClip"), QVariant::fromValue<int>(0)); | 1307 | item->m_item->setProperty("heightToClip", QVariant::fromValue<int>(0)); |
172 | 1299 | } | 1308 | } |
173 | 1300 | // qDebug() << "ListViewWithPageHeader::layout" << item->m_item; | 1309 | // qDebug() << "ListViewWithPageHeader::layout" << item->m_item; |
174 | 1301 | pos += item->height(); | 1310 | pos += item->height(); |
175 | 1302 | 1311 | ||
176 | === modified file 'plugins/Dash/listviewwithpageheader.h' | |||
177 | --- plugins/Dash/listviewwithpageheader.h 2016-02-05 14:56:32 +0000 | |||
178 | +++ plugins/Dash/listviewwithpageheader.h 2016-03-24 10:57:49 +0000 | |||
179 | @@ -166,7 +166,7 @@ | |||
180 | 166 | void reallyReleaseItem(ListItem *item); | 166 | void reallyReleaseItem(ListItem *item); |
181 | 167 | void updateWatchedRoles(); | 167 | void updateWatchedRoles(); |
182 | 168 | QQuickItem *getSectionItem(int modelIndex, bool alreadyInserted); | 168 | QQuickItem *getSectionItem(int modelIndex, bool alreadyInserted); |
184 | 169 | QQuickItem *getSectionItem(const QString §ionText); | 169 | QQuickItem *getSectionItem(const QString §ionText, bool watchGeometry = true); |
185 | 170 | void updateSectionItem(int modelIndex); | 170 | void updateSectionItem(int modelIndex); |
186 | 171 | void initializeValuesForEmptyList(); | 171 | void initializeValuesForEmptyList(); |
187 | 172 | 172 | ||
188 | 173 | 173 | ||
189 | === modified file 'qml/Dash/DashCategoryBase.qml' | |||
190 | --- qml/Dash/DashCategoryBase.qml 2015-07-15 15:07:19 +0000 | |||
191 | +++ qml/Dash/DashCategoryBase.qml 2016-03-24 10:57:49 +0000 | |||
192 | @@ -24,17 +24,9 @@ | |||
193 | 24 | /* Relevant really only for ListViewWithPageHeader case: specify how many pixels we can overlap with the section header */ | 24 | /* Relevant really only for ListViewWithPageHeader case: specify how many pixels we can overlap with the section header */ |
194 | 25 | readonly property int allowedOverlap: units.dp(1) | 25 | readonly property int allowedOverlap: units.dp(1) |
195 | 26 | 26 | ||
207 | 27 | property real __heightToClip: { | 27 | property real heightToClip: 0 |
208 | 28 | // Check this is in position where clipping is needed | 28 | readonly property real __heightToClip: heightToClip >= allowedOverlap ? heightToClip - allowedOverlap : 0 |
209 | 29 | if (typeof ListViewWithPageHeader !== 'undefined') { | 29 | |
199 | 30 | if (typeof heightToClip !== 'undefined') { | ||
200 | 31 | if (heightToClip >= allowedOverlap) { | ||
201 | 32 | return heightToClip - allowedOverlap; | ||
202 | 33 | } | ||
203 | 34 | } | ||
204 | 35 | } | ||
205 | 36 | return 0; | ||
206 | 37 | } | ||
210 | 38 | 30 | ||
211 | 39 | /*! | 31 | /*! |
212 | 40 | \internal | 32 | \internal |
213 | 41 | 33 | ||
214 | === modified file 'qml/Dash/GenericScopeView.qml' | |||
215 | --- qml/Dash/GenericScopeView.qml 2016-03-14 08:53:26 +0000 | |||
216 | +++ qml/Dash/GenericScopeView.qml 2016-03-24 10:57:49 +0000 | |||
217 | @@ -607,10 +607,10 @@ | |||
218 | 607 | sectionProperty: "name" | 607 | sectionProperty: "name" |
219 | 608 | sectionDelegate: ListItems.Header { | 608 | sectionDelegate: ListItems.Header { |
220 | 609 | objectName: "dashSectionHeader" + (delegate ? delegate.category : "") | 609 | objectName: "dashSectionHeader" + (delegate ? delegate.category : "") |
221 | 610 | property int delegateIndex: -1 | ||
222 | 610 | readonly property var delegate: categoryView.item(delegateIndex) | 611 | readonly property var delegate: categoryView.item(delegateIndex) |
223 | 611 | width: categoryView.width | 612 | width: categoryView.width |
226 | 612 | height: section != "" ? units.gu(5) : 0 | 613 | height: text != "" ? units.gu(5) : 0 |
225 | 613 | text: section | ||
227 | 614 | color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText | 614 | color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText |
228 | 615 | iconName: delegate && delegate.headerLink ? "go-next" : "" | 615 | iconName: delegate && delegate.headerLink ? "go-next" : "" |
229 | 616 | onClicked: { | 616 | onClicked: { |
230 | 617 | 617 | ||
231 | === modified file 'tests/plugins/Dash/listviewwithpageheadersectionexternalmodeltest.cpp' | |||
232 | --- tests/plugins/Dash/listviewwithpageheadersectionexternalmodeltest.cpp 2015-05-21 15:52:48 +0000 | |||
233 | +++ tests/plugins/Dash/listviewwithpageheadersectionexternalmodeltest.cpp 2016-03-24 10:57:49 +0000 | |||
234 | @@ -151,12 +151,12 @@ | |||
235 | 151 | 151 | ||
236 | 152 | QString section(QQuickItem *item) | 152 | QString section(QQuickItem *item) |
237 | 153 | { | 153 | { |
239 | 154 | return item ? QQmlEngine::contextForObject(item)->parentContext()->contextProperty(QLatin1String("section")).toString() : QString(); | 154 | return item ? item->property("text").toString() : QString(); |
240 | 155 | } | 155 | } |
241 | 156 | 156 | ||
242 | 157 | int sectionDelegateIndex(QQuickItem *item) | 157 | int sectionDelegateIndex(QQuickItem *item) |
243 | 158 | { | 158 | { |
245 | 159 | return item ? QQmlEngine::contextForObject(item)->parentContext()->contextProperty(QLatin1String("delegateIndex")).toInt() : -1; | 159 | return item ? item->property("delegateIndex").toInt() : -1; |
246 | 160 | } | 160 | } |
247 | 161 | 161 | ||
248 | 162 | private Q_SLOTS: | 162 | private Q_SLOTS: |
249 | 163 | 163 | ||
250 | === modified file 'tests/plugins/Dash/listviewwithpageheadersectiontest.cpp' | |||
251 | --- tests/plugins/Dash/listviewwithpageheadersectiontest.cpp 2015-11-26 13:50:56 +0000 | |||
252 | +++ tests/plugins/Dash/listviewwithpageheadersectiontest.cpp 2016-03-24 10:57:49 +0000 | |||
253 | @@ -116,12 +116,12 @@ | |||
254 | 116 | 116 | ||
255 | 117 | QString section(QQuickItem *item) const | 117 | QString section(QQuickItem *item) const |
256 | 118 | { | 118 | { |
258 | 119 | return item ? QQmlEngine::contextForObject(item)->parentContext()->contextProperty(QLatin1String("section")).toString() : QString(); | 119 | return item ? item->property("text").toString() : QString(); |
259 | 120 | } | 120 | } |
260 | 121 | 121 | ||
261 | 122 | int sectionDelegateIndex(QQuickItem *item) const | 122 | int sectionDelegateIndex(QQuickItem *item) const |
262 | 123 | { | 123 | { |
264 | 124 | return item ? QQmlEngine::contextForObject(item)->parentContext()->contextProperty(QLatin1String("delegateIndex")).toInt() : -1; | 124 | return item ? item->property("delegateIndex").toInt() : -1; |
265 | 125 | } | 125 | } |
266 | 126 | 126 | ||
267 | 127 | private Q_SLOTS: | 127 | private Q_SLOTS: |
268 | @@ -2180,6 +2180,21 @@ | |||
269 | 2180 | verifyItem(2, 480., 390., false, "Agressive", false); | 2180 | verifyItem(2, 480., 390., false, "Agressive", false); |
270 | 2181 | } | 2181 | } |
271 | 2182 | 2182 | ||
272 | 2183 | void firstItemSectionHeightChange() | ||
273 | 2184 | { | ||
274 | 2185 | QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 1), Q_ARG(QVariant, 5)); | ||
275 | 2186 | model->setProperty(0, "type", "halfheight"); | ||
276 | 2187 | verifyItem(0, 50., 170., false, "halfheight", false); | ||
277 | 2188 | } | ||
278 | 2189 | |||
279 | 2190 | void secondItemSectionHeightChange() | ||
280 | 2191 | { | ||
281 | 2192 | QMetaObject::invokeMethod(model, "removeItems", Q_ARG(QVariant, 2), Q_ARG(QVariant, 4)); | ||
282 | 2193 | model->setProperty(1, "type", "halfheight"); | ||
283 | 2194 | verifyItem(0, 50., 190., false, "Agressive", false); | ||
284 | 2195 | verifyItem(1, 240., 220., false, "halfheight", false); | ||
285 | 2196 | } | ||
286 | 2197 | |||
287 | 2183 | private: | 2198 | private: |
288 | 2184 | QQuickView *view; | 2199 | QQuickView *view; |
289 | 2185 | ListViewWithPageHeader *lvwph; | 2200 | ListViewWithPageHeader *lvwph; |
290 | 2186 | 2201 | ||
291 | === modified file 'tests/plugins/Dash/listviewwithpageheadertestsection.qml' | |||
292 | --- tests/plugins/Dash/listviewwithpageheadertestsection.qml 2015-07-15 15:07:19 +0000 | |||
293 | +++ tests/plugins/Dash/listviewwithpageheadertestsection.qml 2016-03-24 10:57:49 +0000 | |||
294 | @@ -97,9 +97,10 @@ | |||
295 | 97 | sectionProperty: "type" | 97 | sectionProperty: "type" |
296 | 98 | sectionDelegate: Component { | 98 | sectionDelegate: Component { |
297 | 99 | Rectangle { | 99 | Rectangle { |
298 | 100 | property alias text: theText.text | ||
299 | 100 | color: "green" | 101 | color: "green" |
302 | 101 | height: 40 | 102 | height: section === "" ? 0 : section != "halfheight" ? 40 : 20; |
303 | 102 | Text { text: section; font.pixelSize: 34 } | 103 | Text { id: theText; font.pixelSize: 34 } |
304 | 103 | anchors { left: parent.left; right: parent.right } | 104 | anchors { left: parent.left; right: parent.right } |
305 | 104 | } | 105 | } |
306 | 105 | } | 106 | } |
307 | 106 | 107 | ||
308 | === modified file 'tests/plugins/Dash/listviewwithpageheadertestsectionexternalmodel.qml' | |||
309 | --- tests/plugins/Dash/listviewwithpageheadertestsectionexternalmodel.qml 2015-07-15 15:07:19 +0000 | |||
310 | +++ tests/plugins/Dash/listviewwithpageheadertestsectionexternalmodel.qml 2016-03-24 10:57:49 +0000 | |||
311 | @@ -65,9 +65,10 @@ | |||
312 | 65 | sectionProperty: "type" | 65 | sectionProperty: "type" |
313 | 66 | sectionDelegate: Component { | 66 | sectionDelegate: Component { |
314 | 67 | Rectangle { | 67 | Rectangle { |
315 | 68 | property alias text: theText.text | ||
316 | 68 | color: "green" | 69 | color: "green" |
317 | 69 | height: 40 | 70 | height: 40 |
319 | 70 | Text { text: section; font.pixelSize: 34 } | 71 | Text { id: theText; font.pixelSize: 34 } |
320 | 71 | anchors { left: parent.left; right: parent.right } | 72 | anchors { left: parent.left; right: parent.right } |
321 | 72 | } | 73 | } |
322 | 73 | } | 74 | } |
323 | 74 | 75 | ||
324 | === modified file 'tests/plugins/Dash/tst_ListViewWithPageHeaderQML.qml' | |||
325 | --- tests/plugins/Dash/tst_ListViewWithPageHeaderQML.qml 2015-07-15 15:07:19 +0000 | |||
326 | +++ tests/plugins/Dash/tst_ListViewWithPageHeaderQML.qml 2016-03-24 10:57:49 +0000 | |||
327 | @@ -81,9 +81,10 @@ | |||
328 | 81 | sectionDelegate: Component { | 81 | sectionDelegate: Component { |
329 | 82 | id: sectionHeaderComponent | 82 | id: sectionHeaderComponent |
330 | 83 | Rectangle { | 83 | Rectangle { |
331 | 84 | property alias text: theText.text | ||
332 | 84 | color: "green" | 85 | color: "green" |
333 | 85 | height: listView.sectionHeaderHeight | 86 | height: listView.sectionHeaderHeight |
335 | 86 | Text { text: section; font.pixelSize: 34 } | 87 | Text { id: theText; font.pixelSize: 34 } |
336 | 87 | anchors { left: parent.left; right: parent.right } | 88 | anchors { left: parent.left; right: parent.right } |
337 | 88 | } | 89 | } |
338 | 89 | } | 90 | } |
339 | @@ -92,9 +93,10 @@ | |||
340 | 92 | Component { | 93 | Component { |
341 | 93 | id: otherSectionHeaderComponent | 94 | id: otherSectionHeaderComponent |
342 | 94 | Rectangle { | 95 | Rectangle { |
343 | 96 | property alias text: theText.text | ||
344 | 95 | color: "green" | 97 | color: "green" |
345 | 96 | height: 50 | 98 | height: 50 |
347 | 97 | Text { text: section; font.pixelSize: 34 } | 99 | Text { id: theText; font.pixelSize: 34 } |
348 | 98 | anchors { left: parent.left; right: parent.right } | 100 | anchors { left: parent.left; right: parent.right } |
349 | 99 | } | 101 | } |
350 | 100 | } | 102 | } |
FAILED: Continuous integration, rev:2279 /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/764/ /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=amd64, release= vivid+overlay, testname= qmluitests. sh/423 /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=amd64, release= xenial, testname= qmluitests. sh/423 /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=phone- armhf,release= vivid+overlay, testname= autopilot. sh/423/ console /unity8- jenkins. ubuntu. com/job/ build-0- fetch/1005 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 1021 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial/ 1021 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 1019 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 1019/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial/ 1019 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial/ 1019/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 1019 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 1019/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial/ 1019 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial/ 1019/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 1019 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 1019/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial/ 1019 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial/ 1019/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
UNSTABLE: https:/
UNSTABLE: https:/
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/764/ rebuild
https:/