Merge #11683: tests: Remove unused mininode functions {ser,deser}_int_vector(......
[bitcoinplatinum.git] / src / qt / qvaluecombobox.cpp
blobaf5f6f8fd087439eaf9bae687fd0d9ea9788f39a
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #include <qt/qvaluecombobox.h>
7 QValueComboBox::QValueComboBox(QWidget *parent) :
8 QComboBox(parent), role(Qt::UserRole)
10 connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(handleSelectionChanged(int)));
13 QVariant QValueComboBox::value() const
15 return itemData(currentIndex(), role);
18 void QValueComboBox::setValue(const QVariant &value)
20 setCurrentIndex(findData(value, role));
23 void QValueComboBox::setRole(int _role)
25 this->role = _role;
28 void QValueComboBox::handleSelectionChanged(int idx)
30 Q_EMIT valueChanged();