fix crash: CoinControl "space" bug

Just like baf80c26a2

Github-Pull: #5700
Rebased-From: 944c256741
This commit is contained in:
fsb4000 2015-01-23 20:01:07 +06:00 committed by Wladimir J. van der Laan
parent 58259ad1ed
commit ed4206acb1
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6

View File

@ -17,6 +17,7 @@ void CoinControlTreeWidget::keyPressEvent(QKeyEvent *event)
{ {
event->ignore(); event->ignore();
int COLUMN_CHECKBOX = 0; int COLUMN_CHECKBOX = 0;
if(this->currentItem())
this->currentItem()->setCheckState(COLUMN_CHECKBOX, ((this->currentItem()->checkState(COLUMN_CHECKBOX) == Qt::Checked) ? Qt::Unchecked : Qt::Checked)); this->currentItem()->setCheckState(COLUMN_CHECKBOX, ((this->currentItem()->checkState(COLUMN_CHECKBOX) == Qt::Checked) ? Qt::Unchecked : Qt::Checked));
} }
else if (event->key() == Qt::Key_Escape) // press esc -> close dialog else if (event->key() == Qt::Key_Escape) // press esc -> close dialog