Update CMakeLists.txt - play with openssl
[novacoin.git] / src / qt / qvaluecombobox.cpp
1 #include "qvaluecombobox.h"
2
3 QValueComboBox::QValueComboBox(QWidget *parent) :
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
19 void QValueComboBox::setRole(int role)
20 {
21     this->role = role;
22 }
23
24 void QValueComboBox::handleSelectionChanged(int idx)
25 {
26     emit valueChanged();
27 }