0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-09-23 08:29:07 +03:00

useAlternateBackgroundColor property has been added

This commit is contained in:
Arin Alexander
2017-03-04 00:21:21 +03:00
parent 4c6c0dfd3b
commit 242dbe75d2
6 changed files with 58 additions and 12 deletions

View File

@@ -79,6 +79,23 @@ bool DataBand::isUnique() const
return false;
}
void DataBand::preparePopUpMenu(QMenu &menu)
{
DataBandDesignIntf::preparePopUpMenu(menu);
QAction* autoSplittableAction = menu.addAction(tr("useAlternateBackgroundColor"));
autoSplittableAction->setCheckable(true);
autoSplittableAction->setChecked(useAlternateBackgroundColor());
}
void DataBand::processPopUpAction(QAction *action)
{
DataBandDesignIntf::processPopUpAction(action);
if (action->text().compare(tr("useAlternateBackgroundColor")) == 0){
setProperty("useAlternateBackgroundColor",action->isChecked());
}
}
QColor DataBand::bandColor() const
{
return QColor(Qt::darkGreen);

View File

@@ -48,10 +48,13 @@ class DataBand : public DataBandDesignIntf
Q_PROPERTY(bool startNewPage READ startNewPage WRITE setStartNewPage)
Q_PROPERTY(bool startFromNewPage READ startFromNewPage WRITE setStartFromNewPage)
Q_PROPERTY(QColor alternateBackgroundColor READ alternateBackgroundColor WRITE setAlternateBackgroundColor)
Q_PROPERTY(bool useAlternateBackgroundColor READ useAlternateBackgroundColor WRITE setUseAlternateBackgroundColor)
public:
DataBand(QObject* owner = 0, QGraphicsItem* parent=0);
bool isUnique() const;
bool isData() const {return true;}
void preparePopUpMenu(QMenu &menu);
void processPopUpAction(QAction *action);
protected:
QColor bandColor() const;
private:
@@ -82,7 +85,7 @@ class DataFooterBand : public BandDesignIntf
Q_OBJECT
Q_PROPERTY(int columnsCount READ columnsCount WRITE setColumnsCount)
Q_PROPERTY(BandColumnsLayoutType columnsFillDirection READ columnsFillDirection WRITE setColumnsFillDirection)
Q_PROPERTY(bool printAlways READ printAlways() WRITE setPrintAlways())
Q_PROPERTY(bool printAlways READ printAlways WRITE setPrintAlways)
public:
DataFooterBand(QObject* owner=0, QGraphicsItem* parent=0);
bool isUnique() const {return false;}

View File

@@ -43,6 +43,7 @@ class SubDetailBand : public DataBandDesignIntf
Q_PROPERTY(BandColumnsLayoutType columnsFillDirection READ columnsFillDirection WRITE setColumnsFillDirection)
Q_PROPERTY(bool keepFooterTogether READ keepFooterTogether WRITE setKeepFooterTogether)
Q_PROPERTY(QColor alternateBackgroundColor READ alternateBackgroundColor WRITE setAlternateBackgroundColor)
Q_PROPERTY(bool useAlternateBackgroundColor READ useAlternateBackgroundColor WRITE setUseAlternateBackgroundColor)
public:
SubDetailBand(QObject* owner = 0, QGraphicsItem* parent=0);
bool isUnique() const {return false;}