forked from qt-creator/qt-creator
QmlDesigner: Fix 3D view grid color setting
Grid color was not loaded correctly on scene creation, because there was a mismatch on how it was set. Normally, it was set as a color array, but on scene creation it was set as a single color. Changed it to be always set as a single color, as there is no reason to allow array of colors for grid. Fixes: QDS-10495 Change-Id: Idbe5d52a425eed7aed6beef9e3712b26519e5843 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
@@ -40,7 +40,12 @@ public:
|
||||
|
||||
static void setColors(AbstractView *view, View3DActionType type, const QList<QColor> &colorConfig)
|
||||
{
|
||||
setVariant(view, type, QVariant::fromValue(colorConfig));
|
||||
QVariant param;
|
||||
if (type == View3DActionType::SelectGridColor)
|
||||
param = colorConfig.isEmpty() ? QColor() : colorConfig[0];
|
||||
else
|
||||
param = QVariant::fromValue(colorConfig);
|
||||
setVariant(view, type, param);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
@@ -204,8 +204,8 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
if ("selectGridColor" in viewStates && viewStates.selectGridColor.length === 1)
|
||||
viewRoot.gridColor = viewStates.selectGridColor[0]
|
||||
if ("selectGridColor" in viewStates)
|
||||
viewRoot.gridColor = viewStates.selectGridColor
|
||||
}
|
||||
|
||||
// If resetToDefault is true, tool states not specifically set to anything will be reset to
|
||||
|
Reference in New Issue
Block a user