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.
5 #include "coincontroltreewidget.h"
6 #include "coincontroldialog.h"
8 CoinControlTreeWidget::CoinControlTreeWidget(QWidget
*parent
) :
14 void CoinControlTreeWidget::keyPressEvent(QKeyEvent
*event
)
16 if (event
->key() == Qt::Key_Space
) // press spacebar -> select checkbox
19 int COLUMN_CHECKBOX
= 0;
20 if(this->currentItem())
21 this->currentItem()->setCheckState(COLUMN_CHECKBOX
, ((this->currentItem()->checkState(COLUMN_CHECKBOX
) == Qt::Checked
) ? Qt::Unchecked
: Qt::Checked
));
23 else if (event
->key() == Qt::Key_Escape
) // press esc -> close dialog
26 CoinControlDialog
*coinControlDialog
= (CoinControlDialog
*)this->parentWidget();
27 coinControlDialog
->done(QDialog::Accepted
);
31 this->QTreeWidget::keyPressEvent(event
);