LCOV - code coverage report
Current view: top level - src/qt - coincontroltreewidget.cpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 0 17 0.0 %
Date: 2020-09-26 01:30:44 Functions: 0 3 0.0 %

          Line data    Source code
       1             : // Copyright (c) 2011-2018 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             : #include <qt/coincontroldialog.h>
       7             : 
       8           0 : CoinControlTreeWidget::CoinControlTreeWidget(QWidget *parent) :
       9           0 :     QTreeWidget(parent)
      10           0 : {
      11             : 
      12           0 : }
      13             : 
      14           0 : void CoinControlTreeWidget::keyPressEvent(QKeyEvent *event)
      15             : {
      16           0 :     if (event->key() == Qt::Key_Space) // press spacebar -> select checkbox
      17             :     {
      18           0 :         event->ignore();
      19           0 :         if (this->currentItem()) {
      20             :             int COLUMN_CHECKBOX = 0;
      21           0 :             this->currentItem()->setCheckState(COLUMN_CHECKBOX, ((this->currentItem()->checkState(COLUMN_CHECKBOX) == Qt::Checked) ? Qt::Unchecked : Qt::Checked));
      22           0 :         }
      23             :     }
      24           0 :     else if (event->key() == Qt::Key_Escape) // press esc -> close dialog
      25             :     {
      26           0 :         event->ignore();
      27           0 :         CoinControlDialog *coinControlDialog = static_cast<CoinControlDialog*>(this->parentWidget());
      28           0 :         coinControlDialog->done(QDialog::Accepted);
      29           0 :     }
      30             :     else
      31             :     {
      32           0 :         this->QTreeWidget::keyPressEvent(event);
      33             :     }
      34           0 : }

Generated by: LCOV version 1.15