Bugfix: Replace "URL" with "URI" where we aren't actually working with URLs
[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 int QValueComboBox::value() const
10 {
11     return itemData(currentIndex(), role).toInt();
12 }
13
14 void QValueComboBox::setValue(int 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 }