#include <questionDialog.h>
Definition at line 38 of file questionDialog.h.
Public Member Functions | |
QuestionDialog (QString question, QString message, QString questionIconName, QWidget *parent=0, const char *name=0) | |
Basic constructor. | |
~QuestionDialog () | |
Destructor. | |
Private Attributes | |
QGridLayout * | gridTop |
Grids objects placed in. | |
QGridLayout * | gridBottom |
Grids objects placed in. | |
QGridLayout * | gridFull |
Grids objects placed in. | |
QLabel * | questionText |
Question displayed in window. | |
QTextEdit * | messageText |
Message displayed in window. | |
QPushButton * | okButton |
Ok button. | |
QPushButton * | cancelButton |
Cancel button. | |
QPixmap * | windowIcon |
Window icon. | |
QPixmap * | questionIcon |
Question icon. | |
QLabel * | questionIconLabel |
Label which shows question icon. | |
QFrame * | topFrame |
Top and bottom frames. | |
QFrame * | bottomFrame |
Top and bottom frames. |
|
Basic constructor.
Definition at line 31 of file questionDialog.cpp. References bottomFrame, cancelButton, gridBottom, gridFull, gridTop, IMAGE_PATH, messageText, okButton, questionIcon, questionIconLabel, questionText, topFrame, and windowIcon.
00035 : 00036 QDialog(parent, name, true ) 00037 { 00038 //------------------------------- 00039 //create widgets 00040 windowIcon = new QPixmap(QString(IMAGE_PATH)+"albumShaperIcon.png"); 00041 00042 topFrame = new QFrame( this ); 00043 00044 questionText = new QLabel( topFrame ); 00045 questionText->setText( question ); 00046 questionText->setFont( QFont( "Times", 12, QFont::Bold ) ); 00047 00048 questionIcon = new QPixmap(QString(IMAGE_PATH)+questionIconName); 00049 questionIconLabel = new QLabel( topFrame ); 00050 questionIconLabel->setPixmap( *questionIcon ); 00051 00052 messageText = new QTextEdit( this ); 00053 messageText->setReadOnly(true); 00054 messageText->setText( message ); 00055 messageText->setFont( QFont( "Times", 12, QFont::Normal ) ); 00056 00057 bottomFrame = new QFrame( this ); 00058 okButton = new QPushButton( QPixmap(QString(IMAGE_PATH)+"button_ok.png"), 00059 "Ok", 00060 bottomFrame ); 00061 okButton->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum ); 00062 connect( okButton, SIGNAL(clicked()), SLOT(accept()) ); 00063 00064 cancelButton = new QPushButton( QPixmap(QString(IMAGE_PATH)+"button_cancel.png"), 00065 "Cancel", 00066 bottomFrame ); 00067 cancelButton->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum ); 00068 connect( cancelButton, SIGNAL(clicked()), SLOT(reject()) ); 00069 //------------------------------- 00070 //create grid and place widgets 00071 gridTop = new QGridLayout( topFrame, 1, 2, 0); 00072 gridTop->addWidget( questionText, 0, 0 ); 00073 gridTop->addWidget( questionIconLabel, 0, 1, Qt::AlignRight ); 00074 00075 gridBottom = new QGridLayout( bottomFrame, 1, 2, 0); 00076 gridBottom->addWidget( okButton, 0, 0 ); 00077 gridBottom->addWidget( cancelButton, 0, 1); 00078 00079 gridFull = new QGridLayout( this, 3, 1, 0); 00080 gridFull->addWidget( topFrame, 0, 0); 00081 gridFull->addWidget( messageText, 1, 0); 00082 gridFull->addWidget( bottomFrame, 2, 0); 00083 00084 gridFull->setRowStretch( 1, 1 ); 00085 gridFull->setResizeMode( QLayout::FreeResize ); 00086 00087 setMinimumWidth(300); 00088 setMaximumWidth(300); 00089 //------------------------------- 00090 //set the background of the widget to be white 00091 setPaletteBackgroundColor( QColor(255, 255, 255) ); 00092 //------------------------------- 00093 //setup window title bar 00094 setIcon( *windowIcon ); 00095 setCaption( question ); 00096 //------------------------------- 00097 } |
|
Destructor.
Definition at line 99 of file questionDialog.cpp. References questionIcon, and windowIcon.
00100 { 00101 delete windowIcon; 00102 delete questionIcon; 00103 } |
|
Top and bottom frames.
Definition at line 79 of file questionDialog.h. Referenced by QuestionDialog(). |
|
Cancel button.
Definition at line 67 of file questionDialog.h. Referenced by QuestionDialog(). |
|
Grids objects placed in.
Definition at line 55 of file questionDialog.h. Referenced by QuestionDialog(). |
|
Grids objects placed in.
Definition at line 55 of file questionDialog.h. Referenced by QuestionDialog(). |
|
Grids objects placed in.
Definition at line 55 of file questionDialog.h. Referenced by QuestionDialog(). |
|
Message displayed in window.
Definition at line 61 of file questionDialog.h. Referenced by QuestionDialog(). |
|
Ok button.
Definition at line 64 of file questionDialog.h. Referenced by QuestionDialog(). |
|
Question icon.
Definition at line 73 of file questionDialog.h. Referenced by QuestionDialog(), and ~QuestionDialog(). |
|
Label which shows question icon.
Definition at line 76 of file questionDialog.h. Referenced by QuestionDialog(). |
|
Question displayed in window.
Definition at line 58 of file questionDialog.h. Referenced by QuestionDialog(). |
|
Top and bottom frames.
Definition at line 79 of file questionDialog.h. Referenced by QuestionDialog(). |
|
Window icon.
Definition at line 70 of file questionDialog.h. Referenced by QuestionDialog(), and ~QuestionDialog(). |