// Name : Qt Welcome Message // Author : Terrence Ma // Email : terrence@terrence.com // Web : http://www.terrence.com // Date : V1.0 03/05/2003 // License : GNU GPL - http://www.gnu.org/copyleft/gpl.html // Warranty : No Warranty /**************************************************************************** ** Form implementation generated from reading ui file 'dlgWelcome03.ui' ** ** Created: Thu Feb 27 01:21:33 2003 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "welcome.h" #include #include #include #include #include #include #include #include #include /* * Constructs a dlgWelcome01 which is a child of 'parent', with the * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * TRUE to construct a modal dialog. */ dlgWelcome01::dlgWelcome01( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "dlgWelcome01" ); resize( 328, 95 ); setCaption( tr( "Qt Welcome Message" ) ); QWidget* privateLayoutWidget = new QWidget( this, "layAll01" ); privateLayoutWidget->setGeometry( QRect( 0, 0, 326, 93 ) ); layAll01 = new QVBoxLayout( privateLayoutWidget ); layAll01->setSpacing( 6 ); layAll01->setMargin( 0 ); layUp01 = new QHBoxLayout; layUp01->setSpacing( 6 ); layUp01->setMargin( 0 ); lblQuestion01 = new QLabel( privateLayoutWidget, "lblQuestion01" ); lblQuestion01->setText( tr( "Please enter your name :" ) ); layUp01->addWidget( lblQuestion01 ); tbxName01 = new QLineEdit( privateLayoutWidget, "tbxName01" ); tbxName01->setText( tr( "Anonymous" ) ); layUp01->addWidget( tbxName01 ); btnSubmit01 = new QPushButton( privateLayoutWidget, "btnSubmit01" ); btnSubmit01->setText( tr( "Submit" ) ); layUp01->addWidget( btnSubmit01 ); layAll01->addLayout( layUp01 ); linCenter01 = new QFrame( privateLayoutWidget, "linCenter01" ); linCenter01->setFrameStyle( QFrame::HLine | QFrame::Sunken ); layAll01->addWidget( linCenter01 ); lblAnswer01 = new QLabel( privateLayoutWidget, "lblAnswer01" ); // Programming with Qt p.222 QString lblAnswer01Txt = QString( "Hello %1, welcome to this application !" ) .arg( tbxName01->text() ); lblAnswer01->setText( tr( lblAnswer01Txt ) ); layAll01->addWidget( lblAnswer01 ); lblAnswer02 = new QLabel( privateLayoutWidget, "lblAnswer02" ); // On-line Reference Documentation - Alphabetical Class List // file:///usr/lib/qt-2.3.1/doc/html/qdatetime.html QDateTime DateTimeNow01 = QDateTime::currentDateTime(); QString lblAnswer02Txt = QString( "Time is now %1." ) .arg( DateTimeNow01.toString() ); lblAnswer02->setText( tr( lblAnswer02Txt ) ); layAll01->addWidget( lblAnswer02 ); // signals and slots connections connect( tbxName01, SIGNAL( returnPressed() ), this, SLOT( lblAns_setText() ) ); connect( btnSubmit01, SIGNAL( released() ), this, SLOT( lblAns_setText() ) ); } /* * Destroys the object and frees any allocated resources */ dlgWelcome01::~dlgWelcome01() { // no need to delete child widgets, Qt does it all for us } void dlgWelcome01::lblAns_setText() { qWarning( "dlgWelcome01::lblAns_setText(): Not implemented yet!" ); }