diff options
author | Sergiusz Bazanski <q3k@q3k.org> | 2018-07-26 16:22:19 +0100 |
---|---|---|
committer | Sergiusz Bazanski <q3k@q3k.org> | 2018-07-26 16:22:19 +0100 |
commit | 4a21436dfa98caa458a8e6e130cf1f6305968650 (patch) | |
tree | 4e1dd3f04e5b671acf958eba6f7dc930ae4d1547 /3rdparty/QtPropertyBrowser/src | |
parent | c897c0ca9afab1d758f5c1b77312e77057a4c814 (diff) | |
parent | 03f92948d1504c32049da065c0e73e01f96d8033 (diff) | |
download | nextpnr-4a21436dfa98caa458a8e6e130cf1f6305968650.tar.gz nextpnr-4a21436dfa98caa458a8e6e130cf1f6305968650.tar.bz2 nextpnr-4a21436dfa98caa458a8e6e130cf1f6305968650.zip |
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to '3rdparty/QtPropertyBrowser/src')
4 files changed, 24 insertions, 1 deletions
diff --git a/3rdparty/QtPropertyBrowser/src/qtpropertybrowser.cpp b/3rdparty/QtPropertyBrowser/src/qtpropertybrowser.cpp index 63260fe4..9533fb5b 100644 --- a/3rdparty/QtPropertyBrowser/src/qtpropertybrowser.cpp +++ b/3rdparty/QtPropertyBrowser/src/qtpropertybrowser.cpp @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE class QtPropertyPrivate { public: - QtPropertyPrivate(QtAbstractPropertyManager *manager) : m_enabled(true), m_modified(false), m_manager(manager) {} + QtPropertyPrivate(QtAbstractPropertyManager *manager) : m_enabled(true), m_selectable(true), m_modified(false), m_manager(manager) {} QtProperty *q_ptr; QSet<QtProperty *> m_parentItems; @@ -66,6 +66,7 @@ public: QString m_name; QString m_id; bool m_enabled; + bool m_selectable; bool m_modified; QtAbstractPropertyManager * const m_manager; @@ -260,6 +261,11 @@ bool QtProperty::isEnabled() const return d_ptr->m_enabled; } +bool QtProperty::isSelectable() const +{ + return d_ptr->m_selectable; +} + /*! Returns whether the property is modified. @@ -409,6 +415,15 @@ void QtProperty::setEnabled(bool enable) propertyChanged(); } +void QtProperty::setSelectable(bool selectable) +{ + if (d_ptr->m_selectable == selectable) + return; + + d_ptr->m_selectable = selectable; + propertyChanged(); +} + /*! Sets the property's modified state according to the passed \a modified value. diff --git a/3rdparty/QtPropertyBrowser/src/qtpropertybrowser.h b/3rdparty/QtPropertyBrowser/src/qtpropertybrowser.h index c4c6275b..1ca87830 100644 --- a/3rdparty/QtPropertyBrowser/src/qtpropertybrowser.h +++ b/3rdparty/QtPropertyBrowser/src/qtpropertybrowser.h @@ -83,6 +83,7 @@ public: QString propertyName() const; QString propertyId() const; bool isEnabled() const; + bool isSelectable() const; bool isModified() const; bool hasValue() const; @@ -97,6 +98,7 @@ public: void setPropertyName(const QString &text); void setPropertyId(const QString &text); void setEnabled(bool enable); + void setSelectable(bool selectable); void setModified(bool modified); bool isSubProperty()const; diff --git a/3rdparty/QtPropertyBrowser/src/qttreepropertybrowser.cpp b/3rdparty/QtPropertyBrowser/src/qttreepropertybrowser.cpp index 673252d2..523856eb 100644 --- a/3rdparty/QtPropertyBrowser/src/qttreepropertybrowser.cpp +++ b/3rdparty/QtPropertyBrowser/src/qttreepropertybrowser.cpp @@ -651,6 +651,11 @@ void QtTreePropertyBrowserPrivate::updateItem(QTreeWidgetItem *item) else disableItem(item); } + if (property->isSelectable()) { + item->setFlags(item->flags() | Qt::ItemIsSelectable); + } else { + item->setFlags(item->flags() & ~Qt::ItemIsSelectable); + } m_treeWidget->viewport()->update(); } diff --git a/3rdparty/QtPropertyBrowser/src/qtvariantproperty.cpp b/3rdparty/QtPropertyBrowser/src/qtvariantproperty.cpp index c41730c8..03f9688c 100644 --- a/3rdparty/QtPropertyBrowser/src/qtvariantproperty.cpp +++ b/3rdparty/QtPropertyBrowser/src/qtvariantproperty.cpp @@ -1339,6 +1339,7 @@ void addPropertyRecusively(QtVariantPropertyManager * manager, newProp->setWhatsThis(prop->whatsThis()); newProp->setModified(prop->isModified()); newProp->setEnabled(prop->isEnabled()); + newProp->setSelectable(prop->isSelectable()); newProp->setValue(prop->value()); foreach(QtProperty * subProp, prop->subProperties()) |