MCPcopy Create free account
hub / github.com/KDE/kdevelop / eventFilter

Method eventFilter

plugins/projectfilter/projectfilterconfigpage.cpp:107–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107bool 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
126void ProjectFilterConfigPage::selectionChanged()
127{

Callers

nothing calls this directly

Calls 6

modifiersMethod · 0.80
eventFilterFunction · 0.50
typeMethod · 0.45
keyMethod · 0.45
isValidMethod · 0.45
currentIndexMethod · 0.45

Tested by

no test coverage detected