forked from qt-creator/qt-creator
QmlDesigner: Inspect components for existing states
For each created items we retrieve a list of the names of all existing states. Task-number: QDS-1978 Change-Id: I8e85e439fce3c6204cb8bcf69f6be847cc8dae5c Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -232,6 +232,20 @@ QList<QQuickItem *> QuickItemNodeInstance::allItemsRecursive() const
|
||||
return itemList;
|
||||
}
|
||||
|
||||
QStringList QuickItemNodeInstance::allStates() const
|
||||
{
|
||||
QStringList list;
|
||||
|
||||
QList<QObject*> stateList = DesignerSupport::statesForItem(quickItem());
|
||||
for (QObject *state : stateList) {
|
||||
QQmlProperty property(state, "name");
|
||||
if (property.isValid())
|
||||
list.append(property.read().toString());
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
QRectF QuickItemNodeInstance::contentItemBoundingBox() const
|
||||
{
|
||||
if (contentItem()) {
|
||||
|
||||
Reference in New Issue
Block a user