#include <toolbarWidget.h>
Definition at line 18 of file toolbarWidget.h.
Public Methods | |
ToolbarWidget (QWidget *parent=0, const char *name=0) | |
Creates layout and places buttons. | |
~ToolbarWidget () | |
Deletes objects. | |
Private Slots | |
void | loadAction () |
Called when user clicks "Load" button. | |
void | storeAction () |
Called when user clicks "Store" button. | |
Private Attributes | |
QGridLayout * | grid |
Layout widgets place in. | |
QPixmap * | loadImage |
"Load" image | |
QPushButton * | load |
Store button. | |
QPixmap * | storeImage |
"Store" image | |
QPushButton * | store |
Store button. | |
QFrame * | line |
Horizontal line above buttons. | |
Window * | parent |
Parent window. |
|
Creates layout and places buttons.
Definition at line 21 of file toolbarWidget.cpp.
00022 : QFrame(parent,name) 00023 { 00024 //store parent window pointer 00025 this->parent = (Window*)parent; 00026 //Create horizontal line 00027 line = new QFrame(this); 00028 line->setFrameShadow( QFrame::Plain ); 00029 line->setLineWidth( 2 ); 00030 line->setFrameShape( QFrame::HLine ); 00031 00032 //Create buttons and connect their click signals to the action slots 00033 loadImage = new QPixmap( "images/load.png" ); 00034 load = new QPushButton( this ); 00035 load->setPixmap( *loadImage ); 00036 connect( load, SIGNAL(clicked()), SLOT(loadAction()) ); 00037 00038 storeImage = new QPixmap( "images/store.png" ); 00039 store = new QPushButton( this ); 00040 store->setPixmap( *storeImage ); 00041 connect( store, SIGNAL(clicked()), SLOT(storeAction()) ); 00042 00043 //Place images in grid 00044 grid = new QGridLayout( this, 2, 5, 0 ); 00045 grid->addMultiCellWidget( line, 0, 0, 0, 8 ); 00046 grid->addWidget( load, 1, 1, Qt::AlignCenter); 00047 grid->addWidget( store, 1, 3, Qt::AlignCenter); 00048 00049 //Set spaces between buttons to stretch to fill any empty space 00050 grid->setColStretch( 0, 1 ); 00051 grid->setColStretch( 2, 1 ); 00052 grid->setColStretch( 4, 1 ); 00053 00054 //set the background of the widget to be white 00055 setPaletteBackgroundColor( QColor(255, 255, 255) ); 00056 } |
|
Deletes objects.
Definition at line 58 of file toolbarWidget.cpp. References grid, line, load, loadImage, store, and storeImage.
|
|
Called when user clicks "Load" button.
Definition at line 68 of file toolbarWidget.cpp. References Window::getTitle(), Album::importFromDisk(), parent, Window::refresh(), and TitleWidget::setAlbum().
|
|
Called when user clicks "Store" button.
Definition at line 83 of file toolbarWidget.cpp. References Album::exportToDisk(), TitleWidget::getAlbum(), Window::getLayout(), LayoutWidget::getSubalbum(), Window::getTitle(), parent, and SubalbumWidget::syncPhotos().
00084 { 00085 //sync current subalbum to ensure all photo descriptions saved 00086 if( parent->getLayout()->getSubalbum() != NULL ) 00087 parent->getLayout()->getSubalbum()->syncPhotos(); 00088 00089 parent->getTitle()->getAlbum()->exportToDisk(); 00090 } |
|
Layout widgets place in.
Definition at line 38 of file toolbarWidget.h. Referenced by ~ToolbarWidget(). |
|
Horizontal line above buttons.
Definition at line 53 of file toolbarWidget.h. Referenced by ~ToolbarWidget(). |
|
Store button.
Definition at line 44 of file toolbarWidget.h. Referenced by ~ToolbarWidget(). |
|
"Load" image
Definition at line 41 of file toolbarWidget.h. Referenced by ~ToolbarWidget(). |
|
Parent window.
Definition at line 56 of file toolbarWidget.h. Referenced by loadAction(), and storeAction(). |
|
Store button.
Definition at line 50 of file toolbarWidget.h. Referenced by ~ToolbarWidget(). |
|
"Store" image
Definition at line 47 of file toolbarWidget.h. Referenced by ~ToolbarWidget(). |