mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-25 00:54:39 +03:00
Merge tag '1.5.28' into develop
Finish 1.5.28
This commit is contained in:
commit
79a4ba1f84
@ -128,7 +128,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
|
||||
|
||||
LIMEREPORT_VERSION_MAJOR = 1
|
||||
LIMEREPORT_VERSION_MINOR = 5
|
||||
LIMEREPORT_VERSION_RELEASE = 27
|
||||
LIMEREPORT_VERSION_RELEASE = 28
|
||||
|
||||
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
|
||||
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"
|
||||
|
@ -47,6 +47,7 @@ int main(int argc, char *argv[])
|
||||
QObject::connect(&report, SIGNAL(currentDefaultDesignerLanguageChanged(QLocale::Language)),
|
||||
&manager, SLOT(currentDefaultLanguageChanged(QLocale::Language)));
|
||||
|
||||
report.setShowDesignerModal(false);
|
||||
report.designReport();
|
||||
return a.exec();
|
||||
}
|
||||
|
@ -208,6 +208,9 @@ public:
|
||||
bool showPreparedPages(PreviewHints hints = PreviewBarsUserSetting);
|
||||
bool prepareReportPages();
|
||||
bool printPreparedPages();
|
||||
bool showDesignerModal() const;
|
||||
void setShowDesignerModal(bool showDesignerModal);
|
||||
|
||||
signals:
|
||||
void cleared();
|
||||
void renderStarted();
|
||||
@ -241,6 +244,7 @@ protected:
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(ReportEngine)
|
||||
static QSettings* m_settings;
|
||||
bool m_showDesignerModal;
|
||||
};
|
||||
|
||||
} // namespace LimeReport
|
||||
|
@ -800,22 +800,36 @@ void VerticalBarChart::paintSerialLines(QPainter* painter, QRectF barsRect)
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void VerticalBarChart::paintLabels(QPainter *painter, QRectF labelsRect)
|
||||
{
|
||||
painter->save();
|
||||
qreal hStep = (labelsRect.width() / valuesCount());
|
||||
|
||||
bool rotateLabels = false;
|
||||
QFontMetrics fm = painter->fontMetrics();
|
||||
foreach(QString label, m_chartItem->labels()){
|
||||
if (fm.width(label) > hStep){
|
||||
rotateLabels = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!m_chartItem->labels().isEmpty()){
|
||||
if (rotateLabels){
|
||||
painter->rotate(270);
|
||||
painter->translate(-(labelsRect.top()+labelsRect.height()),labelsRect.left());
|
||||
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);
|
||||
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->restore();
|
||||
}
|
||||
|
@ -738,7 +738,7 @@ QGraphicsScene* ReportEngine::createPreviewScene(QObject* parent){
|
||||
return d->createPreviewScene(parent);
|
||||
}
|
||||
|
||||
void ReportEnginePrivate::designReport()
|
||||
void ReportEnginePrivate::designReport(bool showModal)
|
||||
{
|
||||
ReportDesignWindowInterface* designerWindow = getDesignerWindow();
|
||||
if (designerWindow){
|
||||
@ -747,7 +747,7 @@ void ReportEnginePrivate::designReport()
|
||||
#ifdef Q_OS_WIN
|
||||
designerWindow->setWindowModality(Qt::ApplicationModal);
|
||||
#endif
|
||||
if (QApplication::activeWindow()==0){
|
||||
if (!showModal){
|
||||
designerWindow->show();;
|
||||
} else {
|
||||
designerWindow->showModal();
|
||||
@ -1373,7 +1373,7 @@ QString ReportEnginePrivate::lastError()
|
||||
}
|
||||
|
||||
ReportEngine::ReportEngine(QObject *parent)
|
||||
: QObject(parent), d_ptr(new ReportEnginePrivate())
|
||||
: QObject(parent), d_ptr(new ReportEnginePrivate()), m_showDesignerModal(true)
|
||||
{
|
||||
Q_D(ReportEngine);
|
||||
d->q_ptr=this;
|
||||
@ -1469,7 +1469,7 @@ void ReportEngine::designReport()
|
||||
Q_D(ReportEngine);
|
||||
if (m_settings)
|
||||
d->setSettings(m_settings);
|
||||
d->designReport();
|
||||
d->designReport(showDesignerModal());
|
||||
}
|
||||
|
||||
ReportDesignWindowInterface* ReportEngine::getDesignerWindow()
|
||||
@ -1760,7 +1760,7 @@ void ReportEngine::cancelPrinting()
|
||||
}
|
||||
|
||||
ReportEngine::ReportEngine(ReportEnginePrivate &dd, QObject *parent)
|
||||
:QObject(parent),d_ptr(&dd)
|
||||
:QObject(parent), d_ptr(&dd), m_showDesignerModal(true)
|
||||
{
|
||||
Q_D(ReportEngine);
|
||||
d->q_ptr=this;
|
||||
@ -1770,6 +1770,16 @@ ReportEngine::ReportEngine(ReportEnginePrivate &dd, QObject *parent)
|
||||
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::instance().setContext(scriptContext());
|
||||
ScriptEngineManager::instance().setDataManager(dataManager());
|
||||
|
@ -208,6 +208,9 @@ public:
|
||||
bool showPreparedPages(PreviewHints hints = PreviewBarsUserSetting);
|
||||
bool prepareReportPages();
|
||||
bool printPreparedPages();
|
||||
bool showDesignerModal() const;
|
||||
void setShowDesignerModal(bool showDesignerModal);
|
||||
|
||||
signals:
|
||||
void cleared();
|
||||
void renderStarted();
|
||||
@ -241,6 +244,7 @@ protected:
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(ReportEngine)
|
||||
static QSettings* m_settings;
|
||||
bool m_showDesignerModal;
|
||||
};
|
||||
|
||||
} // namespace LimeReport
|
||||
|
@ -179,7 +179,7 @@ public:
|
||||
void previewReport(QPrinter* printer, PreviewHints hints = PreviewBarsUserSetting);
|
||||
|
||||
ReportDesignWindowInterface* getDesignerWindow();
|
||||
void designReport();
|
||||
void designReport(bool showModal);
|
||||
void setSettings(QSettings* value);
|
||||
void setShowProgressDialog(bool value){m_showProgressDialog = value;}
|
||||
bool isShowProgressDialog() const {return m_showProgressDialog;}
|
||||
|
Loading…
Reference in New Issue
Block a user