From 2e2f67ced411506ba22cd08979e027f7dd2d0134 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Wed, 21 Nov 2018 20:12:21 +0800 Subject: [PATCH] TagPanel: clear text after pressing return in the completion list --- src/vtagpanel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vtagpanel.cpp b/src/vtagpanel.cpp index eb3c72d0..b59065c1 100644 --- a/src/vtagpanel.cpp +++ b/src/vtagpanel.cpp @@ -84,7 +84,9 @@ void VTagPanel::setupUI() g_mainWin->showStatusMessage(tr("Tag \"%1\" added").arg(text)); } - m_tagEdit->clear(); + // Clear after a wait since it may be triggered by the completion. + // The activated() of completion will add text to the edit. + QTimer::singleShot(100, m_tagEdit, SLOT(clear())); }); QValidator *validator = new QRegExpValidator(QRegExp("[^,]+"), m_tagEdit);