]> sigrok.org Git - pulseview.git/commitdiff
Added support for auto-apply in Binding
authorJoel Holdsworth <redacted>
Sat, 12 Oct 2013 11:31:04 +0000 (12:31 +0100)
committerJoel Holdsworth <redacted>
Sun, 13 Oct 2013 11:39:43 +0000 (12:39 +0100)
pv/prop/binding/binding.cpp
pv/prop/binding/binding.h

index 28a47099144eb8d50883a8d602c2f2d210a56c78..afdd7030a2a694b889cfe799fcc29cb2edd8c1a2 100644 (file)
@@ -45,7 +45,8 @@ void Binding::commit()
        }
 }
 
-void Binding::add_properties_to_form(QFormLayout *layout) const
+void Binding::add_properties_to_form(QFormLayout *layout,
+       bool auto_commit) const
 {
        assert(layout);
 
@@ -53,16 +54,18 @@ void Binding::add_properties_to_form(QFormLayout *layout) const
        {
                assert(p);
                const QString label = p->labeled_widget() ? QString() : p->name();
-               layout->addRow(label, p->get_widget(layout->parentWidget()));
+               layout->addRow(label, p->get_widget(layout->parentWidget(),
+                       auto_commit));
        }
 }
 
-QWidget* Binding::get_property_form(QWidget *parent) const
+QWidget* Binding::get_property_form(QWidget *parent,
+       bool auto_commit) const
 {
        QWidget *const form = new QWidget(parent);
        QFormLayout *const layout = new QFormLayout(form);
        form->setLayout(layout);
-       add_properties_to_form(layout);
+       add_properties_to_form(layout, auto_commit);
        return form;
 }
 
index 97a6a5d1f8e7b6e9dfe6c03cd7345490269c95cd..4de4af33ba3044f150b88c5fc4fc8698e5a21ab5 100644 (file)
@@ -40,9 +40,11 @@ public:
 
        void commit();
 
-       void add_properties_to_form(QFormLayout *layout) const;
+       void add_properties_to_form(QFormLayout *layout,
+               bool auto_commit = false) const;
 
-       QWidget* get_property_form(QWidget *parent) const;
+       QWidget* get_property_form(QWidget *parent,
+               bool auto_commit = false) const;
 
 protected:
        std::vector< boost::shared_ptr<Property> > _properties;