The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

boost-build/example/qt/main.cpp

Go to the documentation of this file.
00001 /****************************************************************
00002 **
00003 ** Qt tutorial 7
00004 **
00005 ****************************************************************/
00006 
00007 #include <qapplication.h>
00008 #include <qpushbutton.h>
00009 #include <qlcdnumber.h>
00010 #include <qfont.h>
00011 #include <qvbox.h>
00012 #include <qgrid.h>
00013 
00014 #include "lcdrange.h"
00015 
00016 
00017 class MyWidget : public QVBox
00018 {
00019 public:
00020     MyWidget( QWidget *parent=0, const char *name=0 );
00021 };
00022 
00023 
00024 MyWidget::MyWidget( QWidget *parent, const char *name )
00025         : QVBox( parent, name )
00026 {
00027     QPushButton *quit = new QPushButton( "Quit", this, "quit" );
00028     quit->setFont( QFont( "Times", 18, QFont::Bold ) );
00029 
00030     connect( quit, SIGNAL(clicked()), qApp, SLOT(quit()) );
00031 
00032     QGrid *grid = new QGrid( 4, this );
00033 
00034     LCDRange *previous = 0;
00035     for( int r = 0 ; r < 4 ; r++ ) {
00036     for( int c = 0 ; c < 4 ; c++ ) {
00037         LCDRange* lr = new LCDRange( grid );
00038         if ( previous )
00039         connect( lr, SIGNAL(valueChanged(int)),
00040              previous, SLOT(setValue(int)) );
00041         previous = lr;
00042     }
00043     }
00044 }
00045 
00046 
00047 int main( int argc, char **argv )
00048 {
00049     QApplication a( argc, argv );
00050 
00051     MyWidget w;
00052     a.setMainWidget( &w );
00053     w.show();
00054     return a.exec();
00055 }

Generated on Mon Nov 8 17:07:41 2004 for MPT by  doxygen 1.3.9.1