Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
qvaluecombobox.h
Go to the documentation of this file.
1 #ifndef QVALUECOMBOBOX_H
2 #define QVALUECOMBOBOX_H
3 
4 #include <QComboBox>
5 #include <QVariant>
6 
7 /* QComboBox that can be used with QDataWidgetMapper to select ordinal values from a model. */
8 class QValueComboBox : public QComboBox
9 {
10  Q_OBJECT
11 
12  Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged USER true)
13 
14 public:
15  explicit QValueComboBox(QWidget *parent = 0);
16 
17  QVariant value() const;
18  void setValue(const QVariant &value);
19 
21  void setRole(int role);
22 
23 signals:
24  void valueChanged();
25 
26 private:
27  int role;
28 
29 private slots:
30  void handleSelectionChanged(int idx);
31 };
32 
33 #endif // QVALUECOMBOBOX_H
void valueChanged()
QVariant value() const
void handleSelectionChanged(int idx)
void setValue(const QVariant &value)
QValueComboBox(QWidget *parent=0)
void setRole(int role)
Specify model role to use as ordinal value (defaults to Qt::UserRole)