mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-29 23:40:04 -06:00
A new dialog for editing conditional formats that can be invoked from the filter line editor or from the data browser contextual menus. The dialog allows adding and removing conditional formats, changing the priority order and editing foreground colour, background colour and filter condition. The conditional formats have been expanded to allow defining the foreground colour. By default is the setting configured by user. This is a continuation of the functionality introduced in PR #1503.
45 lines
988 B
C++
45 lines
988 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);
|
|
void addFilterAsCondFormat(QString text);
|
|
void clearAllCondFormats();
|
|
void editCondFormats();
|
|
|
|
protected:
|
|
void keyReleaseEvent(QKeyEvent* event) override;
|
|
void setFilterHelper(const QString& filterOperator, const QString& operatorSuffix = "");
|
|
|
|
private:
|
|
QList<FilterLineEdit*>* filterList;
|
|
int columnNumber;
|
|
QTimer* delaySignalTimer;
|
|
QString lastValue;
|
|
|
|
private slots:
|
|
void showContextMenu(const QPoint &pos);
|
|
};
|
|
|
|
#endif
|