#include <alertDialog.h>
Inheritance diagram for AlertDialog:
Definition at line 31 of file alertDialog.h.
Public Member Functions | |
AlertDialog (QString message, QString description, QString alertIconName, QWidget *parent=0, const char *name=0) | |
Basic constructor. | |
~AlertDialog () | |
Destructor. | |
Private Attributes | |
QGridLayout * | gridTop |
Grids objects placed in. | |
QGridLayout * | gridBottom |
Grids objects placed in. | |
QGridLayout * | gridFull |
Grids objects placed in. | |
QLabel * | alertText |
Message displayed in window. | |
QTextEdit * | descriptionText |
Description displayed in window. | |
QPushButton * | okButton |
Ok button. | |
QPixmap * | alertIcon |
Alert icon. | |
QLabel * | alertIconLabel |
Label which shows alert icon. | |
QFrame * | topFrame |
Top and bottom frames. | |
QFrame * | bottomFrame |
Top and bottom frames. |
|
Basic constructor.
Definition at line 25 of file alertDialog.cpp. References alertIcon, alertIconLabel, alertText, bottomFrame, descriptionText, gridBottom, gridFull, gridTop, IMAGE_PATH, okButton, topFrame, and WIDGET_SPACING. 00029 : 00030 QDialog(parent, name, true ) 00031 { 00032 //------------------------------- 00033 //create widgets 00034 topFrame = new QFrame( this ); 00035 00036 alertText = new QLabel( topFrame ); 00037 alertText->setText( message ); 00038 alertText->setFont( QFont( "Times", 12, QFont::Bold ) ); 00039 00040 alertIcon = new QPixmap(QString(IMAGE_PATH)+alertIconName); 00041 alertIconLabel = new QLabel( topFrame ); 00042 alertIconLabel->setPixmap( *alertIcon ); 00043 00044 descriptionText = new QTextEdit( this ); 00045 descriptionText->setReadOnly(true); 00046 descriptionText->setText( description ); 00047 descriptionText->setFont( QFont( "Times", 12, QFont::Normal ) ); 00048 00049 bottomFrame = new QFrame( this ); 00050 okButton = new QPushButton( tr("OK"), bottomFrame ); 00051 okButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); 00052 okButton->setDefault(true); 00053 okButton->setFocus(); 00054 00055 connect( okButton, SIGNAL(clicked()), SLOT(accept()) ); 00056 //------------------------------- 00057 //create grid and place widgets 00058 gridTop = new QGridLayout( topFrame, 1, 2, 0); 00059 gridTop->addWidget( alertText, 0, 0 ); 00060 gridTop->addWidget( alertIconLabel, 0, 1, Qt::AlignRight ); 00061 00062 gridBottom = new QGridLayout( bottomFrame, 1, 1, 0); 00063 gridBottom->addWidget( okButton, 0, 0 ); 00064 00065 gridFull = new QGridLayout( this, 3, 1, 0); 00066 gridFull->addWidget( topFrame, 0, 0); 00067 gridFull->addWidget( descriptionText, 1, 0); 00068 gridFull->addWidget( bottomFrame, 2, 0); 00069 00070 gridFull->setRowStretch( 1, 1 ); 00071 gridFull->setResizeMode( QLayout::FreeResize ); 00072 gridFull->setMargin(WIDGET_SPACING); 00073 gridFull->setSpacing(WIDGET_SPACING); 00074 00075 setMinimumWidth(300); 00076 setMaximumWidth(300); 00077 //------------------------------- 00078 //setup window title bar 00079 setCaption( message ); 00080 //------------------------------- 00081 //set window to not be resizeable 00082 this->show(); 00083 setFixedSize(size()); 00084 //------------------------------- 00085 } //==============================================
|
|
Destructor.
Definition at line 87 of file alertDialog.cpp. 00088 {
00089 delete alertIcon;
00090 }
|
|
Alert icon.
Definition at line 60 of file alertDialog.h. Referenced by AlertDialog(). |
|
Label which shows alert icon.
Definition at line 63 of file alertDialog.h. Referenced by AlertDialog(). |
|
Message displayed in window.
Definition at line 51 of file alertDialog.h. Referenced by AlertDialog(). |
|
Top and bottom frames.
Definition at line 66 of file alertDialog.h. Referenced by AlertDialog(). |
|
Description displayed in window.
Definition at line 54 of file alertDialog.h. Referenced by AlertDialog(). |
|
Grids objects placed in.
Definition at line 48 of file alertDialog.h. Referenced by AlertDialog(). |
|
Grids objects placed in.
Definition at line 48 of file alertDialog.h. Referenced by AlertDialog(). |
|
Grids objects placed in.
Definition at line 48 of file alertDialog.h. Referenced by AlertDialog(). |
|
Ok button.
Definition at line 57 of file alertDialog.h. Referenced by AlertDialog(). |
|
Top and bottom frames.
Definition at line 66 of file alertDialog.h. Referenced by AlertDialog(). |