mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 16:44:39 +03:00
Showing the report designer from a console application has been fixed
This commit is contained in:
parent
bac1b85170
commit
e9e98292f2
@ -127,7 +127,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}\\\"
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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());
|
||||||
|
@ -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
|
||||||
|
@ -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;}
|
||||||
|
Loading…
Reference in New Issue
Block a user