X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fprop%2Fproperty.h;h=0b4bc7b0ed9223bca1f20706688924812d41a51f;hp=e6745a10d903cf9b4726f83c2bd1d252cf741b8a;hb=819f4c25391a9c74d3d2f528d462142d5c4aad4d;hpb=c8df600577e9c7b1ca90baf6bd01ccc980f89464 diff --git a/pv/prop/property.h b/pv/prop/property.h index e6745a10..0b4bc7b0 100644 --- a/pv/prop/property.h +++ b/pv/prop/property.h @@ -21,6 +21,10 @@ #ifndef PULSEVIEW_PV_PROP_PROPERTY_H #define PULSEVIEW_PV_PROP_PROPERTY_H +#include + +#include + #include #include @@ -29,15 +33,29 @@ class QWidget; namespace pv { namespace prop { -class Property +class Property : public QObject { + Q_OBJECT; + +public: + typedef boost::function Getter; + typedef boost::function Setter; + protected: - Property(QString name); + Property(QString name, Getter getter, Setter setter); public: const QString& name() const; - virtual QWidget* get_widget(QWidget *parent) = 0; + virtual QWidget* get_widget(QWidget *parent, + bool auto_commit = false) = 0; + virtual bool labeled_widget() const; + + virtual void commit() = 0; + +protected: + const Getter _getter; + const Setter _setter; private: QString _name;