mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 00:33:02 +03:00
Ruler has been fixed
This commit is contained in:
parent
ac154dbc03
commit
69369e3b0c
@ -18,7 +18,6 @@ public slots:
|
||||
QLocale::Language getCurrentDefaultLanguage();
|
||||
void currentDefaultLanguageChanged(QLocale::Language language);
|
||||
private:
|
||||
QApplication* m_app;
|
||||
QSettings* m_setting;
|
||||
};
|
||||
|
||||
|
@ -49,7 +49,7 @@ BarcodeItem::BarcodeItem(QObject* owner,QGraphicsItem* parent)
|
||||
: ContentItemDesignIntf(xmlTag,owner,parent),m_designTestValue("1"), m_barcodeType(CODE128),
|
||||
m_foregroundColor(Qt::black), m_backgroundColor(Qt::white), m_whitespace(10), m_angle(Angle0),
|
||||
m_barcodeWidth(0), m_securityLevel(0), m_pdf417CodeWords(928), m_inputMode(UNICODE_INPUT_MODE),
|
||||
m_option3(0)
|
||||
m_hideText(false), m_option3(0)
|
||||
{}
|
||||
|
||||
BarcodeItem::~BarcodeItem()
|
||||
|
@ -515,7 +515,6 @@ void PieChart::paintChart(QPainter *painter, QRectF chartRect)
|
||||
}
|
||||
qreal onePercent = sum / 100;
|
||||
qreal currentDegree = 0;
|
||||
int currentColor = 0;
|
||||
for(int i=0; i<si->data()->values().count(); ++i){
|
||||
qreal value = si->data()->values().at(i);
|
||||
qreal sectorDegree = (value/onePercent)*3.6;
|
||||
@ -523,7 +522,6 @@ void PieChart::paintChart(QPainter *painter, QRectF chartRect)
|
||||
painter->drawPie(chartRect,currentDegree*16,sectorDegree*16);
|
||||
drawPercent(painter, chartRect, currentDegree, sectorDegree);
|
||||
currentDegree += sectorDegree;
|
||||
currentColor++;
|
||||
}
|
||||
} else {
|
||||
painter->setBrush(color_map[0]);
|
||||
@ -768,7 +766,6 @@ void VerticalBarChart::paintSerialLines(QPainter* painter, QRectF barsRect)
|
||||
qreal topShift = (delta - (maxValue()-minValue())) * vStep +barsRect.top();
|
||||
|
||||
if (!m_chartItem->series().isEmpty() && !m_chartItem->series().at(0)->data()->labels().isEmpty()){
|
||||
int curSeries = 0;
|
||||
foreach (SeriesItem* series, m_chartItem->series()) {
|
||||
if (series->preferredType() == SeriesItem::Line){
|
||||
QPen pen(series->color());
|
||||
@ -791,7 +788,6 @@ void VerticalBarChart::paintSerialLines(QPainter* painter, QRectF barsRect)
|
||||
|
||||
}
|
||||
}
|
||||
curSeries++;
|
||||
}
|
||||
}
|
||||
painter->restore();
|
||||
@ -803,7 +799,6 @@ void VerticalBarChart::paintLabels(QPainter *painter, QRectF labelsRect)
|
||||
{
|
||||
painter->save();
|
||||
qreal hStep = (labelsRect.width() / valuesCount());
|
||||
int curLabel = 0;
|
||||
|
||||
if (!m_chartItem->labels().isEmpty()){
|
||||
painter->rotate(270);
|
||||
@ -811,7 +806,6 @@ void VerticalBarChart::paintLabels(QPainter *painter, QRectF labelsRect)
|
||||
foreach (QString label, m_chartItem->labels()) {
|
||||
painter->drawText(QRectF(QPoint(0,0),
|
||||
QSize(labelsRect.height()-4,hStep)),Qt::AlignVCenter|Qt::AlignRight,label);
|
||||
curLabel++;
|
||||
painter->translate(0,hStep);
|
||||
}
|
||||
painter->rotate(-270);
|
||||
|
@ -134,8 +134,8 @@ BaseDesignIntf* VerticalLayout::cloneBottomPart(int height, QObject* owner, QGra
|
||||
}
|
||||
}
|
||||
|
||||
int currentHeight = 0;
|
||||
if (!bottomPart->isEmpty()){
|
||||
int currentHeight = 0;
|
||||
foreach (BaseDesignIntf* item, bottomPart->childBaseItems()) {
|
||||
currentHeight+=item->height();
|
||||
}
|
||||
|
@ -662,7 +662,6 @@ BaseDesignIntf* BandDesignIntf::cloneUpperPart(int height, QObject *owner, QGrap
|
||||
}
|
||||
}
|
||||
upperPart->setHeight(height);
|
||||
height = maxBottom;
|
||||
return upperPart;
|
||||
}
|
||||
|
||||
|
@ -718,10 +718,10 @@ QVariant CallbackDatasource::dataByRowIndex(const QString &columnName, int rowIn
|
||||
QVariant CallbackDatasource::dataByKeyField(const QString& columnName, const QString& keyColumnName, QVariant keyData)
|
||||
{
|
||||
int backupCurrentRow = m_currentRow;
|
||||
int currentRow = 0;
|
||||
QVariant result = QVariant();
|
||||
first();
|
||||
if (!checkIfEmpty()){
|
||||
int currentRow = 0;
|
||||
do {
|
||||
QVariant key = callbackData(keyColumnName, currentRow);
|
||||
if (key == keyData){
|
||||
|
@ -485,8 +485,8 @@ QString DataSourceManager::replaceVariables(QString query, QMap<QString,QString>
|
||||
QString DataSourceManager::replaceFields(QString query, QMap<QString,QString> &aliasesToParam, QString masterDatasource)
|
||||
{
|
||||
QRegExp rx(Const::FIELD_RX);
|
||||
int curentAliasIndex=0;
|
||||
if (query.contains(rx)){
|
||||
int curentAliasIndex=0;
|
||||
int pos;
|
||||
while ((pos=rx.indexIn(query))!=-1){
|
||||
QString field=rx.cap(0);
|
||||
@ -719,7 +719,7 @@ void DataSourceManager::removeConnection(const QString &connectionName)
|
||||
delete (*cit);
|
||||
cit = m_connections.erase(cit);
|
||||
} else {
|
||||
cit++;
|
||||
++cit;
|
||||
}
|
||||
}
|
||||
m_hasChanges = true;
|
||||
|
@ -118,9 +118,8 @@ QVariant GroupFunction::multiplication(QVariant value1, QVariant value2)
|
||||
}
|
||||
|
||||
GroupFunction::GroupFunction(const QString &expression, const QString &dataBandName, DataSourceManager* dataManager)
|
||||
:m_dataBandName(dataBandName), m_dataManager(dataManager),m_isValid(true), m_errorMessage("")
|
||||
:m_data(expression), m_dataBandName(dataBandName), m_dataManager(dataManager), m_isValid(true), m_errorMessage("")
|
||||
{
|
||||
m_data = expression;
|
||||
QRegExp rxField(Const::FIELD_RX,Qt::CaseInsensitive);
|
||||
QRegExp rxVariable(Const::VARIABLE_RX,Qt::CaseInsensitive);
|
||||
QRegExp rxScript(Const::SCRIPT_RX,Qt::CaseInsensitive);
|
||||
|
@ -1334,9 +1334,9 @@ BaseDesignIntf* PageDesignIntf::findDestObject(BaseDesignIntf* item){
|
||||
void PageDesignIntf::paste()
|
||||
{
|
||||
QClipboard *clipboard = QApplication::clipboard();
|
||||
BaseDesignIntf* destItem = 0;
|
||||
ItemsReaderIntf::Ptr reader = StringXMLreader::create(clipboard->text());
|
||||
if (reader->first() && reader->itemType() == "Object"){
|
||||
BaseDesignIntf* destItem = 0;
|
||||
if (!selectedItems().isEmpty())
|
||||
destItem = findDestObject(dynamic_cast<BaseDesignIntf*>(selectedItems().at(0)));
|
||||
else
|
||||
|
@ -778,7 +778,6 @@ void PageItemDesignIntf::swapBands(BandDesignIntf* band, BandDesignIntf* bandToS
|
||||
BandDesignIntf* firstMoveBand = (bandToSwap->bandIndex() > band->bandIndex()) ? bandToSwap: band;
|
||||
|
||||
firstMoveBand->changeBandIndex(firstIndex, true);
|
||||
moveIndex = firstMoveBand->maxChildIndex() + 1;
|
||||
moveIndex = firstIndex;
|
||||
qSort(bandToMove.begin(), bandToMove.end(), bandIndexLessThen);
|
||||
|
||||
|
@ -1119,7 +1119,7 @@ void Ruler::paintEvent(QPaintEvent *event){
|
||||
QString::number(i));
|
||||
}
|
||||
}
|
||||
painter.setPen(Qt::black);
|
||||
painter.setPen(palette().foreground().color());
|
||||
painter.drawLine(m_mousePos.x() - (hStartPos > 0 ? hStartPos : 0) , 0,
|
||||
m_mousePos.x() - (hStartPos > 0 ? hStartPos : 0) , 20);
|
||||
break;
|
||||
@ -1148,7 +1148,7 @@ void Ruler::paintEvent(QPaintEvent *event){
|
||||
painter.drawLine(10, vs5, 20, vs5);
|
||||
}
|
||||
}
|
||||
painter.setPen(Qt::black);
|
||||
painter.setPen(palette().foreground().color());
|
||||
painter.drawLine(0, m_mousePos.y() - (vStartPos > 0 ? vStartPos : 0),
|
||||
20, m_mousePos.y() - (vStartPos > 0 ? vStartPos : 0));
|
||||
break;
|
||||
|
@ -514,6 +514,7 @@ bool ReportEnginePrivate::showPreviewWindow(ReportPages pages, PreviewHints hint
|
||||
w->setSettings(settings());
|
||||
w->setPages(pages);
|
||||
w->setLayoutDirection(m_previewLayoutDirection);
|
||||
w->setStyleSheet(styleSheet());
|
||||
|
||||
if (!dataManager()->errorsList().isEmpty()){
|
||||
w->setErrorMessages(dataManager()->errorsList());
|
||||
|
@ -901,7 +901,7 @@ void ReportRender::closeGroup(BandDesignIntf *band)
|
||||
bl->clear();
|
||||
delete bl;
|
||||
}
|
||||
it++;
|
||||
++it;
|
||||
}
|
||||
|
||||
m_childBands.remove(band);
|
||||
@ -931,7 +931,7 @@ void ReportRender::closeDataGroup(BandDesignIntf *band)
|
||||
if ((*it)->bandIndex()>band->bandIndex())
|
||||
it = m_reprintableBands.erase(it);
|
||||
else
|
||||
it++;
|
||||
++it;
|
||||
}
|
||||
}
|
||||
recalcIfNeeded(band);
|
||||
@ -1573,7 +1573,7 @@ void PagesRanges::addTOCPage()
|
||||
if (tocRange.firstPage == 0) {
|
||||
tocRange.firstPage = tocRange.lastPage == 0 ? 1 : tocRange.lastPage;
|
||||
tocRange.lastPage = tocRange.lastPage == 0 ? 1 : tocRange.lastPage;
|
||||
if (tocRange.lastPage == 1 && tocRange.lastPage == 1)
|
||||
if (tocRange.firstPage == 1 && tocRange.lastPage == 1)
|
||||
shiftRangesNextToTOC();
|
||||
} else {
|
||||
tocRange.lastPage++;
|
||||
|
@ -146,7 +146,6 @@ QWidget * LimeReport::RectUnitValuePropItem::createProperyEditor(QWidget *parent
|
||||
QDoubleSpinBox *editor= new QDoubleSpinBox(parent);
|
||||
editor->setMaximum(100000);
|
||||
editor->setSuffix(" "+unitShortName());
|
||||
BaseDesignIntf* item = dynamic_cast<BaseDesignIntf*>(object());
|
||||
return editor;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user