#include <utility>
#include <vector>
-#include <glib-2.0/glib.h>
#include "property.h"
class QComboBox;
class Enum : public Property
{
+ Q_OBJECT;
+
public:
- Enum(QString name,
- std::vector<std::pair<const void*, QString> > values,
- boost::function<GVariant* ()> getter,
- boost::function<void (GVariant*)> setter);
+ Enum(QString name, std::vector<std::pair<GVariant*, QString> > values,
+ Getter getter, Setter setter);
+
+ virtual ~Enum();
- QWidget* get_widget(QWidget *parent);
+ QWidget* get_widget(QWidget *parent, bool auto_commit);
void commit();
+private Q_SLOTS:
+ void on_current_item_changed(int);
+
private:
- const std::vector< std::pair<const void*, QString> > _values;
- boost::function<GVariant* ()> _getter;
- boost::function<void (GVariant*)> _setter;
+ const std::vector< std::pair<GVariant*, QString> > _values;
QComboBox *_selector;
};