aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty/QtPropertyBrowser
diff options
context:
space:
mode:
authorEddie Hung <eddie.hung+gitlab@gmail.com>2018-07-27 05:54:18 +0000
committerEddie Hung <eddie.hung+gitlab@gmail.com>2018-07-27 05:54:18 +0000
commit56d551d4071194b0484395cdd1418cdacd56679f (patch)
tree2dea519e47cf4181cc9d18cab3b2ae821a963da1 /3rdparty/QtPropertyBrowser
parent771edd1fda8692930e186a8913b7588d18fda710 (diff)
parent4c40541484f0f0b571e1c7e4604c39c74dd5c93d (diff)
downloadnextpnr-56d551d4071194b0484395cdd1418cdacd56679f.tar.gz
nextpnr-56d551d4071194b0484395cdd1418cdacd56679f.tar.bz2
nextpnr-56d551d4071194b0484395cdd1418cdacd56679f.zip
Merge branch 'redist_slack' into 'redist_slack'
Redist slack See merge request eddiehung/nextpnr!10
Diffstat (limited to '3rdparty/QtPropertyBrowser')
-rw-r--r--3rdparty/QtPropertyBrowser/src/qtpropertybrowser.cpp17
-rw-r--r--3rdparty/QtPropertyBrowser/src/qtpropertybrowser.h2
-rw-r--r--3rdparty/QtPropertyBrowser/src/qttreepropertybrowser.cpp5
-rw-r--r--3rdparty/QtPropertyBrowser/src/qtvariantproperty.cpp1
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())