0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 17:14:40 +03:00

Merge tag '1.5.28' into develop

Finish 1.5.28
This commit is contained in:
Arin Alexander 2020-01-09 21:48:07 +03:00
commit 79a4ba1f84
7 changed files with 51 additions and 18 deletions

View File

@ -128,7 +128,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MAJOR = 1
LIMEREPORT_VERSION_MINOR = 5 LIMEREPORT_VERSION_MINOR = 5
LIMEREPORT_VERSION_RELEASE = 27 LIMEREPORT_VERSION_RELEASE = 28
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"

View File

@ -47,6 +47,7 @@ int main(int argc, char *argv[])
QObject::connect(&report, SIGNAL(currentDefaultDesignerLanguageChanged(QLocale::Language)), QObject::connect(&report, SIGNAL(currentDefaultDesignerLanguageChanged(QLocale::Language)),
&manager, SLOT(currentDefaultLanguageChanged(QLocale::Language))); &manager, SLOT(currentDefaultLanguageChanged(QLocale::Language)));
report.setShowDesignerModal(false);
report.designReport(); report.designReport();
return a.exec(); return a.exec();
} }

View File

@ -208,6 +208,9 @@ public:
bool showPreparedPages(PreviewHints hints = PreviewBarsUserSetting); bool showPreparedPages(PreviewHints hints = PreviewBarsUserSetting);
bool prepareReportPages(); bool prepareReportPages();
bool printPreparedPages(); bool printPreparedPages();
bool showDesignerModal() const;
void setShowDesignerModal(bool showDesignerModal);
signals: signals:
void cleared(); void cleared();
void renderStarted(); void renderStarted();
@ -241,6 +244,7 @@ protected:
private: private:
Q_DECLARE_PRIVATE(ReportEngine) Q_DECLARE_PRIVATE(ReportEngine)
static QSettings* m_settings; static QSettings* m_settings;
bool m_showDesignerModal;
}; };
} // namespace LimeReport } // namespace LimeReport

View File

@ -800,22 +800,36 @@ void VerticalBarChart::paintSerialLines(QPainter* painter, QRectF barsRect)
painter->restore(); painter->restore();
} }
void VerticalBarChart::paintLabels(QPainter *painter, QRectF labelsRect) void VerticalBarChart::paintLabels(QPainter *painter, QRectF labelsRect)
{ {
painter->save(); painter->save();
qreal hStep = (labelsRect.width() / valuesCount()); qreal hStep = (labelsRect.width() / valuesCount());
bool rotateLabels = false;
if (!m_chartItem->labels().isEmpty()){ QFontMetrics fm = painter->fontMetrics();
painter->rotate(270); foreach(QString label, m_chartItem->labels()){
painter->translate(-(labelsRect.top()+labelsRect.height()),labelsRect.left()); if (fm.width(label) > hStep){
foreach (QString label, m_chartItem->labels()) { rotateLabels = true;
painter->drawText(QRectF(QPoint(0,0), break;
QSize(labelsRect.height()-4,hStep)),Qt::AlignVCenter|Qt::AlignRight,label); }
painter->translate(0,hStep); }
if (!m_chartItem->labels().isEmpty()){
if (rotateLabels){
painter->rotate(270);
painter->translate( -(labelsRect.top()+labelsRect.height()), labelsRect.left() );
foreach (QString label, m_chartItem->labels()) {
painter->drawText(QRectF(QPoint(0,0),
QSize(labelsRect.height()-4, hStep)), Qt::AlignVCenter | Qt::AlignRight, label);
painter->translate(0,hStep);
}
painter->rotate(-270);
} else {
painter->translate( labelsRect.left(), labelsRect.top() );
foreach (QString label, m_chartItem->labels()) {
painter->drawText(QRectF(QPoint(0, 4),
QSize(hStep, labelsRect.height()-4)), Qt::AlignHCenter | Qt::AlignTop, label);
painter->translate(hStep, 0);
}
} }
painter->rotate(-270);
} }
painter->restore(); painter->restore();
} }

View File

@ -738,7 +738,7 @@ QGraphicsScene* ReportEngine::createPreviewScene(QObject* parent){
return d->createPreviewScene(parent); return d->createPreviewScene(parent);
} }
void ReportEnginePrivate::designReport() void ReportEnginePrivate::designReport(bool showModal)
{ {
ReportDesignWindowInterface* designerWindow = getDesignerWindow(); ReportDesignWindowInterface* designerWindow = getDesignerWindow();
if (designerWindow){ if (designerWindow){
@ -747,7 +747,7 @@ void ReportEnginePrivate::designReport()
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
designerWindow->setWindowModality(Qt::ApplicationModal); designerWindow->setWindowModality(Qt::ApplicationModal);
#endif #endif
if (QApplication::activeWindow()==0){ if (!showModal){
designerWindow->show();; designerWindow->show();;
} else { } else {
designerWindow->showModal(); designerWindow->showModal();
@ -1373,7 +1373,7 @@ QString ReportEnginePrivate::lastError()
} }
ReportEngine::ReportEngine(QObject *parent) ReportEngine::ReportEngine(QObject *parent)
: QObject(parent), d_ptr(new ReportEnginePrivate()) : QObject(parent), d_ptr(new ReportEnginePrivate()), m_showDesignerModal(true)
{ {
Q_D(ReportEngine); Q_D(ReportEngine);
d->q_ptr=this; d->q_ptr=this;
@ -1469,7 +1469,7 @@ void ReportEngine::designReport()
Q_D(ReportEngine); Q_D(ReportEngine);
if (m_settings) if (m_settings)
d->setSettings(m_settings); d->setSettings(m_settings);
d->designReport(); d->designReport(showDesignerModal());
} }
ReportDesignWindowInterface* ReportEngine::getDesignerWindow() ReportDesignWindowInterface* ReportEngine::getDesignerWindow()
@ -1760,7 +1760,7 @@ void ReportEngine::cancelPrinting()
} }
ReportEngine::ReportEngine(ReportEnginePrivate &dd, QObject *parent) ReportEngine::ReportEngine(ReportEnginePrivate &dd, QObject *parent)
:QObject(parent),d_ptr(&dd) :QObject(parent), d_ptr(&dd), m_showDesignerModal(true)
{ {
Q_D(ReportEngine); Q_D(ReportEngine);
d->q_ptr=this; d->q_ptr=this;
@ -1770,6 +1770,16 @@ ReportEngine::ReportEngine(ReportEnginePrivate &dd, QObject *parent)
connect(d, SIGNAL(renderFinished()), this, SIGNAL(renderFinished())); connect(d, SIGNAL(renderFinished()), this, SIGNAL(renderFinished()));
} }
bool ReportEngine::showDesignerModal() const
{
return m_showDesignerModal;
}
void ReportEngine::setShowDesignerModal(bool showDesignerModal)
{
m_showDesignerModal = showDesignerModal;
}
ScriptEngineManager*LimeReport::ReportEnginePrivate::scriptManager(){ ScriptEngineManager*LimeReport::ReportEnginePrivate::scriptManager(){
ScriptEngineManager::instance().setContext(scriptContext()); ScriptEngineManager::instance().setContext(scriptContext());
ScriptEngineManager::instance().setDataManager(dataManager()); ScriptEngineManager::instance().setDataManager(dataManager());

View File

@ -208,6 +208,9 @@ public:
bool showPreparedPages(PreviewHints hints = PreviewBarsUserSetting); bool showPreparedPages(PreviewHints hints = PreviewBarsUserSetting);
bool prepareReportPages(); bool prepareReportPages();
bool printPreparedPages(); bool printPreparedPages();
bool showDesignerModal() const;
void setShowDesignerModal(bool showDesignerModal);
signals: signals:
void cleared(); void cleared();
void renderStarted(); void renderStarted();
@ -241,6 +244,7 @@ protected:
private: private:
Q_DECLARE_PRIVATE(ReportEngine) Q_DECLARE_PRIVATE(ReportEngine)
static QSettings* m_settings; static QSettings* m_settings;
bool m_showDesignerModal;
}; };
} // namespace LimeReport } // namespace LimeReport

View File

@ -179,7 +179,7 @@ public:
void previewReport(QPrinter* printer, PreviewHints hints = PreviewBarsUserSetting); void previewReport(QPrinter* printer, PreviewHints hints = PreviewBarsUserSetting);
ReportDesignWindowInterface* getDesignerWindow(); ReportDesignWindowInterface* getDesignerWindow();
void designReport(); void designReport(bool showModal);
void setSettings(QSettings* value); void setSettings(QSettings* value);
void setShowProgressDialog(bool value){m_showProgressDialog = value;} void setShowProgressDialog(bool value){m_showProgressDialog = value;}
bool isShowProgressDialog() const {return m_showProgressDialog;} bool isShowProgressDialog() const {return m_showProgressDialog;}