forked from qt-creator/qt-creator
QmlDesigner: Update properties supported by MCU
The transform properties are only available for Image and Text. Task-number: QDS-2512 Change-Id: I7c3eb6cb07182afe1e9d307bb5d210f1f2cf9c9f Reviewed-by: Aleksei German <aleksei.german@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -260,19 +260,36 @@ bool PropertyEditorValue::isTranslated() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool itemOrImage(const QmlDesigner::NodeMetaInfo &metaInfo)
|
||||||
|
{
|
||||||
|
if (!metaInfo.isValid())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (metaInfo.isSubclassOf("QtQuick.Image") || metaInfo.isSubclassOf("QtQuick.Text"))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool PropertyEditorValue::isAvailable() const
|
bool PropertyEditorValue::isAvailable() const
|
||||||
{
|
{
|
||||||
const QList<QByteArray> mcuProperties = {"layer", "opacity", "rotation", "scale", "gradient",
|
const QList<QByteArray> mcuProperties = {"layer", "opacity", "gradient", "smooth", "antialiasing"};
|
||||||
"transformOrigin", "smooth", "antialiasing", "border"};
|
|
||||||
|
const QList<QByteArray> mcuTransformProperties = {"rotation", "scale", "transformOrigin"};
|
||||||
|
|
||||||
const QList<QByteArray> list = name().split('.');
|
const QList<QByteArray> list = name().split('.');
|
||||||
const QByteArray pureName = list.first();
|
const QByteArray pureName = list.first();
|
||||||
|
|
||||||
QmlDesigner::DesignDocument *designDocument =
|
QmlDesigner::DesignDocument *designDocument = QmlDesigner::QmlDesignerPlugin::instance()
|
||||||
QmlDesigner::QmlDesignerPlugin::instance()->documentManager().currentDesignDocument();
|
->documentManager()
|
||||||
|
.currentDesignDocument();
|
||||||
|
|
||||||
|
if (designDocument && designDocument->isQtForMCUsProject()) {
|
||||||
if (designDocument && designDocument->isQtForMCUsProject())
|
if (mcuProperties.contains(pureName))
|
||||||
return !mcuProperties.contains(pureName);
|
return false;
|
||||||
|
if (mcuTransformProperties.contains(pureName) && !itemOrImage(m_modelNode.metaInfo()))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user