projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
067e5d9
)
Enum now allows the no-selection condition
author
Joel Holdsworth
<joel@airwebreathe.org.uk>
Sun, 7 Apr 2013 19:49:10 +0000
(20:49 +0100)
committer
Joel Holdsworth
<joel@airwebreathe.org.uk>
Mon, 8 Apr 2013 18:08:18 +0000
(19:08 +0100)
pv/prop/enum.cpp
patch
|
blob
|
history
diff --git
a/pv/prop/enum.cpp
b/pv/prop/enum.cpp
index 065fd548f22b336151d03da49f0c03e43456bce1..ced2f2bb0c79664b98af758a2ecf42b6d711316a 100644
(file)
--- a/
pv/prop/enum.cpp
+++ b/
pv/prop/enum.cpp
@@
-51,13
+51,12
@@
QWidget* Enum::get_widget(QWidget *parent)
return _selector;
GVariant *const value = _getter ? _getter() : NULL;
- assert(value);
_selector = new QComboBox(parent);
for (unsigned int i = 0; i < _values.size(); i++) {
const pair<GVariant*, QString> &v = _values[i];
_selector->addItem(v.second, qVariantFromValue((void*)v.first));
- if (g_variant_compare(v.first, value) == 0)
+ if (
value &&
g_variant_compare(v.first, value) == 0)
_selector->setCurrentIndex(i);
}