mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-25 04:54:40 +03:00
Merge branch 'master' into 1.4
This commit is contained in:
commit
7a1a3ac34a
@ -80,6 +80,13 @@ namespace Const{
|
|||||||
QString extractClassName(QString className);
|
QString extractClassName(QString className);
|
||||||
enum RenderPass {FirstPass, SecondPass};
|
enum RenderPass {FirstPass, SecondPass};
|
||||||
enum ArrangeType {AsNeeded, Force};
|
enum ArrangeType {AsNeeded, Force};
|
||||||
|
enum PreviewHint{ShowAllPreviewBars=0,
|
||||||
|
HidePreviewToolBar=1,
|
||||||
|
HidePreviewMenuBar=2,
|
||||||
|
HidePreviewStatusBar=4,
|
||||||
|
HideAllPreviewBar=7};
|
||||||
|
Q_DECLARE_FLAGS(PreviewHints, PreviewHint)
|
||||||
|
|
||||||
class ReportError : public std::runtime_error{
|
class ReportError : public std::runtime_error{
|
||||||
public:
|
public:
|
||||||
ReportError(const QString& message):std::runtime_error(message.toStdString()){}
|
ReportError(const QString& message):std::runtime_error(message.toStdString()){}
|
||||||
@ -104,6 +111,6 @@ namespace Const{
|
|||||||
|
|
||||||
} // namespace LimeReport
|
} // namespace LimeReport
|
||||||
|
|
||||||
|
Q_DECLARE_OPERATORS_FOR_FLAGS(LimeReport::PreviewHints)
|
||||||
|
|
||||||
#endif // GLOBAL_H
|
#endif // GLOBAL_H
|
||||||
|
@ -77,7 +77,7 @@ public:
|
|||||||
void printToFile(const QString& fileName);
|
void printToFile(const QString& fileName);
|
||||||
PageDesignIntf *createPreviewScene(QObject *parent = 0);
|
PageDesignIntf *createPreviewScene(QObject *parent = 0);
|
||||||
bool printToPDF(const QString& fileName);
|
bool printToPDF(const QString& fileName);
|
||||||
void previewReport();
|
void previewReport(PreviewHints hints = ShowAllPreviewBars);
|
||||||
void designReport();
|
void designReport();
|
||||||
void setShowProgressDialog(bool value);
|
void setShowProgressDialog(bool value);
|
||||||
IDataSourceManager* dataManager();
|
IDataSourceManager* dataManager();
|
||||||
|
@ -80,6 +80,13 @@ namespace Const{
|
|||||||
QString extractClassName(QString className);
|
QString extractClassName(QString className);
|
||||||
enum RenderPass {FirstPass, SecondPass};
|
enum RenderPass {FirstPass, SecondPass};
|
||||||
enum ArrangeType {AsNeeded, Force};
|
enum ArrangeType {AsNeeded, Force};
|
||||||
|
enum PreviewHint{ShowAllPreviewBars=0,
|
||||||
|
HidePreviewToolBar=1,
|
||||||
|
HidePreviewMenuBar=2,
|
||||||
|
HidePreviewStatusBar=4,
|
||||||
|
HideAllPreviewBar=7};
|
||||||
|
Q_DECLARE_FLAGS(PreviewHints, PreviewHint)
|
||||||
|
|
||||||
class ReportError : public std::runtime_error{
|
class ReportError : public std::runtime_error{
|
||||||
public:
|
public:
|
||||||
ReportError(const QString& message):std::runtime_error(message.toStdString()){}
|
ReportError(const QString& message):std::runtime_error(message.toStdString()){}
|
||||||
@ -104,6 +111,6 @@ namespace Const{
|
|||||||
|
|
||||||
} // namespace LimeReport
|
} // namespace LimeReport
|
||||||
|
|
||||||
|
Q_DECLARE_OPERATORS_FOR_FLAGS(LimeReport::PreviewHints)
|
||||||
|
|
||||||
#endif // GLOBAL_H
|
#endif // GLOBAL_H
|
||||||
|
@ -149,6 +149,21 @@ void PreviewReportWindow::setErrorMessages(const QStringList &value){
|
|||||||
m_previewReportWidget->setErrorMessages(value);
|
m_previewReportWidget->setErrorMessages(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PreviewReportWindow::setToolBarVisible(bool value)
|
||||||
|
{
|
||||||
|
ui->toolBar->setVisible(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PreviewReportWindow::setStatusBarVisible(bool value)
|
||||||
|
{
|
||||||
|
ui->statusbar->setVisible(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PreviewReportWindow::setMenuVisible(bool value)
|
||||||
|
{
|
||||||
|
ui->menubar->setVisible(value);
|
||||||
|
}
|
||||||
|
|
||||||
QSettings*PreviewReportWindow::settings()
|
QSettings*PreviewReportWindow::settings()
|
||||||
{
|
{
|
||||||
if (m_settings){
|
if (m_settings){
|
||||||
|
@ -62,6 +62,9 @@ public:
|
|||||||
void initPreview(int pagesCount);
|
void initPreview(int pagesCount);
|
||||||
void setSettings(QSettings* value);
|
void setSettings(QSettings* value);
|
||||||
void setErrorMessages(const QStringList& value);
|
void setErrorMessages(const QStringList& value);
|
||||||
|
void setToolBarVisible(bool value);
|
||||||
|
void setStatusBarVisible(bool value);
|
||||||
|
void setMenuVisible(bool value);
|
||||||
QSettings* settings();
|
QSettings* settings();
|
||||||
protected:
|
protected:
|
||||||
void writeSetting();
|
void writeSetting();
|
||||||
|
@ -355,7 +355,7 @@ bool ReportEnginePrivate::printToPDF(const QString &fileName)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportEnginePrivate::previewReport()
|
void ReportEnginePrivate::previewReport(PreviewHints hints)
|
||||||
{
|
{
|
||||||
QTime start = QTime::currentTime();
|
QTime start = QTime::currentTime();
|
||||||
try{
|
try{
|
||||||
@ -375,6 +375,11 @@ void ReportEnginePrivate::previewReport()
|
|||||||
if (!dataManager()->errorsList().isEmpty()){
|
if (!dataManager()->errorsList().isEmpty()){
|
||||||
w->setErrorMessages(dataManager()->errorsList());
|
w->setErrorMessages(dataManager()->errorsList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w->setMenuVisible(!hints.testFlag(HidePreviewMenuBar));
|
||||||
|
w->setStatusBarVisible(!hints.testFlag(HidePreviewStatusBar));
|
||||||
|
w->setToolBarVisible(!hints.testFlag(HidePreviewToolBar));
|
||||||
|
|
||||||
m_activePreview = w;
|
m_activePreview = w;
|
||||||
connect(w,SIGNAL(destroyed(QObject*)), this, SLOT(slotPreviewWindowDestroed(QObject*)));
|
connect(w,SIGNAL(destroyed(QObject*)), this, SLOT(slotPreviewWindowDestroed(QObject*)));
|
||||||
qDebug()<<"render time ="<<start.msecsTo(QTime::currentTime());
|
qDebug()<<"render time ="<<start.msecsTo(QTime::currentTime());
|
||||||
@ -720,12 +725,12 @@ bool ReportEngine::printToPDF(const QString &fileName)
|
|||||||
return d->printToPDF(fileName);
|
return d->printToPDF(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportEngine::previewReport()
|
void ReportEngine::previewReport(PreviewHints hints)
|
||||||
{
|
{
|
||||||
Q_D(ReportEngine);
|
Q_D(ReportEngine);
|
||||||
if (m_settings)
|
if (m_settings)
|
||||||
d->setSettings(m_settings);
|
d->setSettings(m_settings);
|
||||||
d->previewReport();
|
d->previewReport(hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportEngine::designReport()
|
void ReportEngine::designReport()
|
||||||
|
@ -77,7 +77,7 @@ public:
|
|||||||
void printToFile(const QString& fileName);
|
void printToFile(const QString& fileName);
|
||||||
PageDesignIntf *createPreviewScene(QObject *parent = 0);
|
PageDesignIntf *createPreviewScene(QObject *parent = 0);
|
||||||
bool printToPDF(const QString& fileName);
|
bool printToPDF(const QString& fileName);
|
||||||
void previewReport();
|
void previewReport(PreviewHints hints = ShowAllPreviewBars);
|
||||||
void designReport();
|
void designReport();
|
||||||
void setShowProgressDialog(bool value);
|
void setShowProgressDialog(bool value);
|
||||||
IDataSourceManager* dataManager();
|
IDataSourceManager* dataManager();
|
||||||
|
@ -86,7 +86,7 @@ public:
|
|||||||
bool printPages(ReportPages pages, QPrinter *printer, PrintRange printRange = PrintRange());
|
bool printPages(ReportPages pages, QPrinter *printer, PrintRange printRange = PrintRange());
|
||||||
void printToFile(const QString& fileName);
|
void printToFile(const QString& fileName);
|
||||||
bool printToPDF(const QString& fileName);
|
bool printToPDF(const QString& fileName);
|
||||||
void previewReport();
|
void previewReport(PreviewHints hints = ShowAllPreviewBars);
|
||||||
void designReport();
|
void designReport();
|
||||||
void setSettings(QSettings* value);
|
void setSettings(QSettings* value);
|
||||||
void setShowProgressDialog(bool value){m_showProgressDialog = value;}
|
void setShowProgressDialog(bool value){m_showProgressDialog = value;}
|
||||||
|
Loading…
Reference in New Issue
Block a user