on xenial help sign in
Don't use our verticaljournal but the one that comes from the plugin
1e42ca4Albert Astals
tests/plugins/DashViews/verticaljournaltest.cpp+3−7
@@ -22,6 +22,7 @@
22#include <QtQml/qqml.h>
22#include <QtQml/qqml.h>
23#include <QStringListModel>
23#include <QStringListModel>
24#include <QQmlContext>
24#include <QQmlContext>
25+#include <QQmlEngine>
25#pragma GCC diagnostic push
26#pragma GCC diagnostic push
26#pragma GCC diagnostic ignored "-pedantic"
27#pragma GCC diagnostic ignored "-pedantic"
27#include <private/qquickitem_p.h>
28#include <private/qquickitem_p.h>
@@ -81,16 +82,11 @@ private:
81 }
82 }
82
83
83private Q_SLOTS:
84private Q_SLOTS:
84− void initTestCase()
85− {
86− qmlRegisterType<QAbstractItemModel>();
87− qmlRegisterType<VerticalJournal>("Journals", 0, 1, "VerticalJournal");
88− }
89−
90 void init()
85 void init()
91 {
86 {
92 view = new QQuickView();
87 view = new QQuickView();
93 view->setResizeMode(QQuickView::SizeRootObjectToView);
88 view->setResizeMode(QQuickView::SizeRootObjectToView);
89+ view->engine()->addImportPath(BUILT_PLUGINS_DIR);
94
90
95 model = new QHeightModel();
91 model = new QHeightModel();
96 heightList.clear();
92 heightList.clear();
@@ -105,7 +101,7 @@ private Q_SLOTS:
105 view->resize(470, 400);
101 view->resize(470, 400);
106 QTest::qWaitForWindowExposed(view);
102 QTest::qWaitForWindowExposed(view);
107
103
108− vj = view->rootObject()->findChild<VerticalJournal*>();
104+ vj = dynamic_cast<VerticalJournal*>(view->rootObject()->findChild<QObject*>("vj"));
109 vj->setModel(model);
105 vj->setModel(model);
110
106
111 checkInitialPositions();
107 checkInitialPositions();
tests/plugins/DashViews/verticaljournaltest.qml+2−1
@@ -15,12 +15,13 @@
15 */
15 */
16
16
17import QtQuick 2.1
17import QtQuick 2.1
18−import Journals 0.1
18+import DashViews 0.1
19
19
20Item {
20Item {
21
21
22 VerticalJournal {
22 VerticalJournal {
23 id: vj
23 id: vj
24+ objectName: "vj"
24 anchors.fill: parent
25 anchors.fill: parent
25 columnWidth: 150
26 columnWidth: 150
26 columnSpacing: 10
27 columnSpacing: 10