ConditionalFormatting Class

Conditional formatting for single cell or ranges More...

Header: #include <ConditionalFormatting>

Public Types

enum HighlightRuleType { Highlight_LessThan, Highlight_LessThanOrEqual, Highlight_Equal, Highlight_NotEqual, ..., Highlight_Expression }
enum ValueObjectType { VOT_Formula, VOT_Max, VOT_Min, VOT_Num, VOT_Percent, VOT_Percentile }

Public Functions

ConditionalFormatting()
ConditionalFormatting(const ConditionalFormatting & other)
~ConditionalFormatting()
bool add2ColorScaleRule(const QColor & minColor, const QColor & maxColor, bool stopIfTrue = false)
bool add3ColorScaleRule(const QColor & minColor, const QColor & midColor, const QColor & maxColor, bool stopIfTrue = false)
void addCell(const CellReference & cell)
void addCell(int row, int col)
bool addDataBarRule(const QColor & color, ValueObjectType type1, const QString & val1, ValueObjectType type2, const QString & val2, bool showData = true, bool stopIfTrue = false)
bool addDataBarRule(const QColor & color, bool showData = true, bool stopIfTrue = false)
bool addHighlightCellsRule(HighlightRuleType type, const QString & formula1, const QString & formula2, const Format & format, bool stopIfTrue = false)
bool addHighlightCellsRule(HighlightRuleType type, const Format & format, bool stopIfTrue = false)
bool addHighlightCellsRule(HighlightRuleType type, const QString & formula, const Format & format, bool stopIfTrue = false)
void addRange(const CellRange & range)
void addRange(int firstRow, int firstCol, int lastRow, int lastCol)
QList<CellRange> ranges() const
ConditionalFormatting & operator=(const ConditionalFormatting & other)

Detailed Description

Conditional formatting for single cell or ranges

The conditional formatting can be applied to a single cell or ranges of cells.

Member Type Documentation

enum ConditionalFormatting::HighlightRuleType

ConstantValue
ConditionalFormatting::Highlight_LessThan0
ConditionalFormatting::Highlight_LessThanOrEqual1
ConditionalFormatting::Highlight_Equal2
ConditionalFormatting::Highlight_NotEqual3
ConditionalFormatting::Highlight_GreaterThanOrEqual4
ConditionalFormatting::Highlight_GreaterThan5
ConditionalFormatting::Highlight_Between6
ConditionalFormatting::Highlight_NotBetween7
ConditionalFormatting::Highlight_ContainsText8
ConditionalFormatting::Highlight_NotContainsText9
ConditionalFormatting::Highlight_BeginsWith10
ConditionalFormatting::Highlight_EndsWith11
ConditionalFormatting::Highlight_TimePeriod12
ConditionalFormatting::Highlight_Duplicate13
ConditionalFormatting::Highlight_Unique14
ConditionalFormatting::Highlight_Blanks15
ConditionalFormatting::Highlight_NoBlanks16
ConditionalFormatting::Highlight_Errors17
ConditionalFormatting::Highlight_NoErrors18
ConditionalFormatting::Highlight_Top19
ConditionalFormatting::Highlight_TopPercent20
ConditionalFormatting::Highlight_Bottom21
ConditionalFormatting::Highlight_BottomPercent22
ConditionalFormatting::Highlight_AboveAverage23
ConditionalFormatting::Highlight_AboveOrEqualAverage24
ConditionalFormatting::Highlight_BelowAverage28
ConditionalFormatting::Highlight_BelowOrEqualAverage29
ConditionalFormatting::Highlight_AboveStdDev125
ConditionalFormatting::Highlight_AboveStdDev226
ConditionalFormatting::Highlight_AboveStdDev327
ConditionalFormatting::Highlight_BelowStdDev130
ConditionalFormatting::Highlight_BelowStdDev231
ConditionalFormatting::Highlight_BelowStdDev332
ConditionalFormatting::Highlight_Expression33

enum ConditionalFormatting::ValueObjectType

ConstantValue
ConditionalFormatting::VOT_Formula0
ConditionalFormatting::VOT_Max1
ConditionalFormatting::VOT_Min2
ConditionalFormatting::VOT_Num3
ConditionalFormatting::VOT_Percent4
ConditionalFormatting::VOT_Percentile5

Member Function Documentation

ConditionalFormatting::ConditionalFormatting()

Construct a conditional formatting object

ConditionalFormatting::ConditionalFormatting(const ConditionalFormatting & other)

Constructs a copy of other.

ConditionalFormatting::~ConditionalFormatting()

Destroy the object.

bool ConditionalFormatting::add2ColorScaleRule(const QColor & minColor, const QColor & maxColor, bool stopIfTrue = false)

Add a colorScale rule with the given minColor, maxColor and stopIfTrue. Return false if failed.

bool ConditionalFormatting::add3ColorScaleRule(const QColor & minColor, const QColor & midColor, const QColor & maxColor, bool stopIfTrue = false)

Add a colorScale rule with the given minColor, midColor, maxColor and stopIfTrue. Return false if failed.

void ConditionalFormatting::addCell(const CellReference & cell)

Add the cell on which the conditional formatting will apply to.

void ConditionalFormatting::addCell(int row, int col)

This is an overloaded function.

Add the cell(row, col) on which the conditional formatting will apply to.

bool ConditionalFormatting::addDataBarRule(const QColor & color, ValueObjectType type1, const QString & val1, ValueObjectType type2, const QString & val2, bool showData = true, bool stopIfTrue = false)

Add a dataBar rule with the given color, type1, val1 , type2, val2, showData and stopIfTrue. Return false if failed.

bool ConditionalFormatting::addDataBarRule(const QColor & color, bool showData = true, bool stopIfTrue = false)

This is an overloaded function.

Add a dataBar rule with the given color, showData and stopIfTrue.

bool ConditionalFormatting::addHighlightCellsRule(HighlightRuleType type, const QString & formula1, const QString & formula2, const Format & format, bool stopIfTrue = false)

Add a hightlight rule with the given type, formula1, formula2, format and stopIfTrue. Return false if failed.

bool ConditionalFormatting::addHighlightCellsRule(HighlightRuleType type, const Format & format, bool stopIfTrue = false)

This is an overloaded function.

Add a hightlight rule with the given type format and stopIfTrue.

bool ConditionalFormatting::addHighlightCellsRule(HighlightRuleType type, const QString & formula, const Format & format, bool stopIfTrue = false)

This is an overloaded function.

Add a hightlight rule with the given type, formula, format and stopIfTrue. Return false if failed.

void ConditionalFormatting::addRange(const CellRange & range)

Add the range on which the conditional formatting will apply to.

void ConditionalFormatting::addRange(int firstRow, int firstCol, int lastRow, int lastCol)

This is an overloaded function.

Add the range(firstRow, firstCol, lastRow, lastCol) on which the conditional formatting will apply to.

QList<CellRange> ConditionalFormatting::ranges() const

Returns the ranges on which the validation will be applied.

ConditionalFormatting & ConditionalFormatting::operator=(const ConditionalFormatting & other)

Assigns other to this conditional formatting and returns a reference to this conditional formatting.