Changeset 160 in tspsg-svn for trunk/src/mainwindow.cpp
- Timestamp:
- Apr 9, 2011, 3:38:21 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mainwindow.cpp
r159 r160 62 62 printer = new QPrinter(QPrinter::HighResolution); 63 63 settings->beginGroup("Printer"); 64 printer->setPa geSize(qvariant_cast<QPrinter::PageSize>(settings->value("PageSize", DEF_PAGE_SIZE)));64 printer->setPaperSize(qvariant_cast<QPrinter::PaperSize>(settings->value("PaperSize", DEF_PAGE_SIZE))); 65 65 printer->setOrientation(qvariant_cast<QPrinter::Orientation>(settings->value("PageOrientation", DEF_PAGE_ORIENTATION))); 66 66 printer->setPageMargins( … … 357 357 connect(&ppd,SIGNAL(paintRequested(QPrinter *)),SLOT(printPreview(QPrinter *))); 358 358 ppd.exec(); 359 360 qreal l, t, r, b; 361 printer->getPageMargins(&l, &t, &r, &b, QPrinter::Millimeter); 362 359 363 settings->beginGroup("Printer"); 360 settings->setValue("Pa geSize", printer->pageSize());364 settings->setValue("PaperSize", printer->paperSize()); 361 365 settings->setValue("PageOrientation", printer->orientation()); 362 /*! \todo TODO: There's no way to get printer margins set with QPrinter::setPageMargins() 363 for now. Have to figure out a workaround for this (calculate it from other metrics?). */ 366 settings->setValue("MarginLeft", l); 367 settings->setValue("MarginTop", t); 368 settings->setValue("MarginRight", r); 369 settings->setValue("MarginBottom", b); 364 370 settings->endGroup(); 365 371 } … … 1122 1128 void MainWindow::drawNode(QPainter &pic, int nstep, bool left, SStep *step) 1123 1129 { 1124 intr;1130 qreal r; 1125 1131 if (settings->value("Output/HQGraph", DEF_HQ_GRAPH).toBool()) 1126 1132 r = logicalDpiX() / 1.27; … … 1128 1134 r = logicalDpiX() / 2.54; 1129 1135 #ifdef Q_WS_S60 1130 1136 /*! \hack HACK: Solution graph on Symbian is visually larger than on 1131 1137 * Windows Mobile. This coefficient makes it about the same size. 1132 1138 */ … … 1530 1536 else if (settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool()) 1531 1537 settings->setValue(OS"/LastUsed/TaskSavePath", QFileInfo(file).path()); 1538 if (QFileInfo(file).suffix().isEmpty()) { 1539 file.append(".tspt"); 1540 } 1532 1541 1533 1542 if (tspmodel->saveTask(file)) {
Note: See TracChangeset
for help on using the changeset viewer.