Changeset 55 in tspsg-svn
- Timestamp:
- Aug 11, 2009, 6:54:01 PM (15 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/globals.h
r54 r55 39 39 #define DEF_RAND_MAX 10 40 40 #define DEF_NUM_CITIES 5 41 #define DEF_OFFSET 10042 41 #define DEF_FONT_FAMILY "Courier New" 43 42 #define DEF_FONT_SIZE 10 -
trunk/src/mainwindow.cpp
r54 r55 280 280 static QString selectedFile; 281 281 if (selectedFile.isEmpty()) 282 #ifndef QT_NO_PRINTER 283 selectedFile = "solution.pdf"; 284 #else 282 285 selectedFile = "solution.html"; 286 #endif // QT_NO_PRINTER 283 287 QFileDialog sd(this); 284 288 sd.setAcceptMode(QFileDialog::AcceptSave); 285 QStringList filters(trUtf8("HTML Files") + " (*.html *.htm)"); 289 QStringList filters; 290 #ifndef QT_NO_PRINTER 291 filters.append(trUtf8("PDF Files") + "(*.pdf)"); 292 #endif 293 filters.append(trUtf8("HTML Files") + " (*.html *.htm)"); 286 294 #if QT_VERSION >= 0x040500 287 295 filters.append(trUtf8("OpenDocument Files") + " (*.odt)"); … … 297 305 selectedFile = files.first(); 298 306 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 307 #ifndef QT_NO_PRINTER 308 if (selectedFile.endsWith(".pdf",Qt::CaseInsensitive)) { 309 QPrinter printer(QPrinter::HighResolution); 310 printer.setOutputFormat(QPrinter::PdfFormat); 311 printer.setOutputFileName(selectedFile); 312 solutionText->document()->print(&printer); 313 QApplication::restoreOverrideCursor(); 314 return; 315 } 316 #endif 299 317 #if QT_VERSION >= 0x040500 300 318 QTextDocumentWriter dw(selectedFile); … … 488 506 { 489 507 // TODO: Normal about window :-) 490 QString about = QString::fromUtf8("TSPSG -TSP Solver and Generator\n");508 QString about = QString::fromUtf8("TSPSG: TSP Solver and Generator\n"); 491 509 about += QString::fromUtf8(" Version: "BUILD_VERSION"\n"); 492 510 about += QString::fromUtf8(" Copyright (C) 2007-%1 Lёppa <contacts[at]oleksii[dot]name>\n").arg(QDate::currentDate().toString("yyyy")); -
trunk/src/tspsolver.cpp
r54 r55 97 97 for (int r = 0; r < nCities; r++) 98 98 for (int c = 0; c < nCities; c++) 99 // if ((matrix [r][c]== 0) && !forbidden.values(r).contains(c)) {99 // if ((matrix.at(r).at(c) == 0) && !forbidden.values(r).contains(c)) { 100 100 if (matrix.at(r).at(c) == 0) { 101 101 sum = findMinInRow(r,matrix,c) + findMinInCol(c,matrix,r); … … 105 105 nCol = c; 106 106 alts = false; 107 } else if ( sum == h)107 } else if ((sum == h) && !hasSubCycles(r,c)) 108 108 alts = true; 109 109 }
Note: See TracChangeset
for help on using the changeset viewer.