ghorwin
9th July 2019, 11:02
Hi there,
just noticed an interesting behavior. When a QLineEdit is set to readonly, and it is focused and looses focus again, the editingFinished() signal is emitted. This is somewhat unexpected, since "readonly" means there won't be any editing, right?
The relevant code is in qlineedit.cpp:1895 (in Qt 5.11.3):
if (reason != Qt::PopupFocusReason
|| !(QApplication::activePopupWidget() && QApplication::activePopupWidget()->parentWidget() == this)) {
if (hasAcceptableInput() || d->control->fixup())
emit editingFinished();
}
The signal is emitted without checking the "readonly" state.
Is this expected behavior or should I post a bug-report?
-Andreas
just noticed an interesting behavior. When a QLineEdit is set to readonly, and it is focused and looses focus again, the editingFinished() signal is emitted. This is somewhat unexpected, since "readonly" means there won't be any editing, right?
The relevant code is in qlineedit.cpp:1895 (in Qt 5.11.3):
if (reason != Qt::PopupFocusReason
|| !(QApplication::activePopupWidget() && QApplication::activePopupWidget()->parentWidget() == this)) {
if (hasAcceptableInput() || d->control->fixup())
emit editingFinished();
}
The signal is emitted without checking the "readonly" state.
Is this expected behavior or should I post a bug-report?
-Andreas