diff --git a/PropertyEditor/source/src/QQuickDetailsViewLayoutBuilder.cpp b/PropertyEditor/source/src/QQuickDetailsViewLayoutBuilder.cpp index 41ed1b1..2bf2561 100644 --- a/PropertyEditor/source/src/QQuickDetailsViewLayoutBuilder.cpp +++ b/PropertyEditor/source/src/QQuickDetailsViewLayoutBuilder.cpp @@ -35,8 +35,8 @@ QPair QQuickDetailsViewRowBuilder::makeNameValueSlot() x: padding + (detailsDelegate.depth * detailsDelegate.indent) anchors.verticalCenter: parent.verticalCenter mipmap: true - source: detailsDelegate.expanded - ? "qrc:/resources/Icon/expand.png" + source: detailsDelegate.expanded + ? "qrc:/resources/Icon/expand.png" : "qrc:/resources/Icon/unexpand.png" width: 12 diff --git a/PropertyEditor/source/src/QQuickDetailsViewRow.cpp b/PropertyEditor/source/src/QQuickDetailsViewRow.cpp index 1723922..24a236b 100644 --- a/PropertyEditor/source/src/QQuickDetailsViewRow.cpp +++ b/PropertyEditor/source/src/QQuickDetailsViewRow.cpp @@ -165,5 +165,27 @@ void QDetailsViewRow_Group::setupItem(QQuickItem* inParent) } )"); groupLabel->setProperty("lableText", mName); + + int childCount = mChildren.size(); + QQuickItem* countLabel = builder.setupItem(slotPair.second, R"qml( + import QtQuick; + import QtQuick.Controls; + import ColorPalette; + Item{ + property int groupChildCount: 0 + implicitHeight: 25 + width: parent.width + anchors.verticalCenter: parent.verticalCenter + visible: !detailsDelegate.expanded + Text { + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + text: "(" + groupChildCount + ")" + color: ColorPalette.theme.textPrimary + } + } + )qml"); + countLabel->setProperty("groupChildCount", childCount); + builder.setHeightProxy(groupLabel); }