How to debounce QLineEdit::textEdited signal
-
QObject::connect(xyz, &QLineEdit::textEdited, [this](const QString& text)
{
std::vector<int> intList = Parse(text);{ } });
-
textedited signal is emitted for every character typed. But i want the signal to be emitted after editing is complete and then I want to parse the text.
-
@JonB
I dont want to use editingFinished as the slot may differ. Also textEdited(const QString &) accepts args against editingFinished(). I guess with textEdited(const QString &) parsing would be easier@Shines said in How to debounce QLineEdit::textEdited signal:
I dont want to use editingFinished as the slot may differ
What do you mean? Why exactly can't you use this signal?
What is your definition of "editing finished"? -
@JonB
I dont want to use editingFinished as the slot may differ. Also textEdited(const QString &) accepts args against editingFinished(). I guess with textEdited(const QString &) parsing would be easier@Shines said in How to debounce QLineEdit::textEdited signal:
I dont want to use editingFinished as the slot may differ.
Don't know what this means. You do want to use
editingFinished
, even if you think you don't! As you saidBut i want the signal to be emitted after editing is complete
which is exactly what it does and what it's there for. And no you do not need the
const QString &
argument as you know where the text is to access it.Haven't we had just this conversation in another thread recently?