projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pv::prop::Enum: Do not create a widget if the initial value could not be retrieved
[pulseview.git]
/
pv
/
prop
/
bool.cpp
diff --git
a/pv/prop/bool.cpp
b/pv/prop/bool.cpp
index ad9a13e7c0e05bc710fc7d385b6ad7e6b22a04be..ac142fd440403c6b015c441f6e6b1d13ae3923aa 100644
(file)
--- a/
pv/prop/bool.cpp
+++ b/
pv/prop/bool.cpp
@@
-24,9
+24,6
@@
#include "bool.h"
#include "bool.h"
-using namespace std;
-using namespace boost;
-
namespace pv {
namespace prop {
namespace pv {
namespace prop {
@@
-40,7
+37,7
@@
Bool::~Bool()
{
}
{
}
-QWidget* Bool::get_widget(QWidget *parent)
+QWidget* Bool::get_widget(QWidget *parent
, bool auto_commit
)
{
if (_check_box)
return _check_box;
{
if (_check_box)
return _check_box;
@@
-55,6
+52,10
@@
QWidget* Bool::get_widget(QWidget *parent)
g_variant_unref(value);
}
g_variant_unref(value);
}
+ if (auto_commit)
+ connect(_check_box, SIGNAL(stateChanged(int)),
+ this, SLOT(on_state_changed(int)));
+
return _check_box;
}
return _check_box;
}
@@
-74,5
+75,10
@@
void Bool::commit()
_check_box->checkState() == Qt::Checked));
}
_check_box->checkState() == Qt::Checked));
}
+void Bool::on_state_changed(int)
+{
+ commit();
+}
+
} // prop
} // pv
} // prop
} // pv