Raven Core  3.0.0
P2P Digital Currency
coincontroltreewidget.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2015 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Raven Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
7 #include "coincontroldialog.h"
8 
10  QTreeWidget(parent)
11 {
12 
13 }
14 
16 {
17  if (event->key() == Qt::Key_Space) // press spacebar -> select checkbox
18  {
19  event->ignore();
20  if (this->currentItem()) {
21  int COLUMN_CHECKBOX = 0;
22  this->currentItem()->setCheckState(COLUMN_CHECKBOX, ((this->currentItem()->checkState(COLUMN_CHECKBOX) == Qt::Checked) ? Qt::Unchecked : Qt::Checked));
23  }
24  }
25  else if (event->key() == Qt::Key_Escape) // press esc -> close dialog
26  {
27  event->ignore();
28  CoinControlDialog *coinControlDialog = (CoinControlDialog*)this->parentWidget();
29  coinControlDialog->done(QDialog::Accepted);
30  }
31  else
32  {
33  this->QTreeWidget::keyPressEvent(event);
34  }
35 }
virtual void keyPressEvent(QKeyEvent *event)
CoinControlTreeWidget(QWidget *parent=0)