- Timestamp:
- Mar 24, 2011, 8:06:01 PM (14 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/defaults.h
r151 r158 103 103 #define DEF_ALTERNATE_COLOR QColor(0xA00000) 104 104 105 #ifndef QT_NO_PRINTER 106 # define DEF_PAGE_SIZE QPrinter::A4 107 # define DEF_PAGE_ORIENTATION QPrinter::Portrait 108 # define DEF_MARGIN_LEFT 25 109 # define DEF_MARGIN_TOP 15 110 # define DEF_MARGIN_RIGHT DEF_MARGIN_TOP 111 # define DEF_MARGIN_BOTTOM DEF_MARGIN_TOP 112 #endif 113 105 114 #endif // DEFAULTS_H -
trunk/src/globals.h
r157 r158 142 142 #ifndef DOXYGEN_EXCLUDE 143 143 144 #ifndef QT_NO_PRINTER 145 Q_DECLARE_METATYPE(QPrinter::PageSize) 146 Q_DECLARE_METATYPE(QPrinter::Orientation) 147 #endif 148 144 149 #ifdef HANDHELD 145 150 # define ICON_SIZE "48x48" -
trunk/src/mainwindow.cpp
r157 r158 61 61 #ifndef QT_NO_PRINTER 62 62 printer = new QPrinter(QPrinter::HighResolution); 63 settings->beginGroup("Printer"); 64 printer->setPageSize(qvariant_cast<QPrinter::PageSize>(settings->value("PageSize", DEF_PAGE_SIZE))); 65 printer->setOrientation(qvariant_cast<QPrinter::Orientation>(settings->value("PageOrientation", DEF_PAGE_ORIENTATION))); 66 printer->setPageMargins( 67 settings->value("MarginLeft", DEF_MARGIN_LEFT).toDouble(), 68 settings->value("MarginTop", DEF_MARGIN_TOP).toDouble(), 69 settings->value("MarginRight", DEF_MARGIN_RIGHT).toDouble(), 70 settings->value("MarginBottom", DEF_MARGIN_BOTTOM).toDouble(), 71 QPrinter::Millimeter); 72 settings->endGroup(); 63 73 #endif // QT_NO_PRINTER 64 74 … … 347 357 connect(&ppd,SIGNAL(paintRequested(QPrinter *)),SLOT(printPreview(QPrinter *))); 348 358 ppd.exec(); 359 settings->beginGroup("Printer"); 360 settings->setValue("PageSize", printer->pageSize()); 361 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?). */ 364 settings->endGroup(); 349 365 } 350 366 … … 783 799 cur.insertText(tr("Variant #%1 Task").arg(spinVariant->value()), fmt_default); 784 800 cur.insertBlock(fmt_paragraph); 785 cur.insertText(tr("Task:") );801 cur.insertText(tr("Task:"), fmt_default); 786 802 outputMatrix(cur, matrix); 787 803 if (settings->value("Output/ShowGraph", DEF_SHOW_GRAPH).toBool()) { … … 838 854 cur.beginEditBlock(); 839 855 cur.insertBlock(fmt_paragraph); 840 cur.insertText(tr("Step #%1").arg(n) );856 cur.insertText(tr("Step #%1").arg(n), fmt_default); 841 857 if (settings->value("Output/ShowMatrix", DEF_SHOW_MATRIX).toBool() && (!settings->value("Output/UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT).toBool() || (settings->value("Output/UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT).toBool() && (spinCities->value() <= settings->value("Output/ShowMatrixLimit", DEF_SHOW_MATRIX_LIMIT).toInt())))) { 842 858 outputMatrix(cur, *step); … … 1173 1189 solutionText->document()->setDefaultFont(qvariant_cast<QFont>(settings->value("Output/Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE)))); 1174 1190 1175 fmt_paragraph.setTopMargin( 0);1191 fmt_paragraph.setTopMargin(5); 1176 1192 fmt_paragraph.setRightMargin(10); 1177 1193 fmt_paragraph.setBottomMargin(0); … … 1180 1196 fmt_table.setTopMargin(5); 1181 1197 fmt_table.setRightMargin(10); 1182 fmt_table.setBottomMargin( 5);1198 fmt_table.setBottomMargin(0); 1183 1199 fmt_table.setLeftMargin(10); 1184 1200 fmt_table.setBorder(0);
Note: See TracChangeset
for help on using the changeset viewer.