aboutsummaryrefslogtreecommitdiffstats
path: root/3rdparty
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-07-25 19:10:45 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-07-25 19:10:45 +0200
commit2596b9fe17fbf0a08ff234c7798a32429d27640b (patch)
treee7a0b7cda6b7932070e39a8c837da8e6208e0fb3 /3rdparty
parent790d7159bb0c31ea015b08313cf4713728f8b574 (diff)
downloadnextpnr-2596b9fe17fbf0a08ff234c7798a32429d27640b.tar.gz
nextpnr-2596b9fe17fbf0a08ff234c7798a32429d27640b.tar.bz2
nextpnr-2596b9fe17fbf0a08ff234c7798a32429d27640b.zip
Add ability for multiple selection, enable for select only items that make sense
Diffstat (limited to '3rdparty')
-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())