forked from qt-creator/qt-creator
QmlDesigner: Hide dynamic properties if multiple items are selected
If multiple items get selected it is not clear to which item the property belongs. Therefore we hide the section. Task-number: QDS-7688 Change-Id: Ieaa0114d87974fea3135adc2d1bcd979c2236ed2 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -39,6 +39,7 @@ PropertyEditorPane {
|
||||
|
||||
DynamicPropertiesSection {
|
||||
propertiesModel: SelectionDynamicPropertiesModel {}
|
||||
visible: !hasMultiSelection
|
||||
}
|
||||
|
||||
GeometrySection {}
|
||||
|
@@ -42,6 +42,7 @@ PropertyEditorPane {
|
||||
|
||||
DynamicPropertiesSection {
|
||||
propertiesModel: SelectionDynamicPropertiesModel {}
|
||||
visible: !hasMultiSelection
|
||||
}
|
||||
|
||||
Loader {
|
||||
|
@@ -429,6 +429,20 @@ QQmlComponent *PropertyEditorContextObject::specificQmlComponent()
|
||||
return m_qmlComponent;
|
||||
}
|
||||
|
||||
bool PropertyEditorContextObject::hasMultiSelection() const
|
||||
{
|
||||
return m_hasMultiSelection;
|
||||
}
|
||||
|
||||
void PropertyEditorContextObject::setHasMultiSelection(bool b)
|
||||
{
|
||||
if (b == m_hasMultiSelection)
|
||||
return;
|
||||
|
||||
m_hasMultiSelection = b;
|
||||
emit hasMultiSelectionChanged();
|
||||
}
|
||||
|
||||
void PropertyEditorContextObject::setSpecificsUrl(const QUrl &newSpecificsUrl)
|
||||
{
|
||||
if (newSpecificsUrl == m_specificsUrl)
|
||||
|
@@ -68,6 +68,9 @@ class PropertyEditorContextObject : public QObject
|
||||
|
||||
Q_PROPERTY(QQmlComponent* specificQmlComponent READ specificQmlComponent NOTIFY specificQmlComponentChanged)
|
||||
|
||||
Q_PROPERTY(bool hasMultiSelection READ hasMultiSelection WRITE setHasMultiSelection NOTIFY
|
||||
hasMultiSelectionChanged)
|
||||
|
||||
public:
|
||||
PropertyEditorContextObject(QObject *parent = nullptr);
|
||||
|
||||
@@ -126,6 +129,10 @@ public:
|
||||
|
||||
bool hasAliasExport() const { return m_aliasExport; }
|
||||
|
||||
bool hasMultiSelection() const;
|
||||
|
||||
void setHasMultiSelection(bool);
|
||||
|
||||
signals:
|
||||
void specificsUrlChanged();
|
||||
void specificQmlDataChanged();
|
||||
@@ -142,6 +149,7 @@ signals:
|
||||
void hasAliasExportChanged();
|
||||
void hasActiveTimelineChanged();
|
||||
void activeDragSuffixChanged();
|
||||
void hasMultiSelectionChanged();
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -192,6 +200,8 @@ private:
|
||||
bool m_setHasActiveTimeline = false;
|
||||
|
||||
QString m_activeDragSuffix;
|
||||
|
||||
bool m_hasMultiSelection = false;
|
||||
};
|
||||
|
||||
class EasingCurveEditor : public QObject
|
||||
|
Reference in New Issue
Block a user