forked from qt-creator/qt-creator
QmlDesigner: Fix compile of tests
Change-Id: Idd2097a7e571d5891c3769102bb7b0ebd9264ac6 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -1496,7 +1496,11 @@ void NodeInstanceView::handlePuppetToCreatorCommand(const PuppetToCreatorCommand
|
|||||||
if (hasModelNodeForInternalId(container.instanceId()) && !image.isNull()) {
|
if (hasModelNodeForInternalId(container.instanceId()) && !image.isNull()) {
|
||||||
auto node = modelNodeForInternalId(container.instanceId());
|
auto node = modelNodeForInternalId(container.instanceId());
|
||||||
if (node.isValid()) {
|
if (node.isValid()) {
|
||||||
|
#ifndef QMLDESIGNER_TEST
|
||||||
const double ratio = QmlDesignerPlugin::formEditorDevicePixelRatio();
|
const double ratio = QmlDesignerPlugin::formEditorDevicePixelRatio();
|
||||||
|
#else
|
||||||
|
const double ratio = 1;
|
||||||
|
#endif
|
||||||
const int dim = Constants::MODELNODE_PREVIEW_IMAGE_DIMENSIONS * ratio;
|
const int dim = Constants::MODELNODE_PREVIEW_IMAGE_DIMENSIONS * ratio;
|
||||||
if (image.height() != dim || image.width() != dim)
|
if (image.height() != dim || image.width() != dim)
|
||||||
image = image.scaled(dim, dim, Qt::KeepAspectRatio);
|
image = image.scaled(dim, dim, Qt::KeepAspectRatio);
|
||||||
@@ -1544,7 +1548,12 @@ void NodeInstanceView::requestModelNodePreviewImage(const ModelNode &node, const
|
|||||||
} else if (node.isComponent()) {
|
} else if (node.isComponent()) {
|
||||||
componentPath = node.metaInfo().componentFileName();
|
componentPath = node.metaInfo().componentFileName();
|
||||||
}
|
}
|
||||||
const int dim = Constants::MODELNODE_PREVIEW_IMAGE_DIMENSIONS * QmlDesignerPlugin::formEditorDevicePixelRatio();
|
#ifndef QMLDESIGNER_TEST
|
||||||
|
const double ratio = QmlDesignerPlugin::formEditorDevicePixelRatio();
|
||||||
|
#else
|
||||||
|
const double ratio = 1;
|
||||||
|
#endif
|
||||||
|
const int dim = Constants::MODELNODE_PREVIEW_IMAGE_DIMENSIONS * ratio;
|
||||||
m_nodeInstanceServer->requestModelNodePreviewImage(
|
m_nodeInstanceServer->requestModelNodePreviewImage(
|
||||||
RequestModelNodePreviewImageCommand(instance.instanceId(), QSize(dim, dim),
|
RequestModelNodePreviewImageCommand(instance.instanceId(), QSize(dim, dim),
|
||||||
componentPath, renderItemId));
|
componentPath, renderItemId));
|
||||||
@@ -1589,7 +1598,11 @@ QVariant NodeInstanceView::previewImageDataForImageNode(const ModelNode &modelNo
|
|||||||
ModelNodePreviewImageData imageData;
|
ModelNodePreviewImageData imageData;
|
||||||
imageData.id = modelNode.id();
|
imageData.id = modelNode.id();
|
||||||
imageData.type = QString::fromLatin1(modelNode.type());
|
imageData.type = QString::fromLatin1(modelNode.type());
|
||||||
|
#ifndef QMLDESIGNER_TEST
|
||||||
const double ratio = QmlDesignerPlugin::formEditorDevicePixelRatio();
|
const double ratio = QmlDesignerPlugin::formEditorDevicePixelRatio();
|
||||||
|
#else
|
||||||
|
const double ratio = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (imageSource.isEmpty() && modelNode.isSubclassOf("QtQuick3D.Texture")) {
|
if (imageSource.isEmpty() && modelNode.isSubclassOf("QtQuick3D.Texture")) {
|
||||||
// Texture node may have sourceItem instead
|
// Texture node may have sourceItem instead
|
||||||
|
Reference in New Issue
Block a user