Bitcoin ABC
0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
src
qt
coincontroltreewidget.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 <
qt/coincontroltreewidget.h
>
6
7
#include <
qt/coincontroldialog.h
>
8
9
CoinControlTreeWidget::CoinControlTreeWidget
(QWidget *parent)
10
: QTreeWidget(parent) {}
11
12
void
CoinControlTreeWidget::keyPressEvent
(
QKeyEvent
*event) {
13
if
(event->key() == Qt::Key_Space)
// press spacebar -> select checkbox
14
{
15
event
->ignore();
16
if
(this->
currentItem
()) {
17
int
COLUMN_CHECKBOX = 0;
18
this->
currentItem
()->setCheckState(
19
COLUMN_CHECKBOX, ((this->
currentItem
()->
checkState
(
20
COLUMN_CHECKBOX) == Qt::Checked)
21
? Qt::Unchecked
22
: Qt::Checked));
23
}
24
}
else
if
(event->key() == Qt::Key_Escape)
// press esc -> close dialog
25
{
26
event
->ignore();
27
CoinControlDialog
*
coinControlDialog
=
28
static_cast<
CoinControlDialog
*
>
(this->
parentWidget
());
29
coinControlDialog->done(QDialog::Accepted);
30
}
else
{
31
this->QTreeWidget::keyPressEvent(event);
32
}
33
}
CoinControlDialog
Definition
coincontroldialog.h:41
CoinControlTreeWidget::CoinControlTreeWidget
CoinControlTreeWidget(QWidget *parent=nullptr)
Definition
coincontroltreewidget.cpp:9
CoinControlTreeWidget::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event) override
Definition
coincontroltreewidget.cpp:12
coincontroldialog.h
coincontroltreewidget.h
GetRand
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition
random.h:85
Generated on Mon Nov 4 2024 02:38:10 for Bitcoin ABC by
1.9.8