Add const to methods that do not modify the object for which it is called
[bitcoinplatinum.git] / src / qt / qvaluecombobox.cpp
bloba3b9b994ec2b1ef335ff58930f1e7f5791f0f6c2
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 "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();