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

AlertDialog Class Reference

#include <alertDialog.h>

Inheritance diagram for AlertDialog:

Inheritance graph
[legend]
Collaboration diagram for AlertDialog:

Collaboration graph
[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 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 }
//==============================================

AlertDialog::~AlertDialog  ) 
 

Destructor.

Definition at line 87 of file alertDialog.cpp.

00088 {
00089   delete alertIcon;
00090 }


Member Data Documentation

QPixmap* AlertDialog::alertIcon [private]
 

Alert icon.

Definition at line 60 of file alertDialog.h.

Referenced by 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 Sat Apr 2 05:44:50 2005 for AlbumShaper by  doxygen 1.3.9.1