on xenial help sign in
Merge + fix test
commit0075b54ecf795cb8e8fde38f5b40d9d5b5d44669 authorAlbert Astals <albert.astals@canonical.com> dateTue 1 Apr 2014, 14:38 (13 years ago) parentd482a3e375c905
2 files changed+14−1
qml/Dash/CardHeader.qml+1−1 tests/uqmlscene/main.cpp+13
qml/Dash/CardHeader.qml+1−1
@@ -72,6 +72,7 @@ Item {
7272 Loader {
7373 id: mascotImageLoader
7474 active: root.mascot
75+ visible: root.mascot && !useMascotShape && item.status === Image.Ready
7576 anchors.verticalCenter: parent.verticalCenter
7677 sourceComponent: Image {
7778 objectName: "mascotImage"
@@ -79,7 +80,6 @@ Item {
7980 source: root.mascot
8081 width: source ? mascotShapeLoader.width : 0
8182 height: mascotShapeLoader.height
82− visible: !useMascotShape && status === Image.Ready
8383
8484 sourceSize { width: mascotShapeLoader.maxSize; height: mascotShapeLoader.maxSize }
8585 fillMode: Image.PreserveAspectCrop
tests/uqmlscene/main.cpp+13
@@ -341,6 +341,16 @@ static void loadDummyDataFiles(QQmlEngine &engine, const QString& directory)
341341 }
342342}
343343
344+static QObject *s_testRootObject = nullptr;
345+static QObject *testRootObject(QQmlEngine *engine, QJSEngine *jsEngine)
346+{
347+ Q_UNUSED(jsEngine);
348+ if (!s_testRootObject) {
349+ s_testRootObject = new QObject(engine);
350+ }
351+ return s_testRootObject;
352+}
353+
344354static void usage()
345355{
346356 qWarning("Usage: uqmlscene [options] <filename>");
@@ -470,6 +480,9 @@ int main(int argc, char ** argv)
470480 loadDummyDataFiles(engine, fi.path());
471481 }
472482 QObject::connect(&engine, SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
483+
484+ qmlRegisterSingletonType<QObject>("Qt.test.qtestroot", 1, 0, "QTestRootObject", testRootObject);
485+
473486 component->loadUrl(options.file);
474487 if ( !component->isReady() ) {
475488 qWarning("%s", qPrintable(component->errorString()));