1 /** @file experiment.cpp
3 @author Bruno M. Carvalho and Deniz Sarioz
4 licensed under (open-source) QPL v1.0
5 which accompanies this distribution in the file QPL
8 #include "experiment.h"
12 #include <qlineedit.h>
13 #include <qpushbutton.h>
17 #include <qwhatsthis.h>
20 * Constructs a experimentwindow which is a child of 'parent', with the
21 * name 'name' and widget flags set to 'f'
23 * The dialog will by default be modeless, unless you set 'modal' to
24 * TRUE to construct a modal dialog.
26 @author Bruno M. Carvalho
28 experimentwindow::experimentwindow( QWidget* parent, const char* name, bool modal, WFlags fl )
29 : QDialog( parent, name, modal, fl )
32 setName( "experimentwindow" );
34 setMinimumSize( QSize( 400, 150 ) );
35 setMaximumSize( QSize( 400, 150 ) );
36 setCaption( tr( "Experiment's Comments Window" ) );
38 TextLabel1 = new QLabel( this, "TextLabel1" );
39 TextLabel1->setGeometry( QRect( 15, 30, 15, 30 ) );
40 QFont TextLabel1_font( TextLabel1->font() );
41 TextLabel1_font.setFamily( "adobe-helvetica" );
42 TextLabel1_font.setPointSize( 16 );
43 TextLabel1->setFont( TextLabel1_font );
44 TextLabel1->setText( tr( "*" ) );
46 comments = new QLineEdit( this, "comments" );
47 comments->setGeometry( QRect( 35, 25, 335, 30 ) );
48 comments->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, comments->sizePolicy().hasHeightForWidth() ) );
50 Line9 = new QFrame( this, "Line9" );
51 Line9->setGeometry( QRect( -5, 75, 420, 16 ) );
52 Line9->setFrameStyle( QFrame::HLine | QFrame::Sunken );
54 okbutton = new QPushButton( this, "okbutton" );
55 okbutton->setGeometry( QRect( 50, 90, 100, 40 ) );
56 okbutton->setText( tr( "OK" ) );
57 QObject::connect(okbutton,SIGNAL(clicked()),this,SLOT(accept()));
59 cancelbutton = new QPushButton( this, "cancelbutton" );
60 cancelbutton->setGeometry( QRect( 250, 90, 100, 40 ) );
61 cancelbutton->setText( tr( "Cancel" ) );
62 QObject::connect(cancelbutton,SIGNAL(clicked()),this,SLOT(reject()));
66 * Destroys the object and frees any allocated resources
68 experimentwindow::~experimentwindow()
70 // no need to delete child widgets, Qt does it all for us
74 * Main event handler. Reimplemented to handle application
77 bool experimentwindow::event( QEvent* ev )
79 bool ret = QDialog::event( ev );
80 if ( ev->type() == QEvent::ApplicationFontChange ) {
81 QFont TextLabel1_font( TextLabel1->font() );
82 TextLabel1_font.setFamily( "adobe-helvetica" );
83 TextLabel1_font.setPointSize( 16 );
84 TextLabel1->setFont( TextLabel1_font );
89 /** Returns a string of comments
92 @author Bruno M. Carvalho
94 QString experimentwindow::getOutput()
99 output+=comments->text();