Changeset 6dfdef0c3e in tspsg for src/mainwindow.cpp
- Timestamp:
- Aug 11, 2009, 6:54:01 PM (15 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- 281303f1f7
- Parents:
- c10297cf73
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mainwindow.cpp
rc10297cf73 r6dfdef0c3e 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"));
Note: See TracChangeset
for help on using the changeset viewer.