mirror of
https://github.com/fralx/LimeReport.git
synced 2025-11-24 16:18:04 +03:00
Finish 1.7.21
This commit is contained in:
@@ -162,24 +162,18 @@ void MainWindow::on_pushButton_2_clicked()
|
|||||||
#ifdef BUILD_WITH_EASY_PROFILER
|
#ifdef BUILD_WITH_EASY_PROFILER
|
||||||
profiler::dumpBlocksToFile("test.prof");
|
profiler::dumpBlocksToFile("test.prof");
|
||||||
#endif
|
#endif
|
||||||
// QPrinter* printer = new QPrinter;
|
report->setShowProgressDialog(ui->rb_builtInIndicator->isChecked());
|
||||||
// QPrintDialog dialog(printer);
|
|
||||||
// if (dialog.exec()){
|
|
||||||
// QMap<QString, QPrinter*> printers;
|
|
||||||
// printers.insert("default",printer);
|
|
||||||
// report->printReport(printers);
|
|
||||||
// }
|
|
||||||
report->setShowProgressDialog(true);
|
|
||||||
report->previewReport();
|
report->previewReport();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::renderStarted()
|
void MainWindow::renderStarted()
|
||||||
{
|
{
|
||||||
if (report->isShowProgressDialog()) {
|
if (ui->rb_customIndicator->isChecked()) {
|
||||||
m_currentPage = 0;
|
m_currentPage = 0;
|
||||||
m_progressDialog = new QProgressDialog(tr("Start render"), tr("Cancel"), 0, 0, this);
|
m_progressDialog = new QProgressDialog(tr("Custom indicator"), tr("Cancel"), 0, 0, this);
|
||||||
// m_progressDialog->setWindowModality(Qt::WindowModal);
|
m_progressDialog->setWindowTitle(tr("Custom indicator"));
|
||||||
|
m_progressDialog->setGeometry(QRect(0, 0, 300, 100));
|
||||||
connect(m_progressDialog, SIGNAL(canceled()), report, SLOT(cancelRender()));
|
connect(m_progressDialog, SIGNAL(canceled()), report, SLOT(cancelRender()));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
m_progressDialog->show();
|
m_progressDialog->show();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>369</width>
|
<width>369</width>
|
||||||
<height>192</height>
|
<height>289</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@@ -95,6 +95,30 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="rb_builtInIndicator">
|
||||||
|
<property name="text">
|
||||||
|
<string>Buildin progress indicator</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="rb_customIndicator">
|
||||||
|
<property name="text">
|
||||||
|
<string>Custom progress indicator</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="rb_noIndicator">
|
||||||
|
<property name="text">
|
||||||
|
<string>No progress indicator</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ ReportEnginePrivate::ReportEnginePrivate(QObject* parent):
|
|||||||
SLOT(slotDataSourceCollectionLoaded(QString)));
|
SLOT(slotDataSourceCollectionLoaded(QString)));
|
||||||
connect(m_fileWatcher, SIGNAL(fileChanged(const QString&)), this,
|
connect(m_fileWatcher, SIGNAL(fileChanged(const QString&)), this,
|
||||||
SLOT(slotLoadFromFile(const QString&)));
|
SLOT(slotLoadFromFile(const QString&)));
|
||||||
|
connect(this, SIGNAL(renderPageFinished(int)), this, SLOT(slotPageRenderFinished(int)));
|
||||||
|
connect(this, SIGNAL(renderFinished()), this, SLOT(slotRenderFinished()));
|
||||||
|
|
||||||
#ifndef HAVE_REPORT_DESIGNER
|
#ifndef HAVE_REPORT_DESIGNER
|
||||||
|
|
||||||
@@ -263,6 +265,34 @@ void ReportEnginePrivate::slotDesignerWindowDestroyed(QObject* window)
|
|||||||
dataManager()->setDesignTime(false);
|
dataManager()->setDesignTime(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReportEnginePrivate::slotRenderStarted()
|
||||||
|
{
|
||||||
|
if (m_showProgressDialog) {
|
||||||
|
if (!m_progressDialog) {
|
||||||
|
m_progressDialog = new QProgressDialog(tr("Start render"), tr("Cancel"), 0, 0, 0);
|
||||||
|
connect(m_progressDialog, SIGNAL(canceled()), this, SLOT(cancelRender()));
|
||||||
|
}
|
||||||
|
m_progressDialog->show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportEnginePrivate::slotPageRenderFinished(int renderedPageCount)
|
||||||
|
{
|
||||||
|
if (m_progressDialog) {
|
||||||
|
m_progressDialog->setLabelText(QString::number(renderedPageCount) + tr(" page rendered"));
|
||||||
|
m_progressDialog->setValue(renderedPageCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReportEnginePrivate::slotRenderFinished()
|
||||||
|
{
|
||||||
|
if (m_progressDialog){
|
||||||
|
m_progressDialog->close();
|
||||||
|
delete m_progressDialog;
|
||||||
|
m_progressDialog = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ReportEnginePrivate::clearReport()
|
void ReportEnginePrivate::clearReport()
|
||||||
{
|
{
|
||||||
foreach (PageDesignIntf* page, m_pages)
|
foreach (PageDesignIntf* page, m_pages)
|
||||||
@@ -560,6 +590,7 @@ void ReportEnginePrivate::previewReport(QPrinter* printer, PreviewHints hints)
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
dataManager()->setDesignTime(false);
|
dataManager()->setDesignTime(false);
|
||||||
|
connect(this, SIGNAL(renderStarted()), this, SLOT(slotRenderStarted()));
|
||||||
ReportPages pages = renderToPages();
|
ReportPages pages = renderToPages();
|
||||||
dataManager()->setDesignTime(true);
|
dataManager()->setDesignTime(true);
|
||||||
showPreviewWindow(pages, hints, printer);
|
showPreviewWindow(pages, hints, printer);
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
|
#include <QProgressDialog>
|
||||||
|
|
||||||
class QFileSystemWatcher;
|
class QFileSystemWatcher;
|
||||||
|
|
||||||
@@ -315,11 +316,16 @@ protected:
|
|||||||
PageDesignIntf* createPage(const QString& pageName = "", bool preview = false);
|
PageDesignIntf* createPage(const QString& pageName = "", bool preview = false);
|
||||||
bool showPreviewWindow(ReportPages pages, PreviewHints hints, QPrinter* printer);
|
bool showPreviewWindow(ReportPages pages, PreviewHints hints, QPrinter* printer);
|
||||||
void internalPrintPages(ReportPages pages, QPrinter& printer);
|
void internalPrintPages(ReportPages pages, QPrinter& printer);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void slotDataSourceCollectionLoaded(const QString& collectionName);
|
void slotDataSourceCollectionLoaded(const QString& collectionName);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void slotPreviewWindowDestroyed(QObject* window);
|
void slotPreviewWindowDestroyed(QObject* window);
|
||||||
void slotDesignerWindowDestroyed(QObject* window);
|
void slotDesignerWindowDestroyed(QObject* window);
|
||||||
|
void slotRenderStarted();
|
||||||
|
void slotPageRenderFinished(int renderedPageCount);
|
||||||
|
void slotRenderFinished();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// ICollectionContainer
|
// ICollectionContainer
|
||||||
@@ -391,6 +397,7 @@ private:
|
|||||||
QColor m_previewPageBackgroundColor;
|
QColor m_previewPageBackgroundColor;
|
||||||
QVector<WatermarkSetting> m_watermarks;
|
QVector<WatermarkSetting> m_watermarks;
|
||||||
BaseDesignIntf* createWatermark(PageDesignIntf* page, WatermarkSetting watermarkSetting);
|
BaseDesignIntf* createWatermark(PageDesignIntf* page, WatermarkSetting watermarkSetting);
|
||||||
|
QProgressDialog* m_progressDialog = 0;
|
||||||
bool m_saveToFileVisible;
|
bool m_saveToFileVisible;
|
||||||
bool m_printToPdfVisible;
|
bool m_printToPdfVisible;
|
||||||
bool m_printVisible;
|
bool m_printVisible;
|
||||||
|
|||||||
Reference in New Issue
Block a user