00001 /**************************************************************************** 00002 ** Form implementation generated from reading ui file 'Qt/GrabQtMainForm.ui' 00003 ** 00004 ** 00005 ** WARNING! All changes made in this file will be lost! 00006 ****************************************************************************/ 00007 00008 #include "Qt/ui/GrabQtMainForm.h" 00009 00010 #include <qvariant.h> 00011 #include <qfiledialog.h> 00012 #include <qmessagebox.h> 00013 #include <qimage.h> 00014 #include <qpixmap.h> 00015 #include <qlabel.h> 00016 #include <qslider.h> 00017 #include <qpushbutton.h> 00018 #include <qlayout.h> 00019 #include <qtooltip.h> 00020 #include <qwhatsthis.h> 00021 #include "QtUtil/ImageConvert.H" 00022 #include "Raster/Raster.H" 00023 #include "Qt/GrabQtMainForm.ui.h" 00024 00025 /* 00026 * Constructs a GrabQtMainForm as a child of 'parent', with the 00027 * name 'name' and widget flags set to 'f'. 00028 * 00029 * The dialog will by default be modeless, unless you set 'modal' to 00030 * TRUE to construct a modal dialog. 00031 */ 00032 GrabQtMainForm::GrabQtMainForm( QWidget* parent, const char* name, bool modal, WFlags fl ) 00033 : QDialog( parent, name, modal, fl ) 00034 { 00035 if ( !name ) 00036 setName( "GrabQtMainForm" ); 00037 00038 tiltLabel = new QLabel( this, "tiltLabel" ); 00039 tiltLabel->setGeometry( QRect( 180, 10, 30, 20 ) ); 00040 tiltLabel->setFrameShape( QLabel::NoFrame ); 00041 tiltLabel->setFrameShadow( QLabel::Plain ); 00042 00043 panLabel = new QLabel( this, "panLabel" ); 00044 panLabel->setGeometry( QRect( 90, 160, 30, 20 ) ); 00045 00046 panSlider = new QSlider( this, "panSlider" ); 00047 panSlider->setGeometry( QRect( 50, 130, 100, 24 ) ); 00048 panSlider->setOrientation( QSlider::Horizontal ); 00049 00050 pauseButton = new QPushButton( this, "pauseButton" ); 00051 pauseButton->setGeometry( QRect( 40, 30, 120, 30 ) ); 00052 00053 saveButton = new QPushButton( this, "saveButton" ); 00054 saveButton->setGeometry( QRect( 40, 75, 120, 30 ) ); 00055 00056 tiltSlider = new QSlider( this, "tiltSlider" ); 00057 tiltSlider->setGeometry( QRect( 180, 30, 22, 100 ) ); 00058 tiltSlider->setOrientation( QSlider::Vertical ); 00059 languageChange(); 00060 resize( QSize(236, 207).expandedTo(minimumSizeHint()) ); 00061 clearWState( WState_Polished ); 00062 00063 // signals and slots connections 00064 connect( panSlider, SIGNAL( valueChanged(int) ), this, SLOT( handlePanSlider(int) ) ); 00065 connect( tiltSlider, SIGNAL( valueChanged(int) ), this, SLOT( handleTiltSlider(int) ) ); 00066 connect( saveButton, SIGNAL( clicked() ), this, SLOT( saveImage() ) ); 00067 connect( pauseButton, SIGNAL( clicked() ), this, SLOT( handlePauseButton() ) ); 00068 } 00069 00070 /* 00071 * Destroys the object and frees any allocated resources 00072 */ 00073 GrabQtMainForm::~GrabQtMainForm() 00074 { 00075 // no need to delete child widgets, Qt does it all for us 00076 } 00077 00078 /* 00079 * Sets the strings of the subwidgets using the current 00080 * language. 00081 */ 00082 void GrabQtMainForm::languageChange() 00083 { 00084 setCaption( tr( "test-GrabQt" ) ); 00085 tiltLabel->setText( tr( "Tilt" ) ); 00086 panLabel->setText( tr( "Pan" ) ); 00087 pauseButton->setText( tr( "Grab" ) ); 00088 saveButton->setText( tr( "Save..." ) ); 00089 } 00090