0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 00:33:02 +03:00

LRDemo_r2 will get first template file to show

This commit is contained in:
Arin Alexander 2017-03-03 02:23:23 +03:00
parent 2cc8569b1c
commit aa040e8031

View File

@ -50,10 +50,21 @@ MainWindow::MainWindow(QWidget *parent) :
resize(screenWidth*0.8, screenHeight*0.8);
move(x, y);
if (QFile::exists(QApplication::applicationDirPath()+"/demo_reports/categories.lrxml")){
m_report.loadFromFile(QApplication::applicationDirPath()+"/demo_reports/categories.lrxml");
m_preview->refreshPages();
if (ui->treeWidget->topLevelItemCount()>0){
int index = 0;
while (index<ui->treeWidget->topLevelItemCount()){
if (ui->treeWidget->topLevelItem(index)->childCount()>0)
++index;
else {
m_report.loadFromFile(ui->treeWidget->topLevelItem(index)->data(0,Qt::UserRole).toString());
ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(index));
break;
}
}
}
m_preview->refreshPages();
}