forked from sqlitebrowser/sqlitebrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCondFormat.h
More file actions
30 lines (23 loc) · 819 Bytes
/
CondFormat.h
File metadata and controls
30 lines (23 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef CONDFORMAT_H
#define CONDFORMAT_H
#include <QString>
#include <QColor>
// Conditional formatting for given format to table cells based on a specified condition.
class CondFormat
{
public:
CondFormat() {}
explicit CondFormat(const QString& filter, const QColor& foreground, const QColor& background, const QString& encoding = QString());
static QString filterToSqlCondition(const QString& value, const QString& encoding = QString());
private:
QString m_sqlCondition;
QString m_filter;
QColor m_bgColor;
QColor m_fgColor;
public:
QString sqlCondition() const { return m_sqlCondition; }
QString filter() const { return m_filter; }
QColor backgroundColor() const { return m_bgColor; }
QColor foregroundColor() const { return m_fgColor; }
};
#endif // CONDFORMAT_H