on xenial help sign in
Don't use our verticaljournal but the one that comes from the plugin
commit1e42ca4c5f425ce6c6639b61ea64fae39137d07b authorAlbert Astals <albert.astals@canonical.com> dateTue 17 Dec 2013, 16:02 (13 years ago) parent8ffb26d
2 files changed+5−8
tests/plugins/DashViews/verticaljournaltest.cpp+3−7 tests/plugins/DashViews/verticaljournaltest.qml+2−1
tests/plugins/DashViews/verticaljournaltest.cpp+3−7
@@ -22,6 +22,7 @@
2222#include <QtQml/qqml.h>
2323#include <QStringListModel>
2424#include <QQmlContext>
25+#include <QQmlEngine>
2526#pragma GCC diagnostic push
2627#pragma GCC diagnostic ignored "-pedantic"
2728#include <private/qquickitem_p.h>
@@ -81,16 +82,11 @@ private:
8182 }
8283
8384private Q_SLOTS:
84− void initTestCase()
85− {
86− qmlRegisterType<QAbstractItemModel>();
87− qmlRegisterType<VerticalJournal>("Journals", 0, 1, "VerticalJournal");
88− }
89−
9085 void init()
9186 {
9287 view = new QQuickView();
9388 view->setResizeMode(QQuickView::SizeRootObjectToView);
89+ view->engine()->addImportPath(BUILT_PLUGINS_DIR);
9490
9591 model = new QHeightModel();
9692 heightList.clear();
@@ -105,7 +101,7 @@ private Q_SLOTS:
105101 view->resize(470, 400);
106102 QTest::qWaitForWindowExposed(view);
107103
108− vj = view->rootObject()->findChild<VerticalJournal*>();
104+ vj = dynamic_cast<VerticalJournal*>(view->rootObject()->findChild<QObject*>("vj"));
109105 vj->setModel(model);
110106
111107 checkInitialPositions();
tests/plugins/DashViews/verticaljournaltest.qml+2−1
@@ -15,12 +15,13 @@
1515 */
1616
1717import QtQuick 2.1
18−import Journals 0.1
18+import DashViews 0.1
1919
2020Item {
2121
2222 VerticalJournal {
2323 id: vj
24+ objectName: "vj"
2425 anchors.fill: parent
2526 columnWidth: 150
2627 columnSpacing: 10