Changeset 8 for trunk/examples/action
- Timestamp:
- Nov 16, 2005, 8:36:46 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/action/application.cpp
r7 r8 34 34 #include "filesave.xpm" 35 35 #include "fileopen.xpm" 36 #ifndef QT_NO_PRINTER 36 37 #include "fileprint.xpm" 38 #endif 37 39 38 40 … … 40 42 : QMainWindow( 0, "example application main window", WDestructiveClose ) 41 43 { 44 #ifndef QT_NO_PRINTER 42 45 printer = new QPrinter( QPrinter::HighResolution ); 46 #endif 43 47 44 48 QAction * fileNewAction; … … 79 83 fileSaveAsAction->setWhatsThis( fileSaveText ); 80 84 85 #ifndef QT_NO_PRINTER 81 86 filePrintAction = new QAction( "Print File", QPixmap( fileprint ), 82 87 "&Print...", CTRL+Key_P, this, "print" ); … … 88 93 "command from the File menu."; 89 94 filePrintAction->setWhatsThis( filePrintText ); 95 #else 96 Q_UNUSED( filePrintAction ) 97 #endif 90 98 91 99 fileCloseAction = new QAction( "Close", "&Close", CTRL+Key_W, this, … … 105 113 fileOpenAction->addTo( fileTools ); 106 114 fileSaveAction->addTo( fileTools ); 115 #ifndef QT_NO_PRINTER 107 116 filePrintAction->addTo( fileTools ); 117 #endif 108 118 (void)QWhatsThis::whatsThisButton( fileTools ); 109 119 … … 117 127 fileSaveAction->addTo( file ); 118 128 fileSaveAsAction->addTo( file ); 129 #ifndef QT_NO_PRINTER 119 130 file->insertSeparator(); 120 131 filePrintAction->addTo( file ); 132 #endif 121 133 file->insertSeparator(); 122 134 fileCloseAction->addTo( file ); … … 150 162 ApplicationWindow::~ApplicationWindow() 151 163 { 164 #ifndef QT_NO_PRINTER 152 165 delete printer; 166 #endif 153 167 } 154 168 … … 228 242 void ApplicationWindow::print() 229 243 { 244 #ifndef QT_NO_PRINTER 230 245 printer->setFullPage( TRUE ); 231 246 if ( printer->setup(this) ) { // printer dialog … … 266 281 statusBar()->message( "Printing aborted", 2000 ); 267 282 } 283 #endif 268 284 } 269 285
Note:
See TracChangeset
for help on using the changeset viewer.