PIVX Core
5.6.99
P2P Digital Currency
src
qt
qvaluecombobox.cpp
Go to the documentation of this file.
1
// Copyright (c) 2011-2013 The Bitcoin developers
2
// Copyright (c) 2017-2019 The PIVX Core developers
3
// Distributed under the MIT/X11 software license, see the accompanying
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6
#include "
qvaluecombobox.h
"
7
8
QValueComboBox::QValueComboBox
(QWidget* parent) : QComboBox(parent), role(Qt::UserRole)
9
{
10
connect(
this
,
static_cast<
void
(QComboBox::*)(
int
)
>
(&QComboBox::currentIndexChanged),
this
, &
QValueComboBox::handleSelectionChanged
);
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::valueChanged
void valueChanged()
QValueComboBox::handleSelectionChanged
void handleSelectionChanged(int idx)
Definition:
qvaluecombobox.cpp:28
QValueComboBox::QValueComboBox
QValueComboBox(QWidget *parent=0)
Definition:
qvaluecombobox.cpp:8
QValueComboBox::setRole
void setRole(int role)
Specify model role to use as ordinal value (defaults to Qt::UserRole)
Definition:
qvaluecombobox.cpp:23
QValueComboBox::role
int role
Definition:
qvaluecombobox.h:31
QValueComboBox::value
QVariant value
Definition:
qvaluecombobox.h:16
QValueComboBox::setValue
void setValue(const QVariant &value)
Definition:
qvaluecombobox.cpp:18
qvaluecombobox.h
Generated on Wed Apr 2 2025 00:40:32 for PIVX Core by
1.9.1