Changeset 8 for trunk/examples/action


Ignore:
Timestamp:
Nov 16, 2005, 8:36:46 PM (20 years ago)
Author:
dmik
Message:

Transferred Qt for OS/2 version 3.3.1-rc5 sources from the CVS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/action/application.cpp

    r7 r8  
    3434#include "filesave.xpm"
    3535#include "fileopen.xpm"
     36#ifndef QT_NO_PRINTER
    3637#include "fileprint.xpm"
     38#endif
    3739
    3840
     
    4042    : QMainWindow( 0, "example application main window", WDestructiveClose )
    4143{
     44#ifndef QT_NO_PRINTER
    4245    printer = new QPrinter( QPrinter::HighResolution );
     46#endif
    4347
    4448    QAction * fileNewAction;
     
    7983    fileSaveAsAction->setWhatsThis( fileSaveText );
    8084
     85#ifndef QT_NO_PRINTER
    8186    filePrintAction = new QAction( "Print File", QPixmap( fileprint ),
    8287                                   "&Print...", CTRL+Key_P, this, "print" );
     
    8893                     "command from the File menu.";
    8994    filePrintAction->setWhatsThis( filePrintText );
     95#else
     96    Q_UNUSED( filePrintAction )
     97#endif
    9098
    9199    fileCloseAction = new QAction( "Close", "&Close", CTRL+Key_W, this,
     
    105113    fileOpenAction->addTo( fileTools );
    106114    fileSaveAction->addTo( fileTools );
     115#ifndef QT_NO_PRINTER
    107116    filePrintAction->addTo( fileTools );
     117#endif
    108118    (void)QWhatsThis::whatsThisButton( fileTools );
    109119
     
    117127    fileSaveAction->addTo( file );
    118128    fileSaveAsAction->addTo( file );
     129#ifndef QT_NO_PRINTER
    119130    file->insertSeparator();
    120131    filePrintAction->addTo( file );
     132#endif
    121133    file->insertSeparator();
    122134    fileCloseAction->addTo( file );
     
    150162ApplicationWindow::~ApplicationWindow()
    151163{
     164#ifndef QT_NO_PRINTER
    152165    delete printer;
     166#endif
    153167}
    154168
     
    228242void ApplicationWindow::print()
    229243{
     244#ifndef QT_NO_PRINTER
    230245    printer->setFullPage( TRUE );
    231246    if ( printer->setup(this) ) {               // printer dialog
     
    266281        statusBar()->message( "Printing aborted", 2000 );
    267282    }
     283#endif
    268284}
    269285
Note: See TracChangeset for help on using the changeset viewer.