Хранилища Subversion OpenInventory

Сравнить редакции

Не учитывать пробелы Редакция 229 → Редакция 228

/trunk/DBViewer/mainwindow.cpp
1020,7 → 1020,6
 
//int count = ui->treeWidget_2->rootIndex();
 
 
doc.clear();//î÷èùàåì äîêóìåíò
 
int list_count;
1034,8 → 1033,6
 
getReport(rootItems.at(i), advanced);
 
 
 
}
(bool)QTextDocumentWriter("test.odt").write(&doc);
}
1071,21 → 1068,6
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);
1130,10 → 1112,6
QFont font;
QIcon icon;
 
 
 
 
 
font.setBold(true);
filtr_empty = filtr.isEmpty();
 
1154,23 → 1132,9
if (!model_item->checkState(0)) return;
 
 
 
 
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(className);
cursor->insertText(tr("\n"));
 
 
 
sql_str = tr("select * "
" from " //íàõîäèì âñå îáúåêòû êëàññà â òàáëèöå - õðàíèëèùå îáúåêòîâ êëàññà
);
1214,17 → 1178,9
 
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)
{
1284,12 → 1240,11
// for(int i=0; i<pos; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû
 
 
for(int i=0; i<pos+1; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû
for(int i=0; i<pos; i++){ cursor->insertText( tr("\t"));}// äîáàâëÿåì ïðîáåëû
cursor->insertImage(fname);
// cursor->insertText(tr("\n"));
 
}
else for(int i=0; i<pos+1; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû
 
 
 
1299,37 → 1254,14
// }
 
 
 
}
 
else for(int i=0; i<pos+1; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû
for(int i=0; i<pos; i++){ cursor->insertText( tr("\t"));}// äîáàâëÿåì ïðîáåëû
 
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);
 
 
1353,9 → 1285,6
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);
 
1378,31 → 1307,3
}
 
 
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);
 
 
}
/trunk/DBViewer/mainwindow.h
169,8 → 169,6
 
void printChild(QTreeWidgetItem * model_item, QString filtr, bool advanced, int pos);//â ðàïîðò äîáàâëÿåì äî÷åðíèå êëàññû
 
void newPage(int page_number);//â ðàïîðò âñòàâëÿåì íîâóþ ñòðàíèöó
void newPage();//â ðàïîðò âñòàâëÿåì íîâóþ ñòðàíèöó
 
SpinBoxDelegate spinDelegate;
QItemDelegate standart_delegate;