| 105 | } |
| 106 | |
| 107 | bool ProjectFilterConfigPage::eventFilter(QObject* object, QEvent* event) |
| 108 | { |
| 109 | if (object == m_ui->filters && event->type() == QEvent::KeyRelease) { |
| 110 | auto* key = static_cast<QKeyEvent*>(event); |
| 111 | if (key->key() == Qt::Key_Delete && key->modifiers() == Qt::NoModifier && m_ui->filters->currentIndex().isValid()) { |
| 112 | // workaround https://bugs.kde.org/show_bug.cgi?id=324451 |
| 113 | // there is no other way I see to figure out whether an editor is showing... |
| 114 | auto* editor = m_ui->filters->viewport()->findChild<QWidget*>(); |
| 115 | if (!editor || !editor->isVisible()) { |
| 116 | // editor is not showing |
| 117 | remove(); |
| 118 | return true; // eat event |
| 119 | } |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | return ProjectConfigPage::eventFilter(object, event); |
| 124 | } |
| 125 | |
| 126 | void ProjectFilterConfigPage::selectionChanged() |
| 127 | { |
nothing calls this directly
no test coverage detected