on xenial help sign in
Poors man solution to the crash
commit9f02dd30785aa94e94c9cbcd9c6443b488583448 authorAlbert Astals <albert.astals@canonical.com> dateThu 14 Nov 2013, 15:59 (13 years ago) parent694640f
2 files changed+13−10
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+4−8 tests/qmltests/Dash/tst_DashContent.qml+9−2
plugins/ListViewWithPageHeader/listviewwithpageheader.cpp+4−8
@@ -1196,15 +1196,11 @@ void ListViewWithPageHeader::layout()
11961196 }
11971197 }
11981198 QQmlContext *context = QQmlEngine::contextForObject(item->m_item)->parentContext();
1199− if (context) {
1200− const qreal clipFrom = visibleFrom + (!item->m_sectionItem && m_topSectionItem && !QQuickItemPrivate::get(m_topSectionItem)->culled ? m_topSectionItem->height() : 0);
1201− if (!cull && pos < clipFrom) {
1202− context->setContextProperty(QLatin1String("heightToClip"), clipFrom - pos);
1203− } else {
1204− context->setContextProperty(QLatin1String("heightToClip"), QVariant::fromValue<int>(0));
1205− }
1199+ const qreal clipFrom = visibleFrom + (!item->m_sectionItem && m_topSectionItem && !QQuickItemPrivate::get(m_topSectionItem)->culled ? m_topSectionItem->height() : 0);
1200+ if (!cull && pos < clipFrom) {
1201+ context->setContextProperty(QLatin1String("heightToClip"), clipFrom - pos);
12061202 } else {
1207− qWarning() << "ListViewWithPageHeader::layout::No context for item found, if you see this outside tests please report";
1203+ context->setContextProperty(QLatin1String("heightToClip"), QVariant::fromValue<int>(0));
12081204 }
12091205// qDebug() << "ListViewWithPageHeader::layout" << item->m_item;
12101206 pos += item->height();
tests/qmltests/Dash/tst_DashContent.qml+9−2
@@ -123,10 +123,17 @@ Item {
123123 clear_scope_status();
124124 dashContent.visible = true;
125125
126− scopesModel.clear();
127− // wait for dash to empty scopes.
128126 var dashContentList = findChild(dashContent, "dashContentList");
129127 verify(dashContentList != undefined);
128+ // TODO For Qt 5.2 remove this wait
129+ // and the tryCompare and see if it still crashes when
130+ // looping the test
131+ wait(1000);
132+ if (dashContentList.currentItem !== null) {
133+ tryCompare(dashContentList.currentItem, "moving", false);
134+ }
135+ scopesModel.clear();
136+ // wait for dash to empty scopes.
130137 tryCompare(dashContentList, "count", 0);
131138 }
132139