Merge #11997: [tests] util_tests.cpp: actually check ignored args
[bitcoinplatinum.git] / src / qt / qvaluecombobox.cpp
blob72c3a9d8354e4fdd59620c43c9d15126ae5c92a1
1 // Copyright (c) 2011-2017 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();