Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

AlertDialog Class Reference

#include <alertDialog.h>

Inheritance diagram for AlertDialog:

[legend]
Collaboration diagram for AlertDialog:
[legend]
List of all members.

Detailed Description

A configurable alert dialog that displays an alert/error message.

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.

QLabelalertText
 Message displayed in window.

QTextEditdescriptionText
 Description displayed in window.

QPushButton * okButton
 Ok button.

QPixmap * alertIcon
 Alert icon.

QLabelalertIconLabel
 Label which shows alert icon.

QFrametopFrame
 Top and bottom frames.

QFramebottomFrame
 Top and bottom frames.


Constructor & Destructor Documentation

AlertDialog::AlertDialog QString  message,
QString  description,
QString  alertIconName,
QWidget parent = 0,
const char *  name = 0
 

Basic constructor.

Definition at line 25 of file alertDialog.cpp.

References AlertDialog(), alertIcon, alertIconLabel, alertText, bottomFrame, descriptionText, gridBottom, gridFull, gridTop, IMAGE_PATH, okButton, topFrame, and WIDGET_SPACING.

Referenced by AlertDialog().

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 00039 QFont alertFont = alertText->font(); 00040 alertFont.setWeight(QFont::Bold); 00041 alertText->setFont( alertFont ); 00042 00043 alertIcon = new QPixmap(QString(IMAGE_PATH)+alertIconName); 00044 alertIconLabel = new QLabel( topFrame ); 00045 alertIconLabel->setPixmap( *alertIcon ); 00046 00047 descriptionText = new QTextEdit( this ); 00048 descriptionText->setReadOnly(true); 00049 descriptionText->setText( description ); 00050 00051 bottomFrame = new QFrame( this ); 00052 okButton = new QPushButton( tr("OK"), bottomFrame ); 00053 okButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); 00054 okButton->setDefault(true); 00055 okButton->setFocus(); 00056 00057 connect( okButton, SIGNAL(clicked()), SLOT(accept()) ); 00058 //------------------------------- 00059 //create grid and place widgets 00060 gridTop = new QGridLayout( topFrame, 1, 2, 0); 00061 gridTop->addWidget( alertText, 0, 0 ); 00062 gridTop->addWidget( alertIconLabel, 0, 1, Qt::AlignRight ); 00063 00064 gridBottom = new QGridLayout( bottomFrame, 1, 1, 0); 00065 gridBottom->addWidget( okButton, 0, 0 ); 00066 00067 gridFull = new QGridLayout( this, 3, 1, 0); 00068 gridFull->addWidget( topFrame, 0, 0); 00069 gridFull->addWidget( descriptionText, 1, 0); 00070 gridFull->addWidget( bottomFrame, 2, 0); 00071 00072 gridFull->setRowStretch( 1, 1 ); 00073 gridFull->setResizeMode( QLayout::FreeResize ); 00074 gridFull->setMargin(WIDGET_SPACING); 00075 gridFull->setSpacing(WIDGET_SPACING); 00076 00077 setMinimumWidth(300); 00078 setMaximumWidth(300); 00079 //------------------------------- 00080 //setup window title bar 00081 setCaption( message ); 00082 //------------------------------- 00083 //set window to not be resizeable 00084 this->show(); 00085 setFixedSize(size()); 00086 //------------------------------- 00087 } //==============================================

AlertDialog::~AlertDialog  ) 
 

Destructor.

Definition at line 89 of file alertDialog.cpp.

References alertIcon.

00090 { 00091 delete alertIcon; 00092 }


Member Data Documentation

QPixmap* AlertDialog::alertIcon [private]
 

Alert icon.

Definition at line 60 of file alertDialog.h.

Referenced by AlertDialog(), and ~AlertDialog().

QLabel* AlertDialog::alertIconLabel [private]
 

Label which shows alert icon.

Definition at line 63 of file alertDialog.h.

Referenced by AlertDialog().

QLabel* AlertDialog::alertText [private]
 

Message displayed in window.

Definition at line 51 of file alertDialog.h.

Referenced by AlertDialog().

QFrame * AlertDialog::bottomFrame [private]
 

Top and bottom frames.

Definition at line 66 of file alertDialog.h.

Referenced by AlertDialog().

QTextEdit* AlertDialog::descriptionText [private]
 

Description displayed in window.

Definition at line 54 of file alertDialog.h.

Referenced by AlertDialog().

QGridLayout * AlertDialog::gridBottom [private]
 

Grids objects placed in.

Definition at line 48 of file alertDialog.h.

Referenced by AlertDialog().

QGridLayout * AlertDialog::gridFull [private]
 

Grids objects placed in.

Definition at line 48 of file alertDialog.h.

Referenced by AlertDialog().

QGridLayout* AlertDialog::gridTop [private]
 

Grids objects placed in.

Definition at line 48 of file alertDialog.h.

Referenced by AlertDialog().

QPushButton* AlertDialog::okButton [private]
 

Ok button.

Definition at line 57 of file alertDialog.h.

Referenced by AlertDialog().

QFrame* AlertDialog::topFrame [private]
 

Top and bottom frames.

Definition at line 66 of file alertDialog.h.

Referenced by AlertDialog().


The documentation for this class was generated from the following files:
Generated on Sun Mar 4 19:43:04 2007 for AlbumShaper by doxygen 1.3.7