X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fprop%2Fproperty.h;h=e5a523f93758ac6612f87637a06b7cad5770bd5e;hb=d23445348bf04a698e062a3b917360313ecbcaad;hp=002c91161faffd053d2a690e15f641a65282de9d;hpb=24bb0bd140f7f8b00ea3c0cbe0c5d26dc03a3b69;p=pulseview.git diff --git a/pv/prop/property.h b/pv/prop/property.h index 002c911..e5a523f 100644 --- a/pv/prop/property.h +++ b/pv/prop/property.h @@ -21,7 +21,7 @@ #ifndef PULSEVIEW_PV_PROP_PROPERTY_H #define PULSEVIEW_PV_PROP_PROPERTY_H -#include +#include #include #include @@ -31,18 +31,30 @@ class QWidget; namespace pv { namespace prop { -class Property +class Property : public QObject { + Q_OBJECT; + +public: + typedef std::function Getter; + typedef std::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; };