Skip to content

Commit 384d9c6

Browse files
authored
Remove unused LineEditWithButton::simulateReturnPressed() (#1040)
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
1 parent ebf5435 commit 384d9c6

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

rviz_common/include/rviz_common/properties/line_edit_with_button.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ class RVIZ_COMMON_PUBLIC LineEditWithButton : public QLineEdit
5757
protected:
5858
virtual void resizeEvent(QResizeEvent * event);
5959

60-
/** @brief Send key events to mimic the "return" key being pressed and
61-
* released. Useful ending an edit session and sending the data on
62-
* out. */
63-
void simulateReturnPressed();
64-
6560
protected Q_SLOTS:
6661
/** @brief Override this to do something when the button is clicked. */
6762
virtual void onButtonClick() {}

rviz_common/src/rviz_common/properties/line_edit_with_button.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,5 @@ void LineEditWithButton::resizeEvent(QResizeEvent * event)
7676
width() - button_width - padding, padding,
7777
button_width, button_height);
7878
}
79-
80-
void LineEditWithButton::simulateReturnPressed()
81-
{
82-
// I couldn't find a way to directly tell the editor that I was
83-
// done with it here. "Q_EMIT returnPressed()", "Q_EMIT
84-
// editingFinished()" etc did nothing. So instead, here I
85-
// simulate the user pressing and releasing the "Return" key,
86-
// which does indeed make it act like I want: when you select a
87-
// topic from the dialog and the dialog closes, the property's
88-
// Setter is called and this editor closes.
89-
QKeyEvent * event = new QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier);
90-
QApplication::postEvent(this, event);
91-
event = new QKeyEvent(QEvent::KeyRelease, Qt::Key_Return, Qt::NoModifier);
92-
QApplication::postEvent(this, event);
93-
}
94-
9579
} // namespace properties
9680
} // namespace rviz_common

0 commit comments

Comments
 (0)