PRCYCoin
2.0.0.7rc1
P2P Digital Currency
src
qt
qvaluecombobox.cpp
Go to the documentation of this file.
1
// Copyright (c) 2011-2013 The Bitcoin developers
2
// Distributed under the MIT/X11 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) : QComboBox(parent), role(Qt::UserRole)
8
{
9
connect(
this
, SIGNAL(currentIndexChanged(
int
)),
this
, SLOT(
handleSelectionChanged
(
int
)));
10
}
11
12
QVariant
QValueComboBox::value
()
const
13
{
14
return
itemData(currentIndex(),
role
);
15
}
16
17
void
QValueComboBox::setValue
(
const
QVariant& value)
18
{
19
setCurrentIndex(findData(
value
,
role
));
20
}
21
22
void
QValueComboBox::setRole
(
int
role)
23
{
24
this->role =
role
;
25
}
26
27
void
QValueComboBox::handleSelectionChanged
(
int
idx)
28
{
29
Q_EMIT
valueChanged
();
30
}
QValueComboBox::QValueComboBox
QValueComboBox(QWidget *parent=0)
Definition:
qvaluecombobox.cpp:7
QValueComboBox::setValue
void setValue(const QVariant &value)
Definition:
qvaluecombobox.cpp:17
QValueComboBox::role
int role
Definition:
qvaluecombobox.h:31
QValueComboBox::valueChanged
void valueChanged()
qvaluecombobox.h
QValueComboBox::setRole
void setRole(int role)
Specify model role to use as ordinal value (defaults to Qt::UserRole)
Definition:
qvaluecombobox.cpp:22
QValueComboBox::value
QVariant value
Definition:
qvaluecombobox.h:16
QValueComboBox::handleSelectionChanged
void handleSelectionChanged(int idx)
Definition:
qvaluecombobox.cpp:27
Generated on Tue Apr 28 2026 00:02:54 for PRCYCoin by
1.8.17