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

Method eventFilter

pj_plotting/widget/src/DockToolbar.cpp:137–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137bool DockToolbar::eventFilter(QObject* object, QEvent* event) {
138 if (object == ui_->label && event->type() == QEvent::MouseButtonDblClick) {
139 enterRenameMode();
140 return true;
141 }
142 if (object == ui_->lineEditRename) {
143 // Match the tab-rename UX: focus loss reverts; only Enter (returnPressed)
144 // commits. Escape reverts explicitly.
145 if (event->type() == QEvent::FocusOut) {
146 cancelRename();
147 } else if (event->type() == QEvent::KeyPress && static_cast<QKeyEvent*>(event)->key() == Qt::Key_Escape) {
148 cancelRename();
149 return true;
150 }
151 }
152 return QObject::eventFilter(object, event);
153}
154
155void DockToolbar::enterRenameMode() {
156 if (rename_active_) {

Callers

nothing calls this directly

Calls 2

eventFilterFunction · 0.85
typeMethod · 0.45

Tested by

no test coverage detected