Main Page | Class Hierarchy | Class List | 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 37 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 * windowIcon
 Window icon.

QPixmap * alertIcon
 Alert icon.

QLabel * alertIconLabel
 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 31 of file alertDialog.cpp.

References alertIcon, alertIconLabel, alertText, bottomFrame, descriptionText, gridBottom, gridFull, gridTop, IMAGE_PATH, okButton, 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   alertText = new QLabel( topFrame );
00045   alertText->setText( message );
00046   alertText->setFont( QFont( "Times", 12, QFont::Bold ) );
00047 
00048   alertIcon = new QPixmap(QString(IMAGE_PATH)+alertIconName);
00049   alertIconLabel = new QLabel( topFrame );
00050   alertIconLabel->setPixmap( *alertIcon );
00051     
00052   descriptionText = new QTextEdit( this );
00053   descriptionText->setReadOnly(true);  
00054   descriptionText->setText( description );
00055   descriptionText->setFont( QFont( "Times", 12, QFont::Normal ) );  
00056 
00057   bottomFrame = new QFrame( this );
00058   okButton = new QPushButton( QPixmap(QString(IMAGE_PATH)+"button_ok.png"), 
00059                               tr("Ok"), 
00060                               bottomFrame );
00061   okButton->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
00062   okButton->setDefault(true);
00063   okButton->setFocus();  
00064   
00065   connect( okButton, SIGNAL(clicked()), SLOT(accept()) );
00066   //-------------------------------
00067   //create grid and place widgets
00068   gridTop     = new QGridLayout( topFrame, 1, 2, 0);
00069   gridTop->addWidget( alertText, 0, 0 );
00070   gridTop->addWidget( alertIconLabel, 0, 1, Qt::AlignRight );
00071   
00072   gridBottom  = new QGridLayout( bottomFrame, 1, 1, 0);
00073   gridBottom->addWidget( okButton, 0, 0 );
00074   
00075   gridFull    = new QGridLayout( this, 3, 1, 0);
00076   gridFull->addWidget( topFrame, 0, 0);
00077   gridFull->addWidget( descriptionText, 1, 0);
00078   gridFull->addWidget( bottomFrame, 2, 0);
00079   
00080   gridFull->setRowStretch( 1, 1 );     
00081   gridFull->setResizeMode( QLayout::FreeResize );
00082   
00083   setMinimumWidth(300);
00084   setMaximumWidth(300);
00085   //-------------------------------
00086   //set the background of the widget to be white
00087   setPaletteBackgroundColor( QColor(255, 255, 255) );
00088   //-------------------------------
00089   //setup window title bar
00090   setIcon( *windowIcon );
00091   setCaption( message );
00092   //-------------------------------
00093   //set window to not be resizeable
00094   this->show();
00095   setFixedSize(size());
00096   //-------------------------------
00097 }

AlertDialog::~AlertDialog  ) 
 

Destructor.

Definition at line 99 of file alertDialog.cpp.

References alertIcon, and windowIcon.

00100 {
00101   delete windowIcon;
00102   delete alertIcon;
00103 }


Member Data Documentation

QPixmap* AlertDialog::alertIcon [private]
 

Alert icon.

Definition at line 69 of file alertDialog.h.

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

QLabel* AlertDialog::alertIconLabel [private]
 

Label which shows alert icon.

Definition at line 72 of file alertDialog.h.

Referenced by AlertDialog().

QLabel* AlertDialog::alertText [private]
 

Message displayed in window.

Definition at line 57 of file alertDialog.h.

Referenced by AlertDialog().

QFrame * AlertDialog::bottomFrame [private]
 

Top and bottom frames.

Definition at line 75 of file alertDialog.h.

Referenced by AlertDialog().

QTextEdit* AlertDialog::descriptionText [private]
 

Description displayed in window.

Definition at line 60 of file alertDialog.h.

Referenced by AlertDialog().

QGridLayout * AlertDialog::gridBottom [private]
 

Grids objects placed in.

Definition at line 54 of file alertDialog.h.

Referenced by AlertDialog().

QGridLayout * AlertDialog::gridFull [private]
 

Grids objects placed in.

Definition at line 54 of file alertDialog.h.

Referenced by AlertDialog().

QGridLayout* AlertDialog::gridTop [private]
 

Grids objects placed in.

Definition at line 54 of file alertDialog.h.

Referenced by AlertDialog().

QPushButton* AlertDialog::okButton [private]
 

Ok button.

Definition at line 63 of file alertDialog.h.

Referenced by AlertDialog().

QFrame* AlertDialog::topFrame [private]
 

Top and bottom frames.

Definition at line 75 of file alertDialog.h.

Referenced by AlertDialog().

QPixmap* AlertDialog::windowIcon [private]
 

Window icon.

Definition at line 66 of file alertDialog.h.

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


The documentation for this class was generated from the following files:
Generated on Thu Nov 13 00:11:07 2003 for AlbumShaper by doxygen 1.3.4