on xenial help sign in
Merge + fix test
0075b54Albert Astals
qml/Dash/CardHeader.qml+1−1
@@ -72,6 +72,7 @@ Item {
72 Loader {
72 Loader {
73 id: mascotImageLoader
73 id: mascotImageLoader
74 active: root.mascot
74 active: root.mascot
75+ visible: root.mascot && !useMascotShape && item.status === Image.Ready
75 anchors.verticalCenter: parent.verticalCenter
76 anchors.verticalCenter: parent.verticalCenter
76 sourceComponent: Image {
77 sourceComponent: Image {
77 objectName: "mascotImage"
78 objectName: "mascotImage"
@@ -79,7 +80,6 @@ Item {
79 source: root.mascot
80 source: root.mascot
80 width: source ? mascotShapeLoader.width : 0
81 width: source ? mascotShapeLoader.width : 0
81 height: mascotShapeLoader.height
82 height: mascotShapeLoader.height
82− visible: !useMascotShape && status === Image.Ready
83
83
84 sourceSize { width: mascotShapeLoader.maxSize; height: mascotShapeLoader.maxSize }
84 sourceSize { width: mascotShapeLoader.maxSize; height: mascotShapeLoader.maxSize }
85 fillMode: Image.PreserveAspectCrop
85 fillMode: Image.PreserveAspectCrop
tests/uqmlscene/main.cpp+13
@@ -341,6 +341,16 @@ static void loadDummyDataFiles(QQmlEngine &engine, const QString& directory)
341 }
341 }
342}
342}
343
343
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+
344static void usage()
354static void usage()
345{
355{
346 qWarning("Usage: uqmlscene [options] <filename>");
356 qWarning("Usage: uqmlscene [options] <filename>");
@@ -470,6 +480,9 @@ int main(int argc, char ** argv)
470 loadDummyDataFiles(engine, fi.path());
480 loadDummyDataFiles(engine, fi.path());
471 }
481 }
472 QObject::connect(&engine, SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
482 QObject::connect(&engine, SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
483+
484+ qmlRegisterSingletonType<QObject>("Qt.test.qtestroot", 1, 0, "QTestRootObject", testRootObject);
485+
473 component->loadUrl(options.file);
486 component->loadUrl(options.file);
474 if ( !component->isReady() ) {
487 if ( !component->isReady() ) {
475 qWarning("%s", qPrintable(component->errorString()));
488 qWarning("%s", qPrintable(component->errorString()));