These changes worked for me with version 2.0.5.0-1. I changed the qprinter files from Qt 3.3.8b with similar changes, and the printer dialog now presents US paper sizes. One complication is that Ghostscript doesn't support the ANSI sizes, but only the architectural sizes. This is unfortunate since I like to convert the files to PDF before running off to the copy center to get larger size drawings printed.
I copied these files to "qcadlib/src/engine", and changed the qcadlib/src/qcadlib.pro to include them, and "qprinter_p.h", "qpsprinter_p.h", which also need to be copied to "qcadlib/src/engine", but don't need any changes.
Code: Select all
--- /usr/src/packages/SOURCES/qt-x11-free-3.3.8b/src/dialogs/qprintdialog.cpp 2008-01-15 14:09:13.000000000 -0500
+++ ./qprintdialog.cpp 2009-05-31 12:07:45.000000000 -0400
@@ -1345,6 +1345,16 @@
isc( d, tr( "C5E (163 x 229 mm)" ), QPrinter::C5E );
isc( d, tr( "DLE (110 x 220 mm)" ), QPrinter::DLE );
isc( d, tr( "Executive (7.5x10 inches, 191x254 mm)" ), QPrinter::Executive );
+ isc( d, tr( "Ansi B (11 x 17 inches, 279.4 x 431.8 mm)"), QPrinter::AnsiB);
+ isc( d, tr( "Ansi C (17 x 22 inches 431.8 x 558.8 mm)"), QPrinter::AnsiC);
+ isc( d, tr( "Ansi D (22 x 34 inches, 558.8 x 863.6 mm)"), QPrinter::AnsiD);
+ isc( d, tr( "Ansi E (34 x 44 inches, 863.6 x 1117.6 mm)"), QPrinter::AnsiE);
+ isc( d, tr( "Arch A (9 x 12 inches, 228.6 x 304.8 mm)"), QPrinter::ArchA);
+ isc( d, tr( "Arch B (12 x 18 inches, 304.8 x 457.2 mm)"), QPrinter::ArchB);
+ isc( d, tr( "Arch C (18 x 24 inches, 457.2 x 609.6 mm)"), QPrinter::ArchC);
+ isc( d, tr( "Arch D (24 x 36 inches, 609.6 x 914.4 mm)"), QPrinter::ArchD);
+ isc( d, tr( "Arch E1 (30 x 42 inches, 762.0 x 1066.8 mm)"), QPrinter::ArchE1);
+ isc( d, tr( "Arch E (36 x 48 inches, 914.4, 1219.2 mm)"), QPrinter::ArchE);
isc( d, tr( "Folio (210 x 330 mm)" ), QPrinter::Folio );
isc( d, tr( "Ledger (432 x 279 mm)" ), QPrinter::Ledger );
isc( d, tr( "Legal (8.5x14 inches, 216x356 mm)" ), QPrinter::Legal );
glenn@DepotRd:~/qcad> cat printer.patch
--- /usr/src/packages/SOURCES/qt-x11-free-3.3.8b/src/dialogs/qprintdialog.cpp 2008-01-15 14:09:13.000000000 -0500
+++ ./qprintdialog.cpp 2009-05-31 12:07:45.000000000 -0400
@@ -1345,6 +1345,16 @@
isc( d, tr( "C5E (163 x 229 mm)" ), QPrinter::C5E );
isc( d, tr( "DLE (110 x 220 mm)" ), QPrinter::DLE );
isc( d, tr( "Executive (7.5x10 inches, 191x254 mm)" ), QPrinter::Executive );
+ isc( d, tr( "Ansi B (11 x 17 inches, 279.4 x 431.8 mm)"), QPrinter::AnsiB);
+ isc( d, tr( "Ansi C (17 x 22 inches 431.8 x 558.8 mm)"), QPrinter::AnsiC);
+ isc( d, tr( "Ansi D (22 x 34 inches, 558.8 x 863.6 mm)"), QPrinter::AnsiD);
+ isc( d, tr( "Ansi E (34 x 44 inches, 863.6 x 1117.6 mm)"), QPrinter::AnsiE);
+ isc( d, tr( "Arch A (9 x 12 inches, 228.6 x 304.8 mm)"), QPrinter::ArchA);
+ isc( d, tr( "Arch B (12 x 18 inches, 304.8 x 457.2 mm)"), QPrinter::ArchB);
+ isc( d, tr( "Arch C (18 x 24 inches, 457.2 x 609.6 mm)"), QPrinter::ArchC);
+ isc( d, tr( "Arch D (24 x 36 inches, 609.6 x 914.4 mm)"), QPrinter::ArchD);
+ isc( d, tr( "Arch E1 (30 x 42 inches, 762.0 x 1066.8 mm)"), QPrinter::ArchE1);
+ isc( d, tr( "Arch E (36 x 48 inches, 914.4, 1219.2 mm)"), QPrinter::ArchE);
isc( d, tr( "Folio (210 x 330 mm)" ), QPrinter::Folio );
isc( d, tr( "Ledger (432 x 279 mm)" ), QPrinter::Ledger );
isc( d, tr( "Legal (8.5x14 inches, 216x356 mm)" ), QPrinter::Legal );
--- /usr/src/packages/SOURCES/qt-x11-free-3.3.8b/src/kernel/qprinter.h 2008-01-15 14:09:13.000000000 -0500
+++ ./qprinter.h 2009-05-31 11:31:34.000000000 -0400
@@ -66,6 +66,8 @@
enum Orientation { Portrait, Landscape };
enum PageSize { A4, B5, Letter, Legal, Executive,
+ AnsiB, AnsiC, AnsiD, AnsiE, ArchA, ArchB,
+ ArchC, ArchD, ArchE1, ArchE,
A0, A1, A2, A3, A5, A6, A7, A8, A9, B0, B1,
B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E,
DLE, Folio, Ledger, Tabloid, Custom, NPageSize = Custom };
--- /usr/src/packages/SOURCES/qt-x11-free-3.3.8b/src/kernel/qprinter.cpp 2008-01-15 14:09:13.000000000 -0500
+++ ./qprinter.cpp 2009-05-31 12:13:32.000000000 -0400
@@ -237,6 +237,16 @@
\value Comm10E 105 x 241 mm, US Common #10 Envelope
\value DLE 110 x 220 mm
\value Executive 7.5 x 10 inches, 191 x 254 mm
+ \value AnsiB 11 x 17 inches, 279.4 x 431.8 mm
+ \value AnsiC 17 x 22 inches 431.8 x 558.8 mm
+ \value AnsiD 22 x 34 inches, 558.8 x 863.6 mm
+ \value AnsiE 34 x 44 inches, 863.6 x 1117.6 mm
+ \value ArchA 9 x 12 inches, 228.6 x 304.8 mm
+ \value ArchB 12 x 18 inches, 304.8 x 457.2 mm
+ \value ArchC 18 x 24 inches, 457.2 x 609.6 mm
+ \value ArchD 24 x 36 inches, 609.6 x 914.4 mm
+ \value ArchE1 30 x 42 inches, 762.0 x 1066.8 mm
+ \value ArchE 36 x 48 inches, 914.4, 1219.2 mm
\value Folio 210 x 330 mm
\value Ledger 432 x 279 mm
\value Legal 8.5 x 14 inches, 216 x 356 mm
@@ -973,13 +983,14 @@
*/
void QPrinter::setPrintRange( PrintRange range )
{
- if( range != AllPages )
+ if( range != AllPages ) {
if( range == Selection
&& !isOptionEnabled( PrintSelection ) )
setOptionEnabled( PrintSelection, TRUE );
else if( range == PageRange
&& !isOptionEnabled( PrintPageRange ) )
setOptionEnabled( PrintPageRange, TRUE );
+ }
d->printRange = range;
}
--- /usr/src/packages/SOURCES/qt-x11-free-3.3.8b/src/kernel/qprinter_unix.cpp 2008-01-15 14:09:13.000000000 -0500
+++ ./qprinter_unix.cpp 2009-05-31 11:46:33.000000000 -0400
@@ -300,6 +300,8 @@
static const char * const psToStr[QPrinter::NPageSize+1] =
{ "A4", "B5", "Letter", "Legal", "Executive",
+ "Ansi B", "Ansi C", "Ansi D", "Ansi E", "Arch A", "Arch B",
+ "Arch C", "Arch D", "Arch E1", "Arch E",
"A0", "A1", "A2", "A3", "A5", "A6", "A7", "A8", "A9", "B0", "B1",
"B10", "B2", "B3", "B4", "B6", "B7", "B8", "B9", "C5E", "Comm10E",
"DLE", "Folio", "Ledger", "Tabloid", 0
@@ -493,6 +495,16 @@
{ IN(8.5), IN(11) }, // Letter
{ IN(8.5), IN(14) }, // Legal
{ IN(7.5), IN(10) }, // Executive
+ { IN(11), IN(17) }, // Ansi B
+ { IN(17), IN(22) }, // Ansi C
+ { IN(22), IN(34) }, // Ansi D
+ { IN(34), IN(44) }, // Ansi E
+ { IN(9), IN(12) }, // Arch A
+ { IN(12), IN(18) }, // Arch B
+ { IN(18), IN(24) }, // Arch C
+ { IN(24), IN(36) }, // Arch D
+ { IN(30), IN(42) }, // Arch E1
+ { IN(36), IN(48) }, // Arch E
{ MM(841), MM(1189) }, // A0
{ MM(594), MM(841) }, // A1
{ MM(420), MM(594) }, // A2