Add a small delay before processing the key input of search boxes

PR #20465.
Closes #20025.
Closes #20235.
This commit is contained in:
Chocobo1
2024-02-27 12:57:55 +08:00
committed by GitHub
parent 46e8ee50c8
commit 15697f904d
14 changed files with 87 additions and 50 deletions

View File

@@ -31,6 +31,9 @@
#include <QLineEdit>
class QKeyEvent;
class QTimer;
class LineEdit final : public QLineEdit
{
Q_OBJECT
@@ -39,6 +42,11 @@ class LineEdit final : public QLineEdit
public:
explicit LineEdit(QWidget *parent = nullptr);
signals:
void textChanged(const QString &text);
private:
void keyPressEvent(QKeyEvent *event) override;
QTimer *m_delayedTextChangedTimer = nullptr;
};