Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
coincontroltreewidget.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 
6 #include "coincontroldialog.h"
7 
9  QTreeWidget(parent)
10 {
11 
12 }
13 
15 {
16  if (event->key() == Qt::Key_Space) // press spacebar -> select checkbox
17  {
18  event->ignore();
19  int COLUMN_CHECKBOX = 0;
20  this->currentItem()->setCheckState(COLUMN_CHECKBOX, ((this->currentItem()->checkState(COLUMN_CHECKBOX) == Qt::Checked) ? Qt::Unchecked : Qt::Checked));
21  }
22  else if (event->key() == Qt::Key_Escape) // press esc -> close dialog
23  {
24  event->ignore();
25  CoinControlDialog *coinControlDialog = (CoinControlDialog*)this->parentWidget();
26  coinControlDialog->done(QDialog::Accepted);
27  }
28  else
29  {
30  this->QTreeWidget::keyPressEvent(event);
31  }
32 }
virtual void keyPressEvent(QKeyEvent *event)
CoinControlTreeWidget(QWidget *parent=0)