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:
parent
2cc8569b1c
commit
aa040e8031
@ -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();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user