Changeset 8 for trunk/examples


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

Location:
trunk/examples
Files:
4 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
  • trunk/examples/application/application.cpp

    r7 r8  
    3333#include "filesave.xpm"
    3434#include "fileopen.xpm"
     35#ifndef QT_NO_PRINTER
    3536#include "fileprint.xpm"
     37#endif
    3638
    3739ApplicationWindow::ApplicationWindow()
    3840    : QMainWindow( 0, "example application main window", WDestructiveClose | WGroupLeader )
    3941{
     42#ifndef QT_NO_PRINTER
    4043    printer = new QPrinter( QPrinter::HighResolution );
     44#endif
    4145    QPixmap openIcon, saveIcon, printIcon;
    4246
     
    5458                           this, SLOT(save()), fileTools, "save file" );
    5559
     60#ifndef QT_NO_PRINTER
    5661    printIcon = QPixmap( fileprint );
    5762    QToolButton * filePrint
    5863        = new QToolButton( printIcon, "Print File", QString::null,
    5964                           this, SLOT(print()), fileTools, "print file" );
     65#else
     66    Q_UNUSED( printIcon )
     67#endif
    6068
    6169
     
    7886    QWhatsThis::add( fileSave, fileSaveText );
    7987
     88#ifndef QT_NO_PRINTER
    8089    const char * filePrintText = "Click this button to print the file you "
    8190                 "are editing.\n"
     
    8493
    8594    QWhatsThis::add( filePrint, filePrintText );
     95#endif
    8696
    8797
     
    104114    file->setWhatsThis( id, fileSaveText );
    105115
     116#ifndef QT_NO_PRINTER
    106117    file->insertSeparator();
    107118
     
    109120                           this, SLOT(print()), CTRL+Key_P );
    110121    file->setWhatsThis( id, filePrintText );
     122#endif
    111123
    112124    file->insertSeparator();
     
    137149ApplicationWindow::~ApplicationWindow()
    138150{
     151#ifndef QT_NO_PRINTER
    139152    delete printer;
     153#endif
    140154}
    141155
     
    216230void ApplicationWindow::print()
    217231{
     232#ifndef QT_NO_PRINTER
    218233    printer->setFullPage( TRUE );
    219234    if ( printer->setup(this) ) {               // printer dialog
     
    254269        statusBar()->message( "Printing aborted", 2000 );
    255270    }
     271#endif
    256272}
    257273
  • trunk/examples/examples.pro

    r7 r8  
    122122x11:SUBDIRS     += biff \
    123123                   desktop
     124
     125## @todo (dmik): examples below are substracted until implemented
     126
     127os2:SUBDIRS -= \
     128                demo \
     129                dirview \
     130                distributor \
     131                dragdrop \
     132                drawdemo \
     133                extension \
     134                helpdemo \
     135                movies \
     136                process \
     137                qdir \
     138                tetrix \
     139                tux \
     140                widgets
  • trunk/examples/menu/menu.cpp

    r7 r8  
    152152    options->insertTearOffHandle();
    153153    options->setCaption("Options");
    154     options->insertItem( "&Normal Font", this, SLOT(normal()) );
     154
     155    options->polish(); // adjust system settings
     156    QFont of( options->font().family(), options->font().pointSize() );
     157    int normID = options->insertItem( new MyMenuItem( "&Normal Font", of ) );
     158    options->connectItem( normID, this, SLOT(normal()) );
    155159    options->insertSeparator();
    156 
    157     options->polish(); // adjust system settings
    158     QFont f = options->font();
     160    QFont f = QFont( of );
    159161    f.setBold( TRUE );
    160162    boldID = options->insertItem( new MyMenuItem( "Bold", f ) );
    161163    options->setAccel( CTRL+Key_B, boldID );
    162164    options->connectItem( boldID, this, SLOT(bold()) );
    163     f = font();
     165    f = QFont( of );
    164166    f.setUnderline( TRUE );
    165167    underlineID = options->insertItem( new MyMenuItem( "Underline", f ) );
Note: See TracChangeset for help on using the changeset viewer.