mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-31 00:09:58 -06:00
Formats conditioned to row-id values to allow free cell formatting
The conditional formatting is extended to cover free single-cell formatting. The row-id formats have precedence over regular conditional formats. In the styling toolbar, when single cells are selected, row-id formats are created or updated. When entire columns are selected, regular conditional formats are instead. Clearing formats for entire columns, remove both. For single cells, only corresponding row-id formats. New row-id formats are also saved to project files and loaded. See issue #1976
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
#include <QString>
|
||||
#include <QColor>
|
||||
#include <QFont>
|
||||
#include <QModelIndex>
|
||||
|
||||
class QAbstractTableModel;
|
||||
|
||||
// Conditional formatting for given format to table cells based on a specified condition.
|
||||
class CondFormat
|
||||
@@ -27,12 +30,18 @@ public:
|
||||
static Alignment fromCombinedAlignment(Qt::Alignment align);
|
||||
|
||||
CondFormat() {}
|
||||
explicit CondFormat(const QString& filter,
|
||||
const QColor& foreground,
|
||||
const QColor& background,
|
||||
const QFont& font,
|
||||
const Alignment alignment = AlignLeft,
|
||||
const QString& encoding = QString());
|
||||
CondFormat(const QString& filter,
|
||||
const QColor& foreground,
|
||||
const QColor& background,
|
||||
const QFont& font,
|
||||
const Alignment alignment = AlignLeft,
|
||||
const QString& encoding = QString());
|
||||
|
||||
// Create a new CondFormat from values obtained from the model
|
||||
CondFormat(const QString& filter,
|
||||
const QAbstractTableModel* model,
|
||||
const QModelIndex index,
|
||||
const QString& encoding = QString());
|
||||
|
||||
static QString filterToSqlCondition(const QString& value, const QString& encoding = QString());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user