MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / eventFilter

Method eventFilter

src/qt/transactionview.cpp:601–618  ·  view source on GitHub ↗

Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text

Source from the content-addressed store, hash-verified

599
600// Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text
601bool TransactionView::eventFilter(QObject *obj, QEvent *event)
602{
603 if (event->type() == QEvent::KeyPress)
604 {
605 QKeyEvent *ke = static_cast<QKeyEvent *>(event);
606 if (ke->key() == Qt::Key_C && ke->modifiers().testFlag(Qt::ControlModifier))
607 {
608 GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxPlainTextRole);
609 return true;
610 }
611 }
612 if (event->type() == QEvent::EnabledChange) {
613 if (!isEnabled()) {
614 closeOpenedDialogs();
615 }
616 }
617 return QWidget::eventFilter(obj, event);
618}
619
620void TransactionView::closeOpenedDialogs()
621{

Callers

nothing calls this directly

Calls 3

copyEntryDataFunction · 0.85
typeMethod · 0.80
keyMethod · 0.45

Tested by

no test coverage detected