Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
qvaluecombobox.cpp
Go to the documentation of this file.
1 #include "qvaluecombobox.h"
2 
4  QComboBox(parent), role(Qt::UserRole)
5 {
6  connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(handleSelectionChanged(int)));
7 }
8 
9 QVariant QValueComboBox::value() const
10 {
11  return itemData(currentIndex(), role);
12 }
13 
14 void QValueComboBox::setValue(const QVariant &value)
15 {
16  setCurrentIndex(findData(value, role));
17 }
18 
20 {
21  this->role = role;
22 }
23 
25 {
26  emit valueChanged();
27 }
std::string * value
Definition: version_set.cc:270
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)