1020,6 → 1020,7 |
|
//int count = ui->treeWidget_2->rootIndex(); |
|
|
doc.clear();//î÷èùàåì äîêóìåíò |
|
int list_count; |
1033,6 → 1034,8 |
|
getReport(rootItems.at(i), advanced); |
|
|
|
} |
(bool)QTextDocumentWriter("test.odt").write(&doc); |
} |
1068,6 → 1071,21 |
if (model_item->checkState(0) == false) return; // ìîäåëü íå âûäåëåíà äëÿ îòîáðàæåíèÿ |
|
|
newPage(); |
/******************* |
QTextBlockFormat textFormat; |
textFormat.setPageBreakPolicy(QTextFormat::PageBreak_AlwaysBefore); |
cursor->setBlockFormat(textFormat); |
|
cursor->insertText(tr("Íîâàÿ ñòðàíèöà")); |
cursor->insertBlock(); |
|
textFormat.setPageBreakPolicy(QTextFormat::PageBreak_Auto); |
cursor->setBlockFormat(textFormat); |
********************/ |
|
|
|
if (!(model_item->childCount() > 0)) return; // ìîäåëü ïóñòà (íå ñîäåðæèò êëàññîâ) |
|
rootClassID = model_item->child(0)->text(1); |
1112,6 → 1130,10 |
QFont font; |
QIcon icon; |
|
|
|
|
|
font.setBold(true); |
filtr_empty = filtr.isEmpty(); |
|
1132,9 → 1154,23 |
if (!model_item->checkState(0)) return; |
|
|
cursor->insertText(className); |
|
|
QTextCharFormat charFormatItalic, charFormatBase; |
//QFont font; |
font.setBold(true); |
font.setItalic(true); |
//charFormatItalic.setFontItalic(true); |
charFormatItalic.setFont(font); |
//charFormatItalic.setFontWeight(16); |
pos++; |
for(int i=0; i<pos; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû |
cursor->insertText(className, charFormatItalic); |
cursor->setCharFormat(charFormatBase); |
cursor->insertText(tr("\n")); |
|
|
|
sql_str = tr("select * " |
" from " //íàõîäèì âñå îáúåêòû êëàññà â òàáëèöå - õðàíèëèùå îáúåêòîâ êëàññà |
); |
1178,9 → 1214,17 |
|
icon_field_index = q.record().indexOf(tr("Icon")); |
|
int k=0; |
QStringList fieldsNamesList;// ñïèñîê èì¸í ïîëåé òàáëèöû |
|
|
|
|
while(!q.record().fieldName(k).isEmpty()){// ïîêà íå ïåðåáåð¸ì âñå ïîëÿ |
fieldsNamesList.append(q.record().fieldName(k++)); |
} |
|
|
while(q.next()){ |
if (q.record().count() > 1) |
{ |
1240,11 → 1284,12 |
// for(int i=0; i<pos; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû |
|
|
for(int i=0; i<pos; i++){ cursor->insertText( tr("\t"));}// äîáàâëÿåì ïðîáåëû |
for(int i=0; i<pos+1; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû |
cursor->insertImage(fname); |
// cursor->insertText(tr("\n")); |
|
} |
else for(int i=0; i<pos+1; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû |
|
|
|
1254,14 → 1299,37 |
// } |
|
|
|
} |
|
for(int i=0; i<pos; i++){ cursor->insertText( tr("\t"));}// äîáàâëÿåì ïðîáåëû |
|
else for(int i=0; i<pos+1; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû |
cursor->insertText( value_tmp); |
cursor->insertText( tr("\n")); |
|
|
|
|
if(advanced){ // åñëè îò÷åò ðàñøèðåííûé |
|
sql_str.clear(); |
|
|
|
} |
|
|
|
/******************************************************** |
textFormat.setPageBreakPolicy(QTextFormat::PageBreak_AlwaysBefore); |
cursor->setBlockFormat(textFormat); |
|
cursor->insertText(tr("Íîâàÿ ñòðàíèöà ")); |
cursor->insertBlock(); |
|
textFormat.setPageBreakPolicy(QTextFormat::PageBreak_Auto); |
cursor->setBlockFormat(textFormat); |
**********************************************************/ |
|
|
// itm->setIcon(0, icon); |
|
|
1285,6 → 1353,9 |
filtr_tmp.append(tr("` = '")); |
filtr_tmp.append(ID_tmp); |
filtr_tmp.append(tr("'")); |
|
printChild(model_item_tmp, filtr_tmp, advanced, pos+1); |
|
// // // // showObjects(itm, model_item_tmp, filtr_tmp); |
//MainWindow::showObjectChildrens(ID_tmp, itm, model_item_tmp); |
|
1307,3 → 1378,31 |
} |
|
|
void MainWindow::newPage(int page_number){ //âñòàâëÿåì â äîêóìåíò íîâóþ ñòðàíèöó |
|
QTextBlockFormat textFormat; |
textFormat.setPageBreakPolicy(QTextFormat::PageBreak_AlwaysBefore); |
cursor->setBlockFormat(textFormat); |
|
cursor->insertText(tr("Íîâàÿ ñòðàíèöà %1").arg(page_number)); |
cursor->insertBlock(); |
|
textFormat.setPageBreakPolicy(QTextFormat::PageBreak_Auto); |
cursor->setBlockFormat(textFormat); |
|
|
} |
void MainWindow::newPage(){ //âñòàâëÿåì â äîêóìåíò íîâóþ ñòðàíèöó |
|
QTextBlockFormat textFormat; |
textFormat.setPageBreakPolicy(QTextFormat::PageBreak_AlwaysBefore); |
cursor->setBlockFormat(textFormat); |
|
//cursor->insertText(tr("Íîâàÿ ñòðàíèöà %1").arg(page_number)); |
cursor->insertBlock(); |
|
textFormat.setPageBreakPolicy(QTextFormat::PageBreak_Auto); |
cursor->setBlockFormat(textFormat); |
|
|
} |