0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 08:34:38 +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); resize(screenWidth*0.8, screenHeight*0.8);
move(x, y); move(x, y);
if (QFile::exists(QApplication::applicationDirPath()+"/demo_reports/categories.lrxml")){
m_report.loadFromFile(QApplication::applicationDirPath()+"/demo_reports/categories.lrxml"); if (ui->treeWidget->topLevelItemCount()>0){
m_preview->refreshPages(); 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();
} }