forked from qt-creator/qt-creator
QmlDesigner: Create thumbnail for imported 3D assets
Qmlpuppet now allows creating icon from qml source code. Invoke qmlpuppet with following arguments to create icons: --rendericon <size> <icon file name> <icon qml source> E.g. --rendericon 24 ~/my_icon.png ~/my_icon.qml Two icons are created, one with size x size dimensions and one with double the dimensions and "@2x" injected into the file name. 3D asset import utilizes this icon rendering to produce item library icons for imported components. Change-Id: I92c62c80d961f5f61a0ce1c09b32bbcbf80ea56c Fixes: QDS-1052 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <qt5nodeinstanceclientproxy.h>
|
||||
#include "iconrenderer/iconrenderer.h"
|
||||
|
||||
#include <QQmlComponent>
|
||||
#include <QQmlEngine>
|
||||
@@ -52,11 +53,13 @@ int internalMain(QGuiApplication *application)
|
||||
QCoreApplication::setApplicationVersion("1.0.0");
|
||||
|
||||
if (application->arguments().count() < 2
|
||||
|| (application->arguments().at(1) == "--readcapturedstream" && application->arguments().count() < 3)) {
|
||||
|| (application->arguments().at(1) == "--readcapturedstream" && application->arguments().count() < 3)
|
||||
|| (application->arguments().at(1) == "--rendericon" && application->arguments().count() < 5)) {
|
||||
qDebug() << "Usage:\n";
|
||||
qDebug() << "--test";
|
||||
qDebug() << "--version";
|
||||
qDebug() << "--readcapturedstream <stream file> [control stream file]";
|
||||
qDebug() << "--rendericon <icon size> <icon file name> <icon source qml>";
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -108,7 +111,16 @@ int internalMain(QGuiApplication *application)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (application->arguments().at(1) == "--rendericon") {
|
||||
int size = application->arguments().at(2).toInt();
|
||||
QString iconFileName = application->arguments().at(3);
|
||||
QString iconSource = application->arguments().at(4);
|
||||
|
||||
IconRenderer *iconRenderer = new IconRenderer(size, iconFileName, iconSource);
|
||||
iconRenderer->setupRender();
|
||||
|
||||
return application->exec();
|
||||
}
|
||||
|
||||
#ifdef ENABLE_QT_BREAKPAD
|
||||
const QString libexecPath = QCoreApplication::applicationDirPath() + '/' + RELATIVE_LIBEXEC_PATH;
|
||||
|
||||
Reference in New Issue
Block a user