mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 18:40:13 -06:00
Added contextual menus in filter line box and cells for assisting in using filters and for discovering existing filters. The menu in the filter line adds "What's This" option and helper options that add the operator and a selected placeholder (?) for easy editing. Special options for NULL and empty strings are also added. Those work directly. The menu in the cells works as the current "Use as Filter" but for different operators. In this case, only the range operator is incomplete. Currently, not all the operators make sense for strings because we take them as LIKE filters. At least the Not Equal filter (<>) should work, but the other would also make sense. This will be addressed in future commits.
42 lines
837 B
C++
42 lines
837 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);
|
|
void setFilterHelper(const QString& filterOperator);
|
|
|
|
private:
|
|
QList<FilterLineEdit*>* filterList;
|
|
int columnNumber;
|
|
QTimer* delaySignalTimer;
|
|
QString lastValue;
|
|
|
|
private slots:
|
|
void showContextMenu(const QPoint &pos);
|
|
};
|
|
|
|
#endif
|