Dash Core
0.12.2.1
P2P Digital Currency
qvaluecombobox.cpp
Go to the documentation of this file.
1
// Copyright (c) 2011-2015 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.
4
5
#include "
qvaluecombobox.h
"
6
7
QValueComboBox::QValueComboBox
(QWidget *parent) :
8
QComboBox(parent), role(Qt::UserRole)
9
{
10
connect(
this
, SIGNAL(currentIndexChanged(
int
)),
this
, SLOT(
handleSelectionChanged
(
int
)));
11
}
12
13
QVariant
QValueComboBox::value
()
const
14
{
15
return
itemData(currentIndex(),
role
);
16
}
17
18
void
QValueComboBox::setValue
(
const
QVariant &value)
19
{
20
setCurrentIndex(findData(
value
,
role
));
21
}
22
23
void
QValueComboBox::setRole
(
int
role)
24
{
25
this->role =
role
;
26
}
27
28
void
QValueComboBox::handleSelectionChanged
(
int
idx)
29
{
30
Q_EMIT
valueChanged
();
31
}
QValueComboBox::role
int role
Definition:
qvaluecombobox.h:31
QValueComboBox::handleSelectionChanged
void handleSelectionChanged(int idx)
Definition:
qvaluecombobox.cpp:28
QValueComboBox::setValue
void setValue(const QVariant &value)
Definition:
qvaluecombobox.cpp:18
QValueComboBox::QValueComboBox
QValueComboBox(QWidget *parent=0)
Definition:
qvaluecombobox.cpp:7
QValueComboBox::valueChanged
void valueChanged()
Definition:
moc_qvaluecombobox.cpp:174
QValueComboBox::value
QVariant value() const
QValueComboBox::setRole
void setRole(int role)
Definition:
qvaluecombobox.cpp:23
qvaluecombobox.h
src
qt
qvaluecombobox.cpp
Generated on Thu Dec 14 2017 13:15:07 for Dash Core by
1.8.14