mirror of
https://github.com/fralx/LimeReport.git
synced 2025-10-29 04:36:56 +03:00
Merge branch 'develop' into feature/newScaleMethod
# Conflicts: # common.pri # limereport/lrbanddesignintf.cpp # limereport/lrbanddesignintf.h # limereport/lrbasedesignintf.cpp # limereport/lrbasedesignintf.h # limereport/lrpageitemdesignintf.h
This commit is contained in:
@@ -28,6 +28,8 @@ void HorizontalBarChart::paintChart(QPainter *painter, QRectF chartRect)
|
||||
|
||||
void HorizontalBarChart::paintHorizontalBars(QPainter *painter, QRectF barsRect)
|
||||
{
|
||||
if (seriesCount() == 0) return;
|
||||
|
||||
painter->save();
|
||||
painter->setRenderHint(QPainter::Antialiasing,false);
|
||||
int delta = int(maxValue()-minValue());
|
||||
|
||||
@@ -65,6 +65,8 @@ void LinesChart::drawDesignMode(QPainter* painter, qreal hStep, qreal vStep, qre
|
||||
|
||||
void LinesChart::paintSerialLines(QPainter* painter, QRectF barsRect)
|
||||
{
|
||||
if (valuesCount() == 0) return;
|
||||
|
||||
painter->save();
|
||||
painter->setRenderHint(QPainter::Antialiasing,true);
|
||||
int delta = int(maxValue() - minValue());
|
||||
|
||||
@@ -70,7 +70,7 @@ void PieChart::paintChart(QPainter *painter, QRectF chartRect)
|
||||
drawPercent(painter, chartRect, currentDegree, sectorDegree);
|
||||
currentDegree += sectorDegree;
|
||||
}
|
||||
} else {
|
||||
} else if (m_chartItem->itemMode() == DesignMode){
|
||||
painter->setBrush(color_map[0]);
|
||||
painter->drawPie(chartRect,0,260*16);
|
||||
drawPercent(painter, chartRect, 0, 260);
|
||||
@@ -122,7 +122,7 @@ void PieChart::paintChartLegend(QPainter *painter, QRectF legendRect)
|
||||
);
|
||||
cw += painter->fontMetrics().height();
|
||||
}
|
||||
} else {
|
||||
} else if (m_chartItem->itemMode() == DesignMode){
|
||||
qreal cw = 0;
|
||||
for (int i=0;i<m_designLabels.size();++i){
|
||||
QString label = m_designLabels.at(i);
|
||||
|
||||
@@ -47,6 +47,8 @@ void VerticalBarChart::paintChart(QPainter *painter, QRectF chartRect)
|
||||
void VerticalBarChart::paintVerticalBars(QPainter *painter, QRectF barsRect)
|
||||
{
|
||||
|
||||
if (valuesCount() == 0) return;
|
||||
|
||||
int delta = int(maxValue() - minValue());
|
||||
delta = genNextValue(delta);
|
||||
|
||||
@@ -64,6 +66,8 @@ void VerticalBarChart::paintVerticalBars(QPainter *painter, QRectF barsRect)
|
||||
qreal hStep = (barsRect.width() / valuesCount()) / (barSeriesCount == 0 ? 1 : barSeriesCount);
|
||||
qreal topShift = (delta - (maxValue() - minValue())) * vStep + barsRect.top();
|
||||
|
||||
qDebug() << "vStep" << vStep << "hStep" << hStep;
|
||||
|
||||
if (!m_chartItem->series().isEmpty() && (m_chartItem->itemMode() != DesignMode)){
|
||||
int curSeries = 0;
|
||||
foreach (SeriesItem* series, m_chartItem->series()) {
|
||||
@@ -93,6 +97,8 @@ void VerticalBarChart::paintVerticalBars(QPainter *painter, QRectF barsRect)
|
||||
|
||||
void VerticalBarChart::paintSerialLines(QPainter* painter, QRectF barsRect)
|
||||
{
|
||||
if (valuesCount() == 0 ) return;
|
||||
|
||||
painter->save();
|
||||
painter->setRenderHint(QPainter::Antialiasing,true);
|
||||
int delta = int(maxValue() - minValue());
|
||||
|
||||
@@ -160,7 +160,10 @@ QString AlignmentItemEditor::displayValue() const
|
||||
|
||||
void AlignmentItemEditor::setPropertyValue(QVariant value)
|
||||
{
|
||||
ObjectPropItem::setPropertyValue(extractAcceptableValue(value.toInt())[0]);
|
||||
QVector<int> _accpepttableValueList= extractAcceptableValue(value.toInt());
|
||||
if(_accpepttableValueList.isEmpty()) return;
|
||||
|
||||
ObjectPropItem::setPropertyValue(_accpepttableValueList[0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -333,6 +333,13 @@ bool BarcodeItem::isEmpty() const
|
||||
return m_content.isEmpty();
|
||||
}
|
||||
|
||||
void BarcodeItem::expandContent(QString data, DataSourceManager* dataManager, RenderPass pass)
|
||||
{
|
||||
setContent(expandUserVariables(data, pass, NoEscapeSymbols, dataManager));
|
||||
setContent(expandScripts(content(), dataManager));
|
||||
setContent(expandDataFields(content(), NoEscapeSymbols, dataManager));
|
||||
}
|
||||
|
||||
void BarcodeItem::updateItemSize(DataSourceManager* dataManager, RenderPass pass, int maxHeight)
|
||||
{
|
||||
if (content().isEmpty())
|
||||
@@ -346,21 +353,19 @@ void BarcodeItem::updateItemSize(DataSourceManager* dataManager, RenderPass pass
|
||||
if (data.isValid())
|
||||
{
|
||||
switch(pass)
|
||||
{
|
||||
case FirstPass:
|
||||
setContent(expandUserVariables(data.toString(),pass,NoEscapeSymbols, dataManager));
|
||||
setContent(expandDataFields(data.toString(), NoEscapeSymbols, dataManager));
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
{
|
||||
case FirstPass:
|
||||
expandContent(data.toString(), dataManager, pass);
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
switch(pass){
|
||||
case FirstPass:
|
||||
setContent(expandUserVariables(content(),pass,NoEscapeSymbols, dataManager));
|
||||
setContent(expandDataFields(content(), NoEscapeSymbols, dataManager));
|
||||
expandContent(content(), dataManager, pass);
|
||||
break;
|
||||
default:;
|
||||
}
|
||||
|
||||
@@ -191,20 +191,19 @@ public:
|
||||
void setSecurityLevel(int securityLevel);
|
||||
int pdf417CodeWords() const;
|
||||
void setPdf417CodeWords(int pdf417CodeWords);
|
||||
|
||||
InputMode inputMode() const;
|
||||
void setInputMode(const InputMode &inputMode);
|
||||
|
||||
bool hideText() const;
|
||||
void setHideText(bool hideText);
|
||||
|
||||
int option3() const;
|
||||
void setOption3(int option3);
|
||||
|
||||
bool hideIfEmpty() const;
|
||||
void setHideIfEmpty(bool hideIfEmpty);
|
||||
bool isEmpty() const;
|
||||
|
||||
private:
|
||||
void expandContent(QString data, DataSourceManager *dataManager, RenderPass pass);
|
||||
|
||||
private:
|
||||
QString m_content;
|
||||
QString m_datasource;
|
||||
|
||||
@@ -584,7 +584,10 @@ QSizeF AbstractSeriesChart::calcChartLegendSize(const QFont &font)
|
||||
return QSizeF(maxWidth+fm.height()*2,cw);
|
||||
}
|
||||
|
||||
bool AbstractSeriesChart::verticalLabels(QPainter* painter, QRectF labelsRect){
|
||||
bool AbstractSeriesChart::verticalLabels(QPainter* painter, QRectF labelsRect)
|
||||
{
|
||||
if (valuesCount() == 0) return false;
|
||||
|
||||
qreal hStep = (labelsRect.width() / valuesCount());
|
||||
QFontMetrics fm = painter->fontMetrics();
|
||||
foreach(QString label, m_chartItem->labels()){
|
||||
@@ -597,6 +600,8 @@ bool AbstractSeriesChart::verticalLabels(QPainter* painter, QRectF labelsRect){
|
||||
|
||||
void AbstractSeriesChart::paintHorizontalLabels(QPainter *painter, QRectF labelsRect)
|
||||
{
|
||||
if (valuesCount() == 0) return;
|
||||
|
||||
painter->save();
|
||||
qreal hStep = (labelsRect.width() / valuesCount());
|
||||
if (!m_chartItem->labels().isEmpty()){
|
||||
@@ -623,6 +628,8 @@ void AbstractSeriesChart::paintHorizontalLabels(QPainter *painter, QRectF labels
|
||||
|
||||
void AbstractSeriesChart::paintVerticalLabels(QPainter *painter, QRectF labelsRect)
|
||||
{
|
||||
if (valuesCount() == 0) return;
|
||||
|
||||
painter->save();
|
||||
painter->setFont(adaptLabelsFont(labelsRect.adjusted(0, 0, -hPadding(m_chartItem->rect()), 0),
|
||||
painter->font()));
|
||||
@@ -771,7 +778,7 @@ void AbstractBarChart::paintChartLegend(QPainter *painter, QRectF legendRect)
|
||||
);
|
||||
cw += painter->fontMetrics().height();
|
||||
}
|
||||
} else {
|
||||
} else if (m_chartItem->itemMode() == DesignMode){
|
||||
qreal cw = 0;
|
||||
for (int i=0;i<m_designLabels.size();++i){
|
||||
QString label = m_designLabels.at(i);
|
||||
|
||||
@@ -116,20 +116,14 @@ BaseDesignIntf* VerticalLayout::cloneBottomPart(int height, QObject* owner, QGra
|
||||
bottomPart->initFromItem(this);
|
||||
|
||||
foreach(BaseDesignIntf* item,childBaseItems()){
|
||||
if ((item->geometry().top() < height) && ( item->geometry().bottom() > height )){
|
||||
if (item->geometry().bottom() > height){
|
||||
int sliceHeight = height - item->geometry().top();
|
||||
if (item->canBeSplitted(sliceHeight)){
|
||||
if ((item->geometry().top() < height) && (item->canBeSplitted(sliceHeight))){
|
||||
BaseDesignIntf* tmpItem = item->cloneBottomPart(sliceHeight, bottomPart, bottomPart);
|
||||
tmpItem->setPos(tmpItem->pos().x(),0);
|
||||
tmpItem->setHeight(sliceHeight);
|
||||
bottomPart->addChild(tmpItem);
|
||||
} else {
|
||||
item->cloneItem(item->itemMode(), bottomPart, bottomPart);
|
||||
item->setPos(item->pos().x(), 0);
|
||||
}
|
||||
} else {
|
||||
if (item->geometry().top() >= height){
|
||||
BaseDesignIntf* tmpItem = item->cloneItem(item->itemMode(), bottomPart, bottomPart);
|
||||
tmpItem->setPos(item->pos().x(), item->pos().y() - height);
|
||||
bottomPart->addChild(item->cloneItem(item->itemMode(), bottomPart, bottomPart));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user