mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
When changing a filter value delay the application of the new value on the table for a couple of milliseconds. This makes the filter process much smoother for fast typing users working on large tables. See issue #415.
37 lines
696 B
C++
37 lines
696 B
C++
#ifndef FILTERLINEEDIT_H
|
|
#define FILTERLINEEDIT_H
|
|
|
|
#include <QLineEdit>
|
|
#include <QList>
|
|
|
|
class QTimer;
|
|
class QKeyEvent;
|
|
|
|
class FilterLineEdit : public QLineEdit
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit FilterLineEdit(QWidget* parent, QList<FilterLineEdit*>* filters, int columnnum);
|
|
|
|
// Override methods for programatically changing the value of the line edit
|
|
void clear();
|
|
void setText(const QString& text);
|
|
|
|
private slots:
|
|
void delayedSignalTimerTriggered();
|
|
|
|
signals:
|
|
void delayedTextChanged(QString text);
|
|
|
|
protected:
|
|
void keyReleaseEvent(QKeyEvent* event);
|
|
|
|
private:
|
|
QList<FilterLineEdit*>* filterList;
|
|
int columnNumber;
|
|
QTimer* delaySignalTimer;
|
|
};
|
|
|
|
#endif
|