mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-09-23 16:49:07 +03:00
Easyprofiler added
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
#include <QDebug>
|
||||
#include <QStringListModel>
|
||||
|
||||
#include "easy/profiler.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow), m_progressDialog(0), m_customers(0), m_orders(0)
|
||||
@@ -110,22 +112,32 @@ MainWindow::~MainWindow()
|
||||
|
||||
void MainWindow::on_pushButton_clicked()
|
||||
{
|
||||
EASY_PROFILER_ENABLE;
|
||||
EASY_BLOCK("design report");
|
||||
report->dataManager()->clearUserVariables();
|
||||
if (!ui->leVariableName->text().isEmpty() && !ui->leVariableValue->text().isEmpty()){
|
||||
report->dataManager()->setReportVariable(ui->leVariableName->text(), ui->leVariableValue->text());
|
||||
}
|
||||
report->setShowProgressDialog(false);
|
||||
report->designReport();
|
||||
EASY_END_BLOCK;
|
||||
profiler::dumpBlocksToFile("test.prof");
|
||||
}
|
||||
|
||||
void MainWindow::on_pushButton_2_clicked()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this,"Select report file",QApplication::applicationDirPath()+"/demo_reports/","*.lrxml");
|
||||
if (!fileName.isEmpty()) {
|
||||
EASY_PROFILER_ENABLE;
|
||||
EASY_BLOCK("Load file");
|
||||
report->loadFromFile(fileName);
|
||||
EASY_END_BLOCK;
|
||||
EASY_BLOCK("Set report variable");
|
||||
if (!ui->leVariableName->text().isEmpty() && !ui->leVariableValue->text().isEmpty()){
|
||||
report->dataManager()->setReportVariable(ui->leVariableName->text(), ui->leVariableValue->text());
|
||||
}
|
||||
EASY_END_BLOCK;
|
||||
profiler::dumpBlocksToFile("test.prof");
|
||||
report->previewReport();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user