Хранилища Subversion OpenInventory

Редакция

Редакция 228 | Редакция 230 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS

Редакция 228 Редакция 229
Строка 1018... Строка 1018...
1018
1018
1019
  //   int count = root_items_list.count();
1019
  //   int count = root_items_list.count();
1020
1020
1021
    //int count = ui->treeWidget_2->rootIndex();
1021
    //int count = ui->treeWidget_2->rootIndex();
1022
1022
-
 
1023
1023
    doc.clear();//î÷èùàåì äîêóìåíò
1024
    doc.clear();//î÷èùàåì äîêóìåíò
1024
1025
1025
    int list_count;
1026
    int list_count;
1026
    if (rootItems.isEmpty()) return;
1027
    if (rootItems.isEmpty()) return;
1027
1028
Строка 1031... Строка 1032...
1031
1032
1032
    for (int i=0; i < list_count; i++){
1033
    for (int i=0; i < list_count; i++){
1033
1034
1034
       getReport(rootItems.at(i), advanced);
1035
       getReport(rootItems.at(i), advanced);
1035
1036
-
 
1037
-
 
1038
1036
    }
1039
    }
1037
 (bool)QTextDocumentWriter("test.odt").write(&doc);
1040
 (bool)QTextDocumentWriter("test.odt").write(&doc);
1038
}
1041
}
1039
1042
1040
1043
Строка 1066... Строка 1069...
1066
1069
1067
    model_name = model_item->text(0);
1070
    model_name = model_item->text(0);
1068
    if (model_item->checkState(0) == false) return; // ìîäåëü íå âûäåëåíà äëÿ îòîáðàæåíèÿ
1071
    if (model_item->checkState(0) == false) return; // ìîäåëü íå âûäåëåíà äëÿ îòîáðàæåíèÿ
1069
1072
1070
1073
-
 
1074
    newPage();
-
 
1075
/*******************
-
 
1076
    QTextBlockFormat textFormat;
-
 
1077
           textFormat.setPageBreakPolicy(QTextFormat::PageBreak_AlwaysBefore);
-
 
1078
                        cursor->setBlockFormat(textFormat);
-
 
1079

-
 
1080
                        cursor->insertText(tr("Íîâàÿ ñòðàíèöà"));
-
 
1081
                        cursor->insertBlock();
-
 
1082

-
 
1083
                        textFormat.setPageBreakPolicy(QTextFormat::PageBreak_Auto);
-
 
1084
                        cursor->setBlockFormat(textFormat);
-
 
1085
********************/
-
 
1086
-
 
1087
-
 
1088
1071
    if (!(model_item->childCount() > 0)) return; // ìîäåëü ïóñòà (íå ñîäåðæèò êëàññîâ)
1089
    if (!(model_item->childCount() > 0)) return; // ìîäåëü ïóñòà (íå ñîäåðæèò êëàññîâ)
1072
1090
1073
    rootClassID = model_item->child(0)->text(1);
1091
    rootClassID = model_item->child(0)->text(1);
1074
    rootClassInctance = getClassInctance(rootClassID);
1092
    rootClassInctance = getClassInctance(rootClassID);
1075
1093
Строка 1110... Строка 1128...
1110
    QString str_tmp;
1128
    QString str_tmp;
1111
    QTreeWidgetItem * title_item;
1129
    QTreeWidgetItem * title_item;
1112
    QFont font;
1130
    QFont font;
1113
    QIcon icon;
1131
    QIcon icon;
1114
1132
-
 
1133
-
 
1134
-
 
1135
-
 
1136
1115
    font.setBold(true);
1137
    font.setBold(true);
1116
    filtr_empty = filtr.isEmpty();
1138
    filtr_empty = filtr.isEmpty();
1117
1139
1118
    classID = model_item->text(1);
1140
    classID = model_item->text(1);
1119
    modelID = model_item->text(6);
1141
    modelID = model_item->text(6);
Строка 1130... Строка 1152...
1130
    inctance = getClassInctance(classID);
1152
    inctance = getClassInctance(classID);
1131
1153
1132
    if  (!model_item->checkState(0)) return;
1154
    if  (!model_item->checkState(0)) return;
1133
1155
1134
1156
-
 
1157
-
 
1158
-
 
1159
    QTextCharFormat charFormatItalic, charFormatBase;
-
 
1160
    //QFont font;
-
 
1161
    font.setBold(true);
-
 
1162
    font.setItalic(true);
-
 
1163
    //charFormatItalic.setFontItalic(true);
-
 
1164
    charFormatItalic.setFont(font);
-
 
1165
    //charFormatItalic.setFontWeight(16);
-
 
1166
    pos++;
-
 
1167
    for(int i=0; i<pos; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû
1135
    cursor->insertText(className);
1168
    cursor->insertText(className, charFormatItalic);
-
 
1169
    cursor->setCharFormat(charFormatBase);
1136
    cursor->insertText(tr("\n"));
1170
    cursor->insertText(tr("\n"));
1137
1171
-
 
1172
-
 
1173
1138
    sql_str = tr("select * "
1174
    sql_str = tr("select * "
1139
                 " from "       //íàõîäèì âñå îáúåêòû êëàññà â òàáëèöå - õðàíèëèùå îáúåêòîâ êëàññà
1175
                 " from "       //íàõîäèì âñå îáúåêòû êëàññà â òàáëèöå - õðàíèëèùå îáúåêòîâ êëàññà
1140
                 );
1176
                 );
1141
    sql_str.append(inctance);
1177
    sql_str.append(inctance);
1142
1178
Строка 1176... Строка 1212...
1176
1212
1177
    field_ID = q.record().indexOf(tr("ID"));
1213
    field_ID = q.record().indexOf(tr("ID"));
1178
1214
1179
    icon_field_index = q.record().indexOf(tr("Icon"));
1215
    icon_field_index = q.record().indexOf(tr("Icon"));
1180
1216
-
 
1217
    int k=0;
-
 
1218
    QStringList fieldsNamesList;// ñïèñîê èì¸í ïîëåé òàáëèöû
-
 
1219
-
 
1220
-
 
1221
1181
1222
-
 
1223
    while(!q.record().fieldName(k).isEmpty()){// ïîêà íå ïåðåáåð¸ì âñå ïîëÿ
-
 
1224
        fieldsNamesList.append(q.record().fieldName(k++));
-
 
1225
    }
1182
1226
1183
1227
1184
    while(q.next()){
1228
    while(q.next()){
1185
                  if (q.record().count() > 1)
1229
                  if (q.record().count() > 1)
1186
                  {
1230
                  {
Строка 1238... Строка 1282...
1238
                            doc.addResource(QTextDocument::ImageResource, QUrl(fname), pix.toImage());
1282
                            doc.addResource(QTextDocument::ImageResource, QUrl(fname), pix.toImage());
1239
1283
1240
                        // for(int i=0; i<pos; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû
1284
                        // for(int i=0; i<pos; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû
1241
1285
1242
1286
1243
                            for(int i=0; i<pos; i++){ cursor->insertText( tr("\t"));}// äîáàâëÿåì ïðîáåëû
1287
                            for(int i=0; i<pos+1; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû
1244
                            cursor->insertImage(fname);
1288
                            cursor->insertImage(fname);
1245
                          //  cursor->insertText(tr("\n"));
1289
                          //  cursor->insertText(tr("\n"));
1246
1290
1247
                        }
1291
                        }
-
 
1292
                            else for(int i=0; i<pos+1; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû
1248
1293
1249
1294
1250
1295
1251
1296
1252
                        // // // icn.addPixmap(pix);
1297
                        // // // icn.addPixmap(pix);
1253
                        // // // itm->setIcon(0, icn);
1298
                        // // // itm->setIcon(0, icn);
1254
                     //  }
1299
                     //  }
1255
1300
1256
1301
1257
-
 
1258
                    }
1302
                    }
1259
1303
1260
                    for(int i=0; i<pos; i++){ cursor->insertText( tr("\t"));}// äîáàâëÿåì ïðîáåëû
1304
                    else for(int i=0; i<pos+1; i++){ cursor->insertText( tr(" "));}// äîáàâëÿåì ïðîáåëû
1261
-
 
1262
                    cursor->insertText( value_tmp);
1305
                    cursor->insertText( value_tmp);
1263
                    cursor->insertText( tr("\n"));
1306
                    cursor->insertText( tr("\n"));
1264
1307
-
 
1308
-
 
1309
-
 
1310
-
 
1311
                    if(advanced){ // åñëè îò÷åò ðàñøèðåííûé
-
 
1312
-
 
1313
                        sql_str.clear();
-
 
1314
-
 
1315
-
 
1316
-
 
1317
                    }
-
 
1318
-
 
1319
-
 
1320
-
 
1321
                    /********************************************************
-
 
1322
                    textFormat.setPageBreakPolicy(QTextFormat::PageBreak_AlwaysBefore);
-
 
1323
                                 cursor->setBlockFormat(textFormat);
-
 
1324

-
 
1325
                                 cursor->insertText(tr("Íîâàÿ ñòðàíèöà "));
-
 
1326
                                 cursor->insertBlock();
-
 
1327

-
 
1328
                                 textFormat.setPageBreakPolicy(QTextFormat::PageBreak_Auto);
-
 
1329
                                 cursor->setBlockFormat(textFormat);
-
 
1330
                    **********************************************************/
-
 
1331
-
 
1332
1265
//                    itm->setIcon(0, icon);
1333
//                    itm->setIcon(0, icon);
1266
1334
1267
1335
1268
                    for (int i=0; i < model_item->childCount(); i++) // ïðîâåðÿåì, åñòü ëè ó êëàññà äî÷åðíèå êëàññû
1336
                    for (int i=0; i < model_item->childCount(); i++) // ïðîâåðÿåì, åñòü ëè ó êëàññà äî÷åðíèå êëàññû
1269
                    {
1337
                    {
Строка 1283... Строка 1351...
1283
                        filtr_tmp.append(tr("`"));
1351
                        filtr_tmp.append(tr("`"));
1284
                        filtr_tmp.append(pointer_name);
1352
                        filtr_tmp.append(pointer_name);
1285
                        filtr_tmp.append(tr("` = '"));
1353
                        filtr_tmp.append(tr("` = '"));
1286
                        filtr_tmp.append(ID_tmp);
1354
                        filtr_tmp.append(ID_tmp);
1287
                         filtr_tmp.append(tr("'"));
1355
                         filtr_tmp.append(tr("'"));
-
 
1356
-
 
1357
                         printChild(model_item_tmp, filtr_tmp, advanced,  pos+1);
-
 
1358
1288
                        // // // // showObjects(itm,  model_item_tmp, filtr_tmp);
1359
                        // // // // showObjects(itm,  model_item_tmp, filtr_tmp);
1289
                        //MainWindow::showObjectChildrens(ID_tmp, itm, model_item_tmp);
1360
                        //MainWindow::showObjectChildrens(ID_tmp, itm, model_item_tmp);
1290
1361
1291
                    }
1362
                    }
1292
1363
Строка 1305... Строка 1376...
1305
1376
1306
1377
1307
}
1378
}
1308
1379
1309
1380
-
 
1381
void  MainWindow::newPage(int page_number){ //âñòàâëÿåì â äîêóìåíò íîâóþ ñòðàíèöó
-
 
1382
-
 
1383
    QTextBlockFormat textFormat;
-
 
1384
           textFormat.setPageBreakPolicy(QTextFormat::PageBreak_AlwaysBefore);
-
 
1385
                        cursor->setBlockFormat(textFormat);
-
 
1386
-
 
1387
                        cursor->insertText(tr("Íîâàÿ ñòðàíèöà %1").arg(page_number));
-
 
1388
                        cursor->insertBlock();
-
 
1389
-
 
1390
                        textFormat.setPageBreakPolicy(QTextFormat::PageBreak_Auto);
-
 
1391
                        cursor->setBlockFormat(textFormat);
-
 
1392
-
 
1393
-
 
1394
}
-
 
1395
void  MainWindow::newPage(){ //âñòàâëÿåì â äîêóìåíò íîâóþ ñòðàíèöó
-
 
1396
-
 
1397
    QTextBlockFormat textFormat;
-
 
1398
           textFormat.setPageBreakPolicy(QTextFormat::PageBreak_AlwaysBefore);
-
 
1399
                        cursor->setBlockFormat(textFormat);
-
 
1400
-
 
1401
                        //cursor->insertText(tr("Íîâàÿ ñòðàíèöà %1").arg(page_number));
-
 
1402
                        cursor->insertBlock();
-
 
1403
-
 
1404
                        textFormat.setPageBreakPolicy(QTextFormat::PageBreak_Auto);
-
 
1405
                        cursor->setBlockFormat(textFormat);
-
 
1406
-
 
1407
-
 
1408
}