diff --git a/share/qtcreator/qmldesigner/collectionEditorQmlSource/CollectionDetailsView.qml b/share/qtcreator/qmldesigner/collectionEditorQmlSource/CollectionDetailsView.qml index 7ab7277f92c..4fef5f036b6 100644 --- a/share/qtcreator/qmldesigner/collectionEditorQmlSource/CollectionDetailsView.qml +++ b/share/qtcreator/qmldesigner/collectionEditorQmlSource/CollectionDetailsView.qml @@ -221,9 +221,18 @@ Rectangle { clip: true implicitWidth: 100 implicitHeight: StudioTheme.Values.baseHeight - border.color: dataTypeWarning !== CollectionDetails.Warning.None ? - StudioTheme.Values.themeWarning : StudioTheme.Values.themeControlBackgroundInteraction + color: itemSelected ? StudioTheme.Values.themeControlBackgroundInteraction + : StudioTheme.Values.themeControlBackground border.width: 1 + border.color: { + if (dataTypeWarning !== CollectionDetails.Warning.None) + return StudioTheme.Values.themeWarning + + if (itemSelected) + return StudioTheme.Values.themeControlOutlineInteraction + + return StudioTheme.Values.themeControlBackgroundInteraction + } HelperWidgets.ToolTipArea { anchors.fill: parent @@ -254,9 +263,8 @@ Rectangle { Text { text: display - color: itemSelected - ? StudioTheme.Values.themeInteraction - : StudioTheme.Values.themePlaceholderTextColorInteraction + color: itemSelected ? StudioTheme.Values.themeInteraction + : StudioTheme.Values.themePlaceholderTextColorInteraction leftPadding: 5 topPadding: 3 bottomPadding: 3 @@ -274,7 +282,7 @@ Rectangle { } function resetSource() { - if (columnType == CollectionDetails.DataType.Color) + if (columnType === CollectionDetails.DataType.Color) cellContentLoader.sourceComponent = colorEditorComponent else cellContentLoader.sourceComponent = cellText @@ -291,28 +299,6 @@ Rectangle { } } - states: [ - State { - name: "default" - when: !itemSelected - - PropertyChanges { - target: itemCell - color: StudioTheme.Values.themeControlBackground - } - }, - State { - name: "selected" - when: itemSelected - - PropertyChanges { - target: itemCell - color: StudioTheme.Values.themeControlBackgroundInteraction - border.color: StudioTheme.Values.themeControlBackground - } - } - ] - StudioControls.Menu { id: cellContextMenu diff --git a/src/plugins/qmldesigner/components/collectioneditor/collectiondetails.cpp b/src/plugins/qmldesigner/components/collectioneditor/collectiondetails.cpp index ec6017ffa35..90f0061c87c 100644 --- a/src/plugins/qmldesigner/components/collectioneditor/collectiondetails.cpp +++ b/src/plugins/qmldesigner/components/collectioneditor/collectiondetails.cpp @@ -375,8 +375,10 @@ DataTypeWarning::Warning CollectionDetails::cellWarningCheck(int row, int column const QString &propertyName = d->properties.at(column).name; const QJsonObject &element = d->elements.at(row); - if (element.isEmpty()) + if (typeAt(column) == DataType::Unknown || element.isEmpty() + || data(row, column) == QVariant::fromValue(nullptr)) { return DataTypeWarning::Warning::None; + } if (element.contains(propertyName) && typeAt(column) != typeAt(row, column)) return DataTypeWarning::Warning::CellDataTypeMismatch;