0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-11-25 00:18:06 +03:00

Progress indicator has been refactored

This commit is contained in:
Arin Alex
2025-11-21 17:01:13 +03:00
parent d730a1d0b0
commit 253a76a255
4 changed files with 68 additions and 12 deletions

View File

@@ -162,24 +162,18 @@ void MainWindow::on_pushButton_2_clicked()
#ifdef BUILD_WITH_EASY_PROFILER
profiler::dumpBlocksToFile("test.prof");
#endif
// QPrinter* printer = new QPrinter;
// QPrintDialog dialog(printer);
// if (dialog.exec()){
// QMap<QString, QPrinter*> printers;
// printers.insert("default",printer);
// report->printReport(printers);
// }
report->setShowProgressDialog(true);
report->setShowProgressDialog(ui->rb_builtInIndicator->isChecked());
report->previewReport();
}
}
void MainWindow::renderStarted()
{
if (report->isShowProgressDialog()) {
if (ui->rb_customIndicator->isChecked()) {
m_currentPage = 0;
m_progressDialog = new QProgressDialog(tr("Start render"), tr("Cancel"), 0, 0, this);
// m_progressDialog->setWindowModality(Qt::WindowModal);
m_progressDialog = new QProgressDialog(tr("Custom indicator"), tr("Cancel"), 0, 0, this);
m_progressDialog->setWindowTitle(tr("Custom indicator"));
m_progressDialog->setGeometry(QRect(0, 0, 300, 100));
connect(m_progressDialog, SIGNAL(canceled()), report, SLOT(cancelRender()));
QApplication::processEvents();
m_progressDialog->show();

View File

@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>369</width>
<height>192</height>
<height>289</height>
</rect>
</property>
<property name="font">
@@ -95,6 +95,30 @@
</item>
</layout>
</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>
</widget>
</item>