X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fprop%2Fenum.h;h=6ff785a3ba430562fffbfacb47d97b5990a0ed04;hp=2350fef886917ad884639938c0f5b106a00a6c70;hb=e8d009288de28cb194bc7964f96677c2baf900c9;hpb=820c3dea881d351f2bbf4e03c2302f5ca645df63 diff --git a/pv/prop/enum.h b/pv/prop/enum.h index 2350fef8..6ff785a3 100644 --- a/pv/prop/enum.h +++ b/pv/prop/enum.h @@ -26,6 +26,10 @@ #include "property.h" +#include + +Q_DECLARE_METATYPE(Glib::VariantBase); + class QComboBox; namespace pv { @@ -33,13 +37,23 @@ namespace prop { class Enum : public Property { + Q_OBJECT; + public: - Enum(QString name, std::vector > values); + Enum(QString name, std::vector > values, + Getter getter, Setter setter); + + virtual ~Enum(); + + QWidget* get_widget(QWidget *parent, bool auto_commit); + + void commit(); - QWidget* get_widget(QWidget *parent); +private Q_SLOTS: + void on_current_item_changed(int); private: - const std::vector< std::pair > _values; + const std::vector< std::pair > _values; QComboBox *_selector; };