projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Store DeviceOptions::_sdi as const
[pulseview.git]
/
pv
/
prop
/
string.cpp
diff --git
a/pv/prop/string.cpp
b/pv/prop/string.cpp
index b9de789b90298042104bd0b60b2ea94e8bd45668..37efc148255848be1103e8cb5beca9ea48485c20 100644
(file)
--- a/
pv/prop/string.cpp
+++ b/
pv/prop/string.cpp
@@
-20,13
+20,11
@@
#include <assert.h>
#include <assert.h>
+#include <QLineEdit>
#include <QSpinBox>
#include "string.h"
#include <QSpinBox>
#include "string.h"
-using namespace std;
-using namespace boost;
-
namespace pv {
namespace prop {
namespace pv {
namespace prop {
@@
-38,7
+36,7
@@
String::String(QString name,
{
}
{
}
-QWidget* String::get_widget(QWidget *parent)
+QWidget* String::get_widget(QWidget *parent
, bool auto_commit
)
{
if (_line_edit)
return _line_edit;
{
if (_line_edit)
return _line_edit;
@@
-47,11
+45,15
@@
QWidget* String::get_widget(QWidget *parent)
GVariant *const value = _getter ? _getter() : NULL;
if (value) {
GVariant *const value = _getter ? _getter() : NULL;
if (value) {
- _line_edit->setText(QString(
+ _line_edit->setText(QString
::fromUtf8
(
g_variant_get_string(value, NULL)));
g_variant_unref(value);
}
g_variant_get_string(value, NULL)));
g_variant_unref(value);
}
+ if (auto_commit)
+ connect(_line_edit, SIGNAL(textEdited(const QString&)),
+ this, SLOT(on_text_edited(const QString&)));
+
return _line_edit;
}
return _line_edit;
}
@@
-66,5
+68,10
@@
void String::commit()
_setter(g_variant_new_string(ba.data()));
}
_setter(g_variant_new_string(ba.data()));
}
+void String::on_text_edited(const QString&)
+{
+ commit();
+}
+
} // prop
} // pv
} // prop
} // pv