mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-24 04:33:03 +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);
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user