projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Moved form generation into Binding
[pulseview.git]
/
pv
/
prop
/
binding
/
binding.cpp
diff --git
a/pv/prop/binding/binding.cpp
b/pv/prop/binding/binding.cpp
index 5d411686f4a820f8ea686e191091f1b6d8c5500b..3c9bba5aee16483c14596def207d5ca6d0b0249b 100644
(file)
--- a/
pv/prop/binding/binding.cpp
+++ b/
pv/prop/binding/binding.cpp
@@
-18,51
+18,47
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <QFormLayout>
-#include <QWidget>
-
#include <boost/foreach.hpp>
#include <boost/foreach.hpp>
-#include
"binding.h"
+#include
<QFormLayout>
#include <pv/prop/property.h>
#include <pv/prop/property.h>
+#include "binding.h"
+
using namespace boost;
namespace pv {
namespace prop {
namespace binding {
using namespace boost;
namespace pv {
namespace prop {
namespace binding {
-Binding::Binding() :
- _form(NULL)
+const std::vector< boost::shared_ptr<Property> >& Binding::properties()
{
{
+ return _properties;
}
}
-
QWidget* Binding::get_form(QWidget *parent
)
+
void Binding::commit(
)
{
{
- if (_form)
- return _form;
-
- _form = new QWidget(parent);
- QFormLayout *const layout = new QFormLayout(_form);
- _form->setLayout(layout);
-
- BOOST_FOREACH(shared_ptr<Property> p, _properties)
- {
+ BOOST_FOREACH(shared_ptr<pv::prop::Property> p, _properties) {
assert(p);
assert(p);
-
layout->addRow(p->name(), p->get_widget(_form)
);
+
p->commit(
);
}
}
-
- return _form;
}
}
-void Binding::commit()
+QWidget* Binding::get_property_form(QWidget *parent) const
{
{
- BOOST_FOREACH(shared_ptr<Property> p, _properties)
+ QWidget *const form = new QWidget(parent);
+ QFormLayout *const layout = new QFormLayout(form);
+ form->setLayout(layout);
+
+ BOOST_FOREACH(shared_ptr<pv::prop::Property> p, _properties)
{
assert(p);
{
assert(p);
- p->commit();
+ const QString label = p->labeled_widget() ? QString() : p->name();
+ layout->addRow(label, p->get_widget(form));
}
}
+
+ return form;
}
} // binding
}
} // binding