mirror of
https://github.com/fralx/LimeReport.git
synced 2025-10-28 20:22:03 +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:
@@ -87,6 +87,7 @@ class DataFooterBand : public BandDesignIntf
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int columnsCount READ columnsCount WRITE setColumnsCount)
|
||||
Q_PROPERTY(bool splittable READ isSplittable WRITE setSplittable)
|
||||
Q_PROPERTY(BandColumnsLayoutType columnsFillDirection READ columnsFillDirection WRITE setColumnsFillDirection)
|
||||
Q_PROPERTY(bool printAlways READ printAlways WRITE setPrintAlways)
|
||||
public:
|
||||
|
||||
@@ -77,6 +77,7 @@ class SubDetailFooterBand : public BandDesignIntf
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int columnsCount READ columnsCount WRITE setColumnsCount)
|
||||
Q_PROPERTY(bool splittable READ isSplittable WRITE setSplittable)
|
||||
Q_PROPERTY(BandColumnsLayoutType columnsFillDirection READ columnsFillDirection WRITE setColumnsFillDirection)
|
||||
Q_PROPERTY(bool printAlways READ printAlways() WRITE setPrintAlways())
|
||||
public:
|
||||
|
||||
BIN
limereport/databrowser/images/closed_eye.png
Executable file
BIN
limereport/databrowser/images/closed_eye.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 232 B |
BIN
limereport/databrowser/images/eye.png
Executable file
BIN
limereport/databrowser/images/eye.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 429 B |
@@ -118,7 +118,7 @@ ConnectionDesc *ConnectionDialog::uiToConnection(LimeReport::ConnectionDesc* con
|
||||
result ->setName(ConnectionDesc::connectionNameForReport(ui->leConnectionName->text()));
|
||||
result ->setHost(ui->leServerName->text());
|
||||
if (!ui->lePort->text().isEmpty())
|
||||
result->setPort(ui->lePort->text().toInt());
|
||||
result->setPort(ui->lePort->text());
|
||||
result ->setDriver(ui->cbbDrivers->currentText());
|
||||
result ->setUserName(ui->leUserName->text());
|
||||
result ->setPassword(ui->lePassword->text());
|
||||
@@ -141,7 +141,7 @@ void ConnectionDialog::connectionToUI()
|
||||
ui->cbbDrivers->setCurrentIndex(ui->cbbDrivers->findText(m_connection->driver()));
|
||||
ui->cbAutoConnect->setChecked(m_connection->autoconnect());
|
||||
ui->cbbKeepCredentials->setChecked(!m_connection->keepDBCredentials());
|
||||
ui->lePort->setText(m_connection->port()!=-1?QString::number(m_connection->port()):"");
|
||||
ui->lePort->setText(m_connection->port());
|
||||
}
|
||||
|
||||
void ConnectionDialog::on_toolButton_clicked()
|
||||
@@ -160,6 +160,10 @@ void ConnectionDialog::on_cbbUseDefaultConnection_toggled(bool checked)
|
||||
ui->leConnectionName->setEnabled(true);
|
||||
}
|
||||
}
|
||||
void ConnectionDialog::on_toolButton_2_toggled(bool checked)
|
||||
{
|
||||
ui->lePassword->setEchoMode(checked ? QLineEdit::Normal : QLineEdit::Password);
|
||||
}
|
||||
|
||||
} // namespace LimeReport
|
||||
|
||||
@@ -167,3 +171,5 @@ void ConnectionDialog::on_cbbUseDefaultConnection_toggled(bool checked)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ private slots:
|
||||
void on_toolButton_clicked();
|
||||
void on_cbbUseDefaultConnection_toggled(bool checked);
|
||||
|
||||
void on_toolButton_2_toggled(bool checked);
|
||||
|
||||
private:
|
||||
Ui::ConnectionDialog *ui;
|
||||
ConnectionDesc* m_connection;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>420</width>
|
||||
<height>323</height>
|
||||
<height>365</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -44,7 +44,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
@@ -114,14 +114,39 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lePassword">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lePassword">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton_2">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="lrdatabrowser.qrc">
|
||||
<normaloff>:/databrowser/images/closed_eye.png</normaloff>
|
||||
<normalon>:/databrowser/images/eye.png</normalon>:/databrowser/images/closed_eye.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
@@ -137,6 +162,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toolButton">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::ClickFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
@@ -158,7 +186,7 @@
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbbKeepCredentials">
|
||||
<property name="text">
|
||||
<string>Dont keep credentals in lrxml</string>
|
||||
<string>Don't keep credentials in lrxml</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -221,8 +249,24 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>leConnectionName</tabstop>
|
||||
<tabstop>cbbUseDefaultConnection</tabstop>
|
||||
<tabstop>cbbDrivers</tabstop>
|
||||
<tabstop>leServerName</tabstop>
|
||||
<tabstop>lePort</tabstop>
|
||||
<tabstop>leUserName</tabstop>
|
||||
<tabstop>lePassword</tabstop>
|
||||
<tabstop>leDataBase</tabstop>
|
||||
<tabstop>cbAutoConnect</tabstop>
|
||||
<tabstop>cbbKeepCredentials</tabstop>
|
||||
<tabstop>pbCheckConnection</tabstop>
|
||||
<tabstop>pbCancel</tabstop>
|
||||
<tabstop>pbOk</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="lrdatabrowser.qrc"/>
|
||||
<include location="lrdatabrowser.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
||||
@@ -677,7 +677,7 @@ SQLEditResult::ResultMode DataBrowser::currentDatasourceType(const QString& data
|
||||
|
||||
void DataBrowser::applyChanges(SQLEditResult result)
|
||||
{
|
||||
if (result.resultMode == currentDatasourceType(result.datasourceName)){
|
||||
if (result.resultMode == currentDatasourceType(result.oldDatasourceName)){
|
||||
switch(result.resultMode){
|
||||
case SQLEditResult::Query:
|
||||
changeQuery(result);
|
||||
@@ -694,7 +694,7 @@ void DataBrowser::applyChanges(SQLEditResult result)
|
||||
default: break;
|
||||
}
|
||||
} else {
|
||||
removeDatasource(result.datasourceName);
|
||||
removeDatasource(result.oldDatasourceName);
|
||||
addDatasource(result);
|
||||
}
|
||||
activateItem(result.datasourceName, DataBrowserTree::Table);
|
||||
|
||||
@@ -44,5 +44,7 @@
|
||||
<file alias="/images/value_edit">images/value_edit2.png</file>
|
||||
<file alias="/images/value">images/value1.png</file>
|
||||
<file alias="/images/varToReport">images/varToReport.png</file>
|
||||
<file>images/eye.png</file>
|
||||
<file>images/closed_eye.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,28 +47,28 @@ include(limereport.pri)
|
||||
unix:{
|
||||
DESTDIR = $${DEST_LIBS}
|
||||
linux{
|
||||
QMAKE_POST_LINK += mkdir -p $$quote($${DEST_INCLUDE_DIR}) $$escape_expand(\\n\\t) # qmake need make mkdir -p on subdirs more than root/
|
||||
QMAKE_POST_LINK += mkdir -p \"$${DEST_INCLUDE_DIR}\" $$escape_expand(\\n\\t) # qmake need make mkdir -p on subdirs more than root/
|
||||
for(FILE,EXTRA_FILES){
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($${DEST_INCLUDE_DIR}) $$escape_expand(\\n\\t) # inside of libs make /include/files
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY \"$$FILE\" \"$${DEST_INCLUDE_DIR}\" $$escape_expand(\\n\\t) # inside of libs make /include/files
|
||||
}
|
||||
}
|
||||
macx{
|
||||
for(FILE,EXTRA_FILES){
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($${DEST_INCLUDE_DIR}) $$escape_expand(\\n\\t)
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY \"$$FILE\" \"$${DEST_INCLUDE_DIR}\" $$escape_expand(\\n\\t)
|
||||
}
|
||||
QMAKE_POST_LINK += mkdir -p $$quote($${DESTDIR}/include) $$escape_expand(\\n\\t)
|
||||
QMAKE_POST_LINK += mkdir -p \"$${DESTDIR}/include\" $$escape_expand(\\n\\t)
|
||||
}
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$quote($${DEST_INCLUDE_DIR}) $$quote($${DESTDIR})
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY_DIR \"$${DEST_INCLUDE_DIR}\" \"$${DESTDIR}\"
|
||||
}
|
||||
|
||||
win32 {
|
||||
DESTDIR = $${DEST_LIBS}
|
||||
contains(QMAKE_HOST.os, Linux){
|
||||
QMAKE_POST_LINK += mkdir -p $$quote($${DEST_INCLUDE_DIR}) $$escape_expand(\\n\\t) # qmake need make mkdir -p on subdirs more than root/
|
||||
QMAKE_POST_LINK += mkdir -p \"$${DEST_INCLUDE_DIR}\" $$escape_expand(\\n\\t) # qmake need make mkdir -p on subdirs more than root/
|
||||
for(FILE,EXTRA_FILES){
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($${DEST_INCLUDE_DIR}) $$escape_expand(\\n\\t) # inside of libs make /include/files
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY \"$$FILE\" \"$${DEST_INCLUDE_DIR}\" $$escape_expand(\\n\\t) # inside of libs make /include/files
|
||||
}
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$quote($${DEST_INCLUDE_DIR}) $$quote($${DESTDIR})
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY_DIR \"$${DEST_INCLUDE_DIR}\" \"$${DESTDIR}\"
|
||||
} else {
|
||||
EXTRA_FILES ~= s,/,\\,g
|
||||
BUILD_DIR ~= s,/,\\,g
|
||||
@@ -121,20 +121,13 @@ contains(CONFIG,build_translations){
|
||||
TRANSLATIONS = $$prependAll(LANGUAGES, \"$$TRANSLATIONS_PATH/limereport_,.ts\")
|
||||
|
||||
qtPrepareTool(LUPDATE, lupdate)
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||
ts.commands = $$LUPDATE $$shell_quote($$PWD) -noobsolete -ts $$TRANSLATIONS
|
||||
}
|
||||
lessThan(QT_MAJOR_VERSION, 5){
|
||||
ts.commands = $$LUPDATE $$quote($$PWD) -noobsolete -ts $$TRANSLATIONS
|
||||
}
|
||||
ts.commands = $$LUPDATE \"$$PWD\" -noobsolete -ts $$TRANSLATIONS
|
||||
TRANSLATIONS_FILES =
|
||||
qtPrepareTool(LRELEASE, lrelease)
|
||||
for(tsfile, TRANSLATIONS) {
|
||||
qmfile = $$tsfile
|
||||
qmfile ~= s,".ts\"$",".qm\"",
|
||||
qm.commands += $$LRELEASE -removeidentical $$tsfile -qm $$qmfile $$escape_expand(\\n\\t)
|
||||
tmp_command = $$LRELEASE -removeidentical $$tsfile -qm $$qmfile $$escape_expand(\\n\\t)
|
||||
TRANSLATIONS_FILES += $$qmfile
|
||||
}
|
||||
qm.depends = ts
|
||||
|
||||
@@ -273,6 +273,12 @@ void BandDesignIntf::setPpm(int ppm)
|
||||
updateBandMarkerGeometry(QRectF(pos(),size()));
|
||||
}
|
||||
|
||||
void BandDesignIntf::copyBandAttributes(BandDesignIntf *source)
|
||||
{
|
||||
this->copyBookmarks(source);
|
||||
this->setBackgroundColor(source->backgroundColor());
|
||||
}
|
||||
|
||||
void BandDesignIntf::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
{
|
||||
prepareRect(painter, option, widget);
|
||||
@@ -776,6 +782,11 @@ void BandDesignIntf::emitBandRendered(BandDesignIntf* band)
|
||||
emit bandRendered(band);
|
||||
}
|
||||
|
||||
void BandDesignIntf::emitBandReRendered(BandDesignIntf *oldBand, BandDesignIntf *newBand)
|
||||
{
|
||||
emit bandReRendered(oldBand, newBand);
|
||||
}
|
||||
|
||||
void BandDesignIntf::setSplittable(bool value){
|
||||
if (m_splitable!=value){
|
||||
bool oldValue = m_splitable;
|
||||
|
||||
@@ -219,6 +219,7 @@ public:
|
||||
void parentObjectLoadFinished();
|
||||
void finishLoading();
|
||||
void emitBandRendered(BandDesignIntf *band);
|
||||
void emitBandReRendered(BandDesignIntf* oldBand, BandDesignIntf* newBand);
|
||||
|
||||
bool isSplittable() const {return m_splitable;}
|
||||
void setSplittable(bool value);
|
||||
@@ -255,6 +256,7 @@ public:
|
||||
bool startFromNewPage() const;
|
||||
void setStartFromNewPage(bool startFromNewPage);
|
||||
bool canContainChildren() const{ return true;}
|
||||
bool canAcceptPaste() const{ return true;}
|
||||
bool printAlways() const;
|
||||
void setPrintAlways(bool printAlways);
|
||||
bool repeatOnEachRow() const;
|
||||
@@ -281,8 +283,10 @@ public:
|
||||
void setPaddingBottom(int paddingBottom);
|
||||
|
||||
QRectF boundingRect() const;
|
||||
void copyBandAttributes(BandDesignIntf* source);
|
||||
signals:
|
||||
void bandRendered(BandDesignIntf* band);
|
||||
void bandReRendered(BandDesignIntf* oldBand, BandDesignIntf* newBand);
|
||||
void preparedForRender();
|
||||
void bandRegistred();
|
||||
protected:
|
||||
|
||||
@@ -87,6 +87,8 @@ BaseDesignIntf::BaseDesignIntf(const QString &storageTypeName, QObject *owner, Q
|
||||
m_itemGeometryLocked(false),
|
||||
m_isChangingPos(false),
|
||||
m_ppm(Const::STORAGE_MM_FACTOR)
|
||||
m_isMoveable(false)
|
||||
|
||||
{
|
||||
setGeometry(QRectF(0, 0, m_width, m_height));
|
||||
if (BaseDesignIntf *item = dynamic_cast<BaseDesignIntf *>(parent)) {
|
||||
@@ -390,6 +392,10 @@ void BaseDesignIntf::setFixedPos(bool fixedPos)
|
||||
m_fixedPos = fixedPos;
|
||||
}
|
||||
|
||||
void BaseDesignIntf::onChangeGeometryTimeOut(){
|
||||
m_isMoveable = true;
|
||||
}
|
||||
|
||||
void BaseDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
@@ -398,7 +404,9 @@ void BaseDesignIntf::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
m_startPos = pos();
|
||||
m_oldGeometry = geometry();
|
||||
QGraphicsItem::mousePressEvent(event);
|
||||
emit(itemSelected(this));
|
||||
emit itemSelected(this);
|
||||
m_isMoveable = false;
|
||||
QTimer::singleShot(200, this, SLOT(onChangeGeometryTimeOut()));
|
||||
}
|
||||
else QGraphicsItem::mousePressEvent(event);
|
||||
}
|
||||
@@ -527,6 +535,7 @@ void BaseDesignIntf::hoverEnterEvent(QGraphicsSceneHoverEvent* /*event*/)
|
||||
|
||||
void BaseDesignIntf::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (!m_isMoveable) return;
|
||||
if (!isSelected()){
|
||||
QGraphicsItem::mouseMoveEvent(event);
|
||||
return;
|
||||
|
||||
@@ -324,6 +324,7 @@ public:
|
||||
void setBorderColor(const QColor &borderColor);
|
||||
void setItemVisible(const bool& value);
|
||||
virtual bool canContainChildren() const { return false;}
|
||||
virtual bool canAcceptPaste() const{ return false;}
|
||||
ReportSettings* reportSettings() const;
|
||||
void setReportSettings(ReportSettings *reportSettings);
|
||||
void setZValueProperty(qreal value);
|
||||
@@ -338,6 +339,15 @@ public:
|
||||
virtual void setWatermark(bool watermark);
|
||||
void updateSelectionMarker();
|
||||
void turnOnSelectionMarker(bool value);
|
||||
bool fillTransparentInDesignMode() const;
|
||||
void setFillTransparentInDesignMode(bool fillTransparentInDesignMode);
|
||||
void emitPosChanged(QPointF oldPos, QPointF newPos);
|
||||
void emitObjectNamePropertyChanged(const QString& oldName, const QString& newName);
|
||||
bool isGeometryLocked() const;
|
||||
void setGeometryLocked(bool itemLocked);
|
||||
bool isChangingPos() const;
|
||||
void setIsChangingPos(bool isChangingPos);
|
||||
|
||||
Q_INVOKABLE QString setItemWidth(qreal width);
|
||||
Q_INVOKABLE QString setItemHeight(qreal height);
|
||||
Q_INVOKABLE qreal getItemWidth();
|
||||
@@ -434,6 +444,10 @@ private:
|
||||
void moveSelectedItems(QPointF delta);
|
||||
Qt::CursorShape getPossibleCursor(int cursorFlags);
|
||||
void updatePossibleDirectionFlags();
|
||||
|
||||
private slots:
|
||||
void onChangeGeometryTimeOut();
|
||||
|
||||
private:
|
||||
QPointF m_startPos;
|
||||
int m_resizeHandleSize;
|
||||
@@ -495,19 +509,21 @@ private:
|
||||
bool m_itemGeometryLocked;
|
||||
bool m_isChangingPos;
|
||||
int m_ppm;
|
||||
bool m_isMoveable;
|
||||
|
||||
signals:
|
||||
void geometryChanged(QObject* object, QRectF newGeometry, QRectF oldGeometry);
|
||||
void posChanging(QObject* object, QPointF newPos, QPointF oldPos);
|
||||
void posChanged(QObject* object, QPointF newPos, QPointF oldPos);
|
||||
void itemSelected(LimeReport::BaseDesignIntf *item);
|
||||
void itemSelectedHasBeenChanged(BaseDesignIntf *item, bool value);
|
||||
void itemSelectedHasBeenChanged(LimeReport::BaseDesignIntf *item, bool value);
|
||||
void loadCollectionFinished(const QString& collectionName);
|
||||
void objectLoaded(QObject* object);
|
||||
void objectChanged(QObject* object);
|
||||
void propertyChanged(const QString& propertName, const QVariant& oldValue,const QVariant& newValue);
|
||||
void propertyObjectNameChanged(const QString& oldValue, const QString& newValue);
|
||||
void propertyesChanged(QVector<QString> propertyNames);
|
||||
void itemAlignChanged(BaseDesignIntf* item, const ItemAlign& oldValue, const ItemAlign& newValue);
|
||||
void itemAlignChanged(BaseDesignIntf* item, const BaseDesignIntf::ItemAlign& oldValue, const BaseDesignIntf::ItemAlign& newValue);
|
||||
void itemVisibleHasChanged(BaseDesignIntf* item);
|
||||
void beforeRender();
|
||||
void afterData();
|
||||
|
||||
@@ -336,13 +336,13 @@ void ModelToDataSource::slotModelDestroed()
|
||||
|
||||
ConnectionDesc::ConnectionDesc(QSqlDatabase db, QObject *parent)
|
||||
: QObject(parent), m_connectionName(db.connectionName()), m_connectionHost(db.hostName()), m_connectionDriver(db.driverName()),
|
||||
m_databaseName(db.databaseName()), m_user(db.userName()), m_password(db.password()), m_port(-1), m_autoconnect(false),
|
||||
m_databaseName(db.databaseName()), m_user(db.userName()), m_password(db.password()), m_port(""), m_autoconnect(false),
|
||||
m_internal(false), m_keepDBCredentials(true)
|
||||
{}
|
||||
|
||||
ConnectionDesc::ConnectionDesc(QObject *parent)
|
||||
:QObject(parent),m_connectionName(""),m_connectionHost(""), m_connectionDriver(""),
|
||||
m_databaseName(""), m_user(""), m_password(""), m_port(-1), m_autoconnect(false),
|
||||
m_databaseName(""), m_user(""), m_password(""), m_port(""), m_autoconnect(false),
|
||||
m_internal(false), m_keepDBCredentials(true)
|
||||
{}
|
||||
|
||||
@@ -377,12 +377,12 @@ QString ConnectionDesc::connectionNameForReport(const QString &connectionName)
|
||||
return connectionName.compare(tr("defaultConnection")) == 0 ? QSqlDatabase::defaultConnection : connectionName;
|
||||
}
|
||||
|
||||
int ConnectionDesc::port() const
|
||||
QString ConnectionDesc::port() const
|
||||
{
|
||||
return m_port;
|
||||
}
|
||||
|
||||
void ConnectionDesc::setPort(int port)
|
||||
void ConnectionDesc::setPort(QString port)
|
||||
{
|
||||
m_port = port;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ class ConnectionDesc : public QObject{
|
||||
Q_PROPERTY(QString host READ host WRITE setHost)
|
||||
Q_PROPERTY(bool autoconnect READ autoconnect WRITE setAutoconnect)
|
||||
Q_PROPERTY(bool keepDBCredentials READ keepDBCredentials WRITE setKeepDBCredentials)
|
||||
Q_PROPERTY(int port READ port WRITE setPort)
|
||||
Q_PROPERTY(QString port READ port WRITE setPort)
|
||||
public:
|
||||
typedef QSharedPointer<ConnectionDesc> Ptr;
|
||||
ConnectionDesc(QSqlDatabase db, QObject* parent=0);
|
||||
@@ -103,8 +103,8 @@ public:
|
||||
void setInternal(bool value) {m_internal = value;}
|
||||
bool keepDBCredentials() const;
|
||||
void setKeepDBCredentials(bool keepDBCredentials);
|
||||
int port() const;
|
||||
void setPort(int port);
|
||||
QString port() const;
|
||||
void setPort(QString port);
|
||||
public:
|
||||
static QString connectionNameForUser(const QString& connectionName);
|
||||
static QString connectionNameForReport(const QString& connectionName);
|
||||
@@ -117,7 +117,7 @@ private:
|
||||
QString m_databaseName;
|
||||
QString m_user;
|
||||
QString m_password;
|
||||
int m_port;
|
||||
QString m_port;
|
||||
bool m_autoconnect;
|
||||
bool m_internal;
|
||||
bool m_keepDBCredentials;
|
||||
|
||||
@@ -675,8 +675,6 @@ CSVDesc *DataSourceManager::csvByName(const QString &datasourceName)
|
||||
|
||||
void DataSourceManager::removeDatasource(const QString &name)
|
||||
{
|
||||
invalidateLinkedDatasources(name);
|
||||
|
||||
if (m_datasources.contains(name)){
|
||||
IDataSourceHolder *holder;
|
||||
holder=m_datasources.value(name);
|
||||
@@ -703,6 +701,7 @@ void DataSourceManager::removeDatasource(const QString &name)
|
||||
delete m_csvs.at(csvIndex);
|
||||
m_csvs.removeAt(csvIndex);
|
||||
}
|
||||
invalidateLinkedDatasources(name);
|
||||
m_hasChanges = true;
|
||||
emit datasourcesChanged();
|
||||
}
|
||||
@@ -808,12 +807,12 @@ bool DataSourceManager::initAndOpenDB(QSqlDatabase& db, ConnectionDesc& connecti
|
||||
|
||||
bool connected = false;
|
||||
|
||||
|
||||
db.setHostName(replaceVariables(connectionDesc.host()));
|
||||
db.setUserName(replaceVariables(connectionDesc.userName()));
|
||||
db.setPassword(replaceVariables(connectionDesc.password()));
|
||||
if (connectionDesc.port()!=-1)
|
||||
db.setPort(connectionDesc.port());
|
||||
db.setDatabaseName(replaceVariables(connectionDesc.databaseName()));
|
||||
if (connectionDesc.port()!="")
|
||||
db.setPort(replaceVariables(connectionDesc.port()).toInt());
|
||||
|
||||
if (!connectionDesc.keepDBCredentials() && m_dbCredentialsProvider){
|
||||
if (!m_dbCredentialsProvider->getUserName(connectionDesc.name()).isEmpty())
|
||||
@@ -1011,14 +1010,15 @@ void DataSourceManager::disconnectConnection(const QString& connectionName)
|
||||
foreach(QString datasourceName, dataSourceNames()){
|
||||
if (isQuery(datasourceName) || isSubQuery(datasourceName)){
|
||||
QueryHolder* qh = dynamic_cast<QueryHolder*>(dataSourceHolder(datasourceName));
|
||||
if (qh && qh->connectionName().compare(connectionName,Qt::CaseInsensitive)==0){
|
||||
qh->invalidate(designTime()?IDataSource::DESIGN_MODE:IDataSource::RENDER_MODE);
|
||||
if (qh && qh->connectionName().compare(connectionName, Qt::CaseInsensitive) == 0){
|
||||
qh->invalidate(designTime() ? IDataSource::DESIGN_MODE : IDataSource::RENDER_MODE, true);
|
||||
qh->setLastError(tr("invalid connection"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ConnectionDesc* connectionDesc = connectionByName(connectionName);
|
||||
|
||||
if (connectionDesc->isInternal()){
|
||||
{
|
||||
QSqlDatabase db = QSqlDatabase::database(connectionName);
|
||||
@@ -1347,12 +1347,12 @@ void DataSourceManager::invalidateLinkedDatasources(QString datasourceName)
|
||||
{
|
||||
foreach(QString name, dataSourceNames()){
|
||||
if (isSubQuery(name)){
|
||||
if (subQueryByName(name)->master() == datasourceName)
|
||||
if (subQueryByName(name)->master().compare(datasourceName) == 0)
|
||||
dataSourceHolder(name)->invalidate(designTime()?IDataSource::DESIGN_MODE:IDataSource::RENDER_MODE);
|
||||
}
|
||||
if (isProxy(name)){
|
||||
ProxyDesc* proxy = proxyByName(name);
|
||||
if ((proxy->master() == datasourceName) || (proxy->child() == datasourceName))
|
||||
if ((proxy->master().compare(datasourceName) == 0) || (proxy->child().compare(datasourceName) == 0))
|
||||
dataSourceHolder(name)->invalidate(designTime()?IDataSource::DESIGN_MODE:IDataSource::RENDER_MODE);
|
||||
|
||||
}
|
||||
@@ -1437,13 +1437,13 @@ void DataSourceManager::clear(ClearMethod method)
|
||||
case All:
|
||||
invalidateLinkedDatasources(dit.key());
|
||||
delete dit.value();
|
||||
m_datasources.erase(dit++);
|
||||
dit = m_datasources.erase(dit);
|
||||
break;
|
||||
default:
|
||||
if (owned){
|
||||
invalidateLinkedDatasources(dit.key());
|
||||
delete dit.value();
|
||||
m_datasources.erase(dit++);
|
||||
dit = m_datasources.erase(dit);
|
||||
} else {
|
||||
++dit;
|
||||
}
|
||||
|
||||
@@ -97,6 +97,14 @@ void GroupFunction::slotBandRendered(BandDesignIntf *band)
|
||||
}
|
||||
}
|
||||
|
||||
void GroupFunction::slotBandReRendered(BandDesignIntf *oldBand, BandDesignIntf *newBand)
|
||||
{
|
||||
if (m_valuesByBand.contains(oldBand)){
|
||||
m_valuesByBand.insert(newBand, m_valuesByBand.value(oldBand));
|
||||
m_valuesByBand.remove(oldBand);
|
||||
}
|
||||
}
|
||||
|
||||
QVariant GroupFunction::addition(QVariant value1, QVariant value2)
|
||||
{
|
||||
return value1.toDouble()+value2.toDouble();
|
||||
|
||||
@@ -56,6 +56,7 @@ public:
|
||||
virtual QVariant calculate(PageItemDesignIntf* page = 0)=0;
|
||||
public slots:
|
||||
void slotBandRendered(BandDesignIntf* band);
|
||||
void slotBandReRendered(BandDesignIntf* oldBand, BandDesignIntf* newBand);
|
||||
protected:
|
||||
void setName(const QString& value){m_name=value;}
|
||||
QVariant addition(QVariant value1, QVariant value2);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "lritemscontainerdesignitf.h"
|
||||
#include "lritemdesignintf.h"
|
||||
#include "lrbanddesignintf.h"
|
||||
|
||||
namespace LimeReport {
|
||||
|
||||
@@ -37,11 +38,15 @@ bool itemSortContainerLessThen(const PItemSortContainer c1, const PItemSortConta
|
||||
else return c1->m_rect.y()<c2->m_rect.y();
|
||||
}
|
||||
|
||||
void ItemsContainerDesignInft::snapshotItemsLayout()
|
||||
void ItemsContainerDesignInft::snapshotItemsLayout(SnapshotType type)
|
||||
{
|
||||
m_containerItems.clear();
|
||||
foreach(BaseDesignIntf *childItem,childBaseItems()){
|
||||
m_containerItems.append(PItemSortContainer(new ItemSortContainer(childItem)));
|
||||
foreach(BaseDesignIntf *childItem, childBaseItems()){
|
||||
if (type == IgnoreBands){
|
||||
if (!dynamic_cast<BandDesignIntf*>(childItem))
|
||||
m_containerItems.append(PItemSortContainer(new ItemSortContainer(childItem)));
|
||||
} else
|
||||
m_containerItems.append(PItemSortContainer(new ItemSortContainer(childItem)));
|
||||
}
|
||||
qSort(m_containerItems.begin(),m_containerItems.end(),itemSortContainerLessThen);
|
||||
}
|
||||
|
||||
@@ -42,8 +42,9 @@ class ItemsContainerDesignInft : public BookmarkContainerDesignIntf{
|
||||
public:
|
||||
ItemsContainerDesignInft(const QString& xmlTypeName, QObject* owner = 0, QGraphicsItem* parent=0):
|
||||
BookmarkContainerDesignIntf(xmlTypeName, owner, parent){}
|
||||
enum SnapshotType{Full, IgnoreBands};
|
||||
protected:
|
||||
void snapshotItemsLayout();
|
||||
void snapshotItemsLayout(SnapshotType type = Full);
|
||||
void arrangeSubItems(RenderPass pass, DataSourceManager *dataManager, ArrangeType type = AsNeeded);
|
||||
qreal findMaxBottom() const;
|
||||
qreal findMaxHeight() const;
|
||||
|
||||
@@ -132,23 +132,6 @@ void PageDesignIntf::updatePageRect()
|
||||
emit sceneRectChanged(sceneRect());
|
||||
}
|
||||
|
||||
//PageDesignIntf::Orientation PageDesignIntf::getOrientation()
|
||||
//{
|
||||
// return m_orientation;
|
||||
//}
|
||||
|
||||
//void PageDesignIntf::setPageSize(PageDesignIntf::PageSize sizeType, QSizeF sizeValue)
|
||||
//{
|
||||
// m_pageSize = sizeType;
|
||||
// m_pageSizeValue = sizeValue;
|
||||
// updatePageRect();
|
||||
//}
|
||||
|
||||
//PageDesignIntf::PageSize PageDesignIntf::pageSize() const
|
||||
//{
|
||||
// return m_pageSize;
|
||||
//}
|
||||
|
||||
void PageDesignIntf::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->modifiers() == Qt::NoModifier ||
|
||||
@@ -1385,9 +1368,9 @@ void PageDesignIntf::copy()
|
||||
}
|
||||
|
||||
BaseDesignIntf* PageDesignIntf::findDestObject(BaseDesignIntf* item){
|
||||
if (item && item->canContainChildren()) return item;
|
||||
if (item && item->canAcceptPaste()) return item;
|
||||
BaseDesignIntf * curItem = item;
|
||||
while (curItem && !curItem->canContainChildren()){
|
||||
while (curItem && !curItem->canAcceptPaste()){
|
||||
curItem = dynamic_cast<BaseDesignIntf*>(curItem->parentItem());
|
||||
}
|
||||
return curItem;
|
||||
@@ -2150,6 +2133,9 @@ bool PasteCommand::insertItem(ItemsReaderIntf::Ptr reader)
|
||||
if (page()->reportItemsByName(item->objectName()).size()>1){
|
||||
item->setObjectName(objectName);
|
||||
}
|
||||
foreach (BaseDesignIntf* child, item->childBaseItems()){
|
||||
changeName(page(), child);
|
||||
};
|
||||
m_itemNames.push_back(item->objectName());
|
||||
}
|
||||
return true;
|
||||
@@ -2157,6 +2143,14 @@ bool PasteCommand::insertItem(ItemsReaderIntf::Ptr reader)
|
||||
return false;
|
||||
}
|
||||
|
||||
void PasteCommand::changeName(PageDesignIntf *page, BaseDesignIntf* item)
|
||||
{
|
||||
item->setObjectName(page->genObjectName(*item));
|
||||
foreach(BaseDesignIntf* child, item->childBaseItems()){
|
||||
changeName(page, child);
|
||||
};
|
||||
}
|
||||
|
||||
CommandIf::Ptr CutCommand::create(PageDesignIntf *page)
|
||||
{
|
||||
CutCommand *command = new CutCommand();
|
||||
|
||||
@@ -266,7 +266,7 @@ namespace LimeReport {
|
||||
void bandDeleted(QObject* band);
|
||||
void slotPageItemLoaded(QObject *);
|
||||
void slotSelectionChanged();
|
||||
void slotAnimationStoped(QObject *animation);
|
||||
void slotAnimationStoped(QObject *animation);
|
||||
private:
|
||||
template <typename T>
|
||||
BaseDesignIntf* internalAddBand(T bandType);
|
||||
@@ -430,6 +430,7 @@ namespace LimeReport {
|
||||
void setItemsXML(const QString& itemsXML);
|
||||
void setParent(BaseDesignIntf* parent){m_parentItemName = parent->objectName();}
|
||||
bool insertItem(ItemsReaderIntf::Ptr reader);
|
||||
void changeName(PageDesignIntf* page, BaseDesignIntf *item);
|
||||
private:
|
||||
QString m_itemsXML;
|
||||
QString m_parentItemName;
|
||||
|
||||
@@ -50,8 +50,9 @@ PageItemDesignIntf::PageItemDesignIntf(QObject *owner, QGraphicsItem *parent) :
|
||||
m_topMargin(0), m_bottomMargin(0), m_leftMargin(0), m_rightMargin(0),
|
||||
m_pageOrientaion(Portrait), m_pageSize(A4), m_sizeChainging(false),
|
||||
m_fullPage(false), m_oldPrintMode(false), m_resetPageNumber(false),
|
||||
m_isExtendedInDesignMode(false), m_extendedHeight(1000), m_isTOC(false), m_setPageSizeToPrinter(false),
|
||||
m_endlessHeight(false), m_printable(true), m_pageFooter(0), m_printBehavior(Split)
|
||||
m_isExtendedInDesignMode(false), m_extendedHeight(1000), m_isTOC(false),
|
||||
m_setPageSizeToPrinter(false), m_endlessHeight(false), m_printable(true),
|
||||
m_pageFooter(0), m_printBehavior(Split), m_dropPrinterMargins(false)
|
||||
{
|
||||
setFixedPos(true);
|
||||
setPossibleResizeDirectionFlags(Fixed);
|
||||
@@ -64,8 +65,9 @@ PageItemDesignIntf::PageItemDesignIntf(const PageSize pageSize, const QRectF &re
|
||||
m_topMargin(0), m_bottomMargin(0), m_leftMargin(0), m_rightMargin(0),
|
||||
m_pageOrientaion(Portrait), m_pageSize(pageSize), m_sizeChainging(false),
|
||||
m_fullPage(false), m_oldPrintMode(false), m_resetPageNumber(false),
|
||||
m_isExtendedInDesignMode(false), m_extendedHeight(1000), m_isTOC(false), m_setPageSizeToPrinter(false),
|
||||
m_endlessHeight(false), m_printable(true), m_pageFooter(0), m_printBehavior(Split)
|
||||
m_isExtendedInDesignMode(false), m_extendedHeight(1000), m_isTOC(false),
|
||||
m_setPageSizeToPrinter(false), m_endlessHeight(false), m_printable(true),
|
||||
m_pageFooter(0), m_printBehavior(Split), m_dropPrinterMargins(false)
|
||||
{
|
||||
setFixedPos(true);
|
||||
setPossibleResizeDirectionFlags(Fixed);
|
||||
@@ -129,7 +131,8 @@ BaseDesignIntf *PageItemDesignIntf::createSameTypeItem(QObject *owner, QGraphics
|
||||
void PageItemDesignIntf::geometryChangedEvent(QRectF newRect, QRectF)
|
||||
{
|
||||
Q_UNUSED(newRect)
|
||||
updateMarginRect();
|
||||
if (itemMode() == DesignMode || !endlessHeight())
|
||||
updateMarginRect();
|
||||
PageSize oldSize = m_pageSize;
|
||||
if (!m_sizeChainging && !isLoading())
|
||||
m_pageSize = Custom;
|
||||
@@ -241,8 +244,7 @@ int PageItemDesignIntf::calcBandIndex(BandDesignIntf::BandsType bandType, BandDe
|
||||
} else {
|
||||
int maxChildIndex = 0;
|
||||
foreach(BandDesignIntf* band, m_bands){
|
||||
if (band->bandType() == BandDesignIntf::Data)
|
||||
maxChildIndex = std::max(maxChildIndex, band->maxChildIndex());
|
||||
maxChildIndex = std::max(maxChildIndex, band->maxChildIndex());
|
||||
}
|
||||
bandIndex = std::max(bandIndex, maxChildIndex + 1);
|
||||
}
|
||||
@@ -345,6 +347,16 @@ void PageItemDesignIntf::initColumnsPos(QVector<qreal> &posByColumns, qreal pos,
|
||||
}
|
||||
}
|
||||
|
||||
bool PageItemDesignIntf::dropPrinterMargins() const
|
||||
{
|
||||
return m_dropPrinterMargins;
|
||||
}
|
||||
|
||||
void PageItemDesignIntf::setDropPrinterMargins(bool dropPrinterMargins)
|
||||
{
|
||||
m_dropPrinterMargins = dropPrinterMargins;
|
||||
}
|
||||
|
||||
void PageItemDesignIntf::setPrintBehavior(const PrintBehavior &printBehavior)
|
||||
{
|
||||
m_printBehavior = printBehavior;
|
||||
@@ -518,8 +530,10 @@ void PageItemDesignIntf::setResetPageNumber(bool resetPageNumber)
|
||||
|
||||
void PageItemDesignIntf::updateSubItemsSize(RenderPass pass, DataSourceManager *dataManager)
|
||||
{
|
||||
snapshotItemsLayout();
|
||||
arrangeSubItems(pass, dataManager);
|
||||
if (!endlessHeight()){
|
||||
snapshotItemsLayout(IgnoreBands);
|
||||
arrangeSubItems(pass, dataManager);
|
||||
}
|
||||
}
|
||||
|
||||
bool PageItemDesignIntf::oldPrintMode() const
|
||||
|
||||
@@ -61,6 +61,7 @@ class PageItemDesignIntf : public ItemsContainerDesignInft
|
||||
Q_PROPERTY(QString printerName READ printerName WRITE setPrinterName)
|
||||
Q_PROPERTY(UnitType units READ unitType WRITE setUnitTypeProperty)
|
||||
Q_PROPERTY(PrintBehavior printBehavior READ printBehavior WRITE setPrintBehavior)
|
||||
Q_PROPERTY(bool dropPrinterMargins READ dropPrinterMargins WRITE setDropPrinterMargins)
|
||||
friend class ReportRender;
|
||||
public:
|
||||
enum Orientation { Portrait = QPrinter::Portrait, Landscape = QPrinter::Landscape };
|
||||
@@ -143,6 +144,7 @@ public:
|
||||
bool oldPrintMode() const;
|
||||
void setOldPrintMode(bool oldPrintMode);
|
||||
bool canContainChildren() const{ return true;}
|
||||
bool canAcceptPaste() const{ return true;}
|
||||
bool resetPageNumber() const;
|
||||
void setResetPageNumber(bool resetPageNumber);
|
||||
void updateSubItemsSize(RenderPass pass, DataSourceManager *dataManager);
|
||||
@@ -181,6 +183,10 @@ public:
|
||||
QRectF transformFromStorageToScenePpm(const QRectF& rect);
|
||||
void zoomIn();
|
||||
void zoomOut();
|
||||
|
||||
bool dropPrinterMargins() const;
|
||||
void setDropPrinterMargins(bool dropPrinterMargins);
|
||||
|
||||
signals:
|
||||
void beforeFirstPageRendered();
|
||||
void afterLastPageRendered();
|
||||
@@ -225,6 +231,7 @@ private:
|
||||
QString m_printerName;
|
||||
BandDesignIntf* m_pageFooter;
|
||||
PrintBehavior m_printBehavior;
|
||||
bool m_dropPrinterMargins;
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -60,6 +60,7 @@ void PreparedPages::clear()
|
||||
|
||||
bool PreparedPages::readPages(ItemsReaderIntf::Ptr reader)
|
||||
{
|
||||
clear();
|
||||
if (reader->first()){
|
||||
PageItemDesignIntf::Ptr page = PageItemDesignIntf::create(0);
|
||||
if (!reader->readItem(page.data()))
|
||||
|
||||
@@ -135,6 +135,7 @@ ReportDesignWindow::ReportDesignWindow(ReportEnginePrivateInterface* report, QWi
|
||||
m_hideLeftPanel->setChecked(isDockAreaVisible(Qt::LeftDockWidgetArea));
|
||||
m_hideRightPanel->setChecked(isDockAreaVisible(Qt::RightDockWidgetArea));
|
||||
createProgressBar();
|
||||
m_deletePageAction->setEnabled(report->pageCount()>1);
|
||||
}
|
||||
|
||||
ReportDesignWindow::~ReportDesignWindow()
|
||||
@@ -1126,6 +1127,7 @@ void ReportDesignWindow::slotSaveReport()
|
||||
QString filename = m_reportDesignWidget->reportFileName();
|
||||
m_lblReportName->setText(filename);
|
||||
if(!filename.isEmpty()) addRecentFile(filename);
|
||||
setWindowTitle(m_reportDesignWidget->report()->reportName() + " - Lime Report Designer");
|
||||
}
|
||||
|
||||
void ReportDesignWindow::slotSaveReportAs()
|
||||
@@ -1137,6 +1139,7 @@ void ReportDesignWindow::slotSaveReportAs()
|
||||
m_reportDesignWidget->saveToFile(fileName);
|
||||
m_lblReportName->setText(m_reportDesignWidget->reportFileName());
|
||||
addRecentFile(fileName);
|
||||
setWindowTitle(m_reportDesignWidget->report()->reportName() + " - Lime Report Designer");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ void ReportEnginePrivate::collectionLoadFinished(const QString &)
|
||||
page->setReportSettings(&m_reportSettings);
|
||||
page->setSceneRect(-Const::SCENE_MARGIN,-Const::SCENE_MARGIN,
|
||||
page->pageItem()->width()+Const::SCENE_MARGIN*2,
|
||||
page->pageItem()->height()+Const::SCENE_MARGIN*2);
|
||||
page->pageItem()->boundingRect().height()+Const::SCENE_MARGIN*2);
|
||||
}
|
||||
emit pagesLoadFinished();
|
||||
}
|
||||
@@ -878,6 +878,7 @@ bool ReportEnginePrivate::saveToFile(const QString &fileName)
|
||||
}
|
||||
}
|
||||
dropChanges();
|
||||
this->setReportName(fi.baseName());
|
||||
return saved;
|
||||
}
|
||||
|
||||
@@ -1801,9 +1802,6 @@ bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page)
|
||||
if (!m_firstPage && !m_painter->isActive()) return false;
|
||||
PageDesignIntf* backupPage = dynamic_cast<PageDesignIntf*>(page->scene());
|
||||
|
||||
//LimeReport::PageDesignIntf m_renderPage;
|
||||
//m_renderPage.setItemMode(PrintMode);
|
||||
|
||||
QPointF backupPagePos = page->pos();
|
||||
page->setPos(0,0);
|
||||
int currentPpm = page->ppm();
|
||||
@@ -1852,7 +1850,14 @@ bool PrintProcessor::printPage(PageItemDesignIntf::Ptr page)
|
||||
}
|
||||
|
||||
} else {
|
||||
m_renderPage.render(m_painter);
|
||||
if (page->getSetPageSizeToPrinter()){
|
||||
QRectF source = page->geometry();
|
||||
QSizeF inchSize = source.size() / (100 * 2.54);
|
||||
QRectF target = QRectF(QPoint(0,0), inchSize * m_printer->resolution());
|
||||
m_renderPage.render(m_painter, target, source);
|
||||
} else {
|
||||
m_renderPage.render(m_painter);
|
||||
}
|
||||
}
|
||||
page->setPos(backupPagePos);
|
||||
page->setPpm(currentPpm);
|
||||
@@ -1876,13 +1881,15 @@ void PrintProcessor::initPrinter(PageItemDesignIntf* page)
|
||||
m_printer->setPaperSize(pageSize,QPrinter::Millimeter);
|
||||
} else {
|
||||
m_printer->setFullPage(page->fullPage());
|
||||
if (page->dropPrinterMargins())
|
||||
m_printer->setPageMargins(0, 0, 0, 0, QPrinter::Point);
|
||||
m_printer->setOrientation(static_cast<QPrinter::Orientation>(page->pageOrientation()));
|
||||
if (page->pageSize()==PageItemDesignIntf::Custom){
|
||||
QSizeF pageSize = (page->pageOrientation()==PageItemDesignIntf::Landscape)?
|
||||
QSizeF(page->sizeMM().height(),page->sizeMM().width()):
|
||||
page->sizeMM();
|
||||
if (page->getSetPageSizeToPrinter() || m_printer->outputFormat() == QPrinter::PdfFormat)
|
||||
m_printer->setPaperSize(pageSize,QPrinter::Millimeter);
|
||||
m_printer->setPaperSize(pageSize, QPrinter::Millimeter);
|
||||
} else {
|
||||
if (page->getSetPageSizeToPrinter() || m_printer->outputFormat() == QPrinter::PdfFormat)
|
||||
m_printer->setPaperSize(static_cast<QPrinter::PageSize>(page->pageSize()));
|
||||
|
||||
@@ -386,7 +386,10 @@ void ReportRender::extractGroupFuntionsFromItem(ContentItemDesignIntf* contentIt
|
||||
if (dataBand){
|
||||
GroupFunction* gf = datasources()->addGroupFunction(functionName,captures.at(Const::VALUE_INDEX),band->objectName(),dataBand->objectName());
|
||||
if (gf){
|
||||
connect(dataBand,SIGNAL(bandRendered(BandDesignIntf*)),gf,SLOT(slotBandRendered(BandDesignIntf*)));
|
||||
connect(dataBand, SIGNAL(bandRendered(BandDesignIntf*)),
|
||||
gf, SLOT(slotBandRendered(BandDesignIntf*)));
|
||||
connect(dataBand, SIGNAL(bandReRendered(BandDesignIntf*, BandDesignIntf*)),
|
||||
gf, SLOT(slotBandReRendered(BandDesignIntf*, BandDesignIntf*)));
|
||||
}
|
||||
} else {
|
||||
GroupFunction* gf = datasources()->addGroupFunction(functionName,captures.at(Const::VALUE_INDEX),band->objectName(),captures.at(dsIndex));
|
||||
@@ -463,6 +466,15 @@ void ReportRender::replaceGroupsFunction(BandDesignIntf *band)
|
||||
replaceGroupFunctionsInContainer(band, band);
|
||||
}
|
||||
|
||||
QColor ReportRender::makeBackgroundColor(BandDesignIntf* band){
|
||||
if (band->useAlternateBackgroundColor()){
|
||||
return datasources()->variable(QLatin1String("line_") + band->objectName().toLower()).toInt() %2 == 0 ?
|
||||
band->backgroundColor() :
|
||||
band->alternateBackgroundColor();
|
||||
}
|
||||
return band->backgroundColor();
|
||||
}
|
||||
|
||||
BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesignIntf* bandData, ReportRender::DataRenderMode mode, bool isLast)
|
||||
{
|
||||
QCoreApplication::processEvents();
|
||||
@@ -490,18 +502,9 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign
|
||||
if (patternBand->isFooter())
|
||||
m_lastRenderedFooter = patternBand;
|
||||
|
||||
if (bandClone->useAlternateBackgroundColor()){
|
||||
bandClone->setBackgroundColor(
|
||||
(datasources()->variable(QLatin1String("line_")+patternBand->objectName().toLower()).toInt() %2 == 0 ?
|
||||
bandClone->backgroundColor() :
|
||||
bandClone->alternateBackgroundColor()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
bandClone->setBackgroundColor(makeBackgroundColor(patternBand));
|
||||
patternBand->emitBandRendered(bandClone);
|
||||
m_scriptEngineContext->setCurrentBand(bandClone);
|
||||
emit(patternBand->afterRender());
|
||||
|
||||
if ( isLast && bandClone->keepFooterTogether() && bandClone->sliceLastRow() ){
|
||||
if (m_maxHeightByColumn[m_currentColumn] < (bandClone->height()+m_reportFooterHeight))
|
||||
@@ -545,8 +548,9 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign
|
||||
savePage();
|
||||
startNewPage();
|
||||
if (!bandIsSliced){
|
||||
BandDesignIntf* t = renderData(patternBand);
|
||||
t->copyBookmarks(bandClone);
|
||||
BandDesignIntf* t = renderData(patternBand, false);
|
||||
t->copyBandAttributes(bandClone);
|
||||
patternBand->emitBandReRendered(bandClone, t);
|
||||
delete bandClone;
|
||||
bandClone = t;
|
||||
}
|
||||
@@ -554,6 +558,7 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign
|
||||
if (!registerBand(bandClone)) {
|
||||
BandDesignIntf* upperPart = dynamic_cast<BandDesignIntf*>(bandClone->cloneUpperPart(m_maxHeightByColumn[m_currentColumn]));
|
||||
registerBand(upperPart);
|
||||
patternBand->emitBandReRendered(bandClone, upperPart);
|
||||
delete bandClone;
|
||||
bandClone = NULL;
|
||||
};
|
||||
@@ -571,6 +576,7 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign
|
||||
|
||||
if (patternBand->isFooter())
|
||||
datasources()->clearGroupFunctionValues(patternBand->objectName());
|
||||
emit(patternBand->afterRender());
|
||||
return bandClone;
|
||||
}
|
||||
return 0;
|
||||
@@ -832,7 +838,7 @@ void ReportRender::recalcIfNeeded(BandDesignIntf* band){
|
||||
void ReportRender::renderDataHeader(BandDesignIntf *header)
|
||||
{
|
||||
recalcIfNeeded(header);
|
||||
BandDesignIntf* renderedHeader = renderBand(header, 0);
|
||||
BandDesignIntf* renderedHeader = renderBand(header, 0, StartNewPageAsNeeded);
|
||||
if (containsGroupFunctions(header))
|
||||
m_recalcBands.append(renderedHeader);
|
||||
}
|
||||
@@ -1253,13 +1259,14 @@ BandDesignIntf *ReportRender::saveUppperPartReturnBottom(BandDesignIntf *band, i
|
||||
return bottomBandPart;
|
||||
}
|
||||
|
||||
BandDesignIntf *ReportRender::renderData(BandDesignIntf *patternBand)
|
||||
BandDesignIntf *ReportRender::renderData(BandDesignIntf *patternBand, bool emitBeforeRender)
|
||||
{
|
||||
BandDesignIntf* bandClone = dynamic_cast<BandDesignIntf*>(patternBand->cloneItem(PreviewMode));
|
||||
|
||||
m_scriptEngineContext->baseDesignIntfToScript(patternBand->parent()->objectName(), bandClone);
|
||||
m_scriptEngineContext->setCurrentBand(bandClone);
|
||||
emit(patternBand->beforeRender());
|
||||
if (emitBeforeRender)
|
||||
emit(patternBand->beforeRender());
|
||||
|
||||
if (patternBand->isFooter()){
|
||||
replaceGroupsFunction(bandClone);
|
||||
|
||||
@@ -169,12 +169,10 @@ private:
|
||||
BandDesignIntf *sliceBand(BandDesignIntf* band, BandDesignIntf *patternBand, bool isLast);
|
||||
|
||||
BandDesignIntf* saveUppperPartReturnBottom(BandDesignIntf *band, int height, BandDesignIntf *patternBand);
|
||||
BandDesignIntf* renderData(BandDesignIntf* patternBand);
|
||||
BandDesignIntf* renderData(BandDesignIntf* patternBand, bool emitBeforeRender = true);
|
||||
void startNewColumn();
|
||||
void startNewPage(bool isFirst = false);
|
||||
void resetPageNumber(ResetPageNuberType resetType);
|
||||
//int findLastPageNumber(int currentPage);
|
||||
//int findPageNumber(int currentPage);
|
||||
void savePage(bool isLast = false);
|
||||
QString toString();
|
||||
void initColumns();
|
||||
@@ -187,8 +185,8 @@ private:
|
||||
void renameChildItems(BaseDesignIntf *item);
|
||||
void renderGroupFooterByHeader(BandDesignIntf *groupHeader);
|
||||
void updateTOC(BaseDesignIntf* item, int pageNumber);
|
||||
//PagesRange& currentRange(bool isTOC = false){ return (isTOC) ? m_ranges.first(): m_ranges.last();}
|
||||
void placeBandOnPage(BandDesignIntf *band, int columnIndex);
|
||||
QColor makeBackgroundColor(BandDesignIntf *band);
|
||||
private:
|
||||
DataSourceManager* m_datasources;
|
||||
ScriptEngineContext* m_scriptEngineContext;
|
||||
@@ -223,7 +221,6 @@ private:
|
||||
bool m_newPageStarted;
|
||||
bool m_lostHeadersMoved;
|
||||
|
||||
|
||||
};
|
||||
} // namespace LimeReport
|
||||
#endif // LRREPORTRENDER_H
|
||||
|
||||
@@ -1937,7 +1937,10 @@ bool DatasourceFunctions::invalidate(const QString& datasourceName)
|
||||
|
||||
QObject* DatasourceFunctions::createTableBuilder(QObject* horizontalLayout)
|
||||
{
|
||||
return new TableBuilder(dynamic_cast<LimeReport::HorizontalLayout*>(horizontalLayout), dynamic_cast<DataSourceManager*>(m_dataManager));
|
||||
LimeReport::HorizontalLayout* l = dynamic_cast<LimeReport::HorizontalLayout*>(horizontalLayout);
|
||||
if (l)
|
||||
return new TableBuilder(l, m_dataManager);
|
||||
return 0;
|
||||
}
|
||||
|
||||
TableBuilder::TableBuilder(HorizontalLayout* layout, DataSourceManager* dataManager)
|
||||
@@ -1987,16 +1990,19 @@ void TableBuilder::fillInRowData(QObject* row)
|
||||
void TableBuilder::buildTable(const QString& datasourceName)
|
||||
{
|
||||
checkBaseLayout();
|
||||
m_dataManager->dataSourceHolder(datasourceName)->invalidate(IDataSource::RENDER_MODE);
|
||||
IDataSource* ds = m_dataManager->dataSource(datasourceName);
|
||||
if (ds){
|
||||
bool firstTime = true;
|
||||
QObject* row = m_horizontalLayout;
|
||||
while(!ds->eof()){
|
||||
if (!firstTime) row = addRow();
|
||||
else firstTime = false;
|
||||
fillInRowData(row);
|
||||
ds->next();
|
||||
IDataSourceHolder* dh = m_dataManager->dataSourceHolder(datasourceName);
|
||||
if (dh) {
|
||||
dh->invalidate(IDataSource::RENDER_MODE);
|
||||
IDataSource* ds = m_dataManager->dataSource(datasourceName);
|
||||
if (ds){
|
||||
bool firstTime = true;
|
||||
QObject* row = m_horizontalLayout;
|
||||
while(!ds->eof()){
|
||||
if (!firstTime) row = addRow();
|
||||
else firstTime = false;
|
||||
fillInRowData(row);
|
||||
ds->next();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ class DatasourceFunctions : public QObject{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DatasourceFunctions(IDataSourceManager* dataManager)
|
||||
: m_dataManager(dataManager){}
|
||||
: m_dataManager(dynamic_cast<DataSourceManager*>(dataManager)){}
|
||||
Q_INVOKABLE bool first(const QString& datasourceName);
|
||||
Q_INVOKABLE bool next(const QString& datasourceName);
|
||||
Q_INVOKABLE bool prior(const QString& datasourceName);
|
||||
@@ -340,7 +340,7 @@ public:
|
||||
Q_INVOKABLE bool invalidate(const QString& datasourceName);
|
||||
Q_INVOKABLE QObject *createTableBuilder(QObject *horizontalLayout);
|
||||
private:
|
||||
IDataSourceManager* m_dataManager;
|
||||
DataSourceManager* m_dataManager;
|
||||
};
|
||||
|
||||
class ScriptFunctionsManager : public QObject{
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
****************************************************************************/
|
||||
#include "lrsimplecrypt.h"
|
||||
|
||||
namespace LimeReport {
|
||||
|
||||
#if defined(LP64) || defined(_LP64) || defined(__LP64__)
|
||||
typedef unsigned int WORD; /* Should be 32-bit = 4 bytes */
|
||||
#else
|
||||
@@ -62,8 +64,6 @@ void initPt(WTB& pt, QByteArray::Iterator* it, QByteArray::Iterator end){
|
||||
}
|
||||
}
|
||||
|
||||
namespace LimeReport {
|
||||
|
||||
class ChipperPrivate{
|
||||
friend class Chipper;
|
||||
public:
|
||||
@@ -117,7 +117,7 @@ QByteArray Chipper::cryptString(QString value)
|
||||
{
|
||||
QByteArray buff;
|
||||
QByteArray result;
|
||||
buff += value;
|
||||
buff += value.toUtf8();
|
||||
WTB pt, ct, prior;
|
||||
|
||||
if (!d->isPrepared())
|
||||
|
||||
@@ -175,15 +175,15 @@ void ScriptHighlighter::highlightBlock(const QString& text)
|
||||
|
||||
bool ScriptHighlighter::isKeyWord(const QString& word)
|
||||
{
|
||||
for (int i = 0; i < KEYWORDS_COUNT-1; ++i){
|
||||
if (QLatin1String(keywords[i]) == word) return true;
|
||||
}
|
||||
return false;
|
||||
return m_keywords.contains(word);
|
||||
}
|
||||
|
||||
ScriptHighlighter::ScriptHighlighter(QTextDocument* parent):
|
||||
QSyntaxHighlighter(parent)
|
||||
{
|
||||
for(int i=0; i<KEYWORDS_COUNT; ++i){
|
||||
m_keywords.insert(keywords[i]);
|
||||
}
|
||||
|
||||
if ( isColorDark(QPalette().background().color())){
|
||||
m_formats[NumberFormat].setForeground(Qt::darkBlue);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define LRSCRIPTHIGHLIGHTER_H
|
||||
|
||||
#include <QSyntaxHighlighter>
|
||||
#include <QSet>
|
||||
|
||||
namespace LimeReport{
|
||||
|
||||
@@ -43,6 +44,8 @@ protected:
|
||||
QTextCharFormat m_formats[FormatsCount];
|
||||
bool isKeyWord(const QString& word);
|
||||
void createParentheisisInfo(const char& literal, TextBlockData *data, const QString& text);
|
||||
private:
|
||||
QSet<QString> m_keywords;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user