Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
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
6
8
10 : QTreeWidget(parent) {}
11
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();
28 static_cast<CoinControlDialog *>(this->parentWidget());
29 coinControlDialog->done(QDialog::Accepted);
30 } else {
31 this->QTreeWidget::keyPressEvent(event);
32 }
33}
CoinControlTreeWidget(QWidget *parent=nullptr)
virtual void keyPressEvent(QKeyEvent *event) override
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