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

PhotosIconView Class Reference

#include <photosIconView.h>

Inheritance diagram for PhotosIconView:

Inheritance graph
[legend]
Collaboration diagram for PhotosIconView:

Collaboration graph
[legend]
List of all members.

Detailed Description

Extension of iconview, used to list all photos in a subalbum. supports drag-n-drop within iconview.

Definition at line 32 of file photosIconView.h.

Signals

void itemHasMoved ()

Public Member Functions

 PhotosIconView (QWidget *parent)
int numSelected ()

Protected Member Functions

void drawContents (QPainter *p, int clipx, int clipy, int clipw, int cliph)

Private Member Functions

void contentsDropEvent (QDropEvent *e)

Private Attributes

QPixmap bufferPixmap


Constructor & Destructor Documentation

PhotosIconView::PhotosIconView QWidget parent  ) 
 

Definition at line 24 of file photosIconView.cpp.

00024                                                 : QIconView( parent )
00025 {
00026 }


Member Function Documentation

void PhotosIconView::contentsDropEvent QDropEvent *  e  )  [private]
 

Definition at line 28 of file photosIconView.cpp.

References itemHasMoved().

00029 {
00030   QIconView::contentsDropEvent( e );
00031 
00032   //get iconviewitem that was dropped  
00033   QIconViewItem *item = findItem( e->pos() );
00034   
00035   //if item exists and drop item was originally in this viewport then
00036   //user has dragged item within iconview, emit item has moved signal
00037   if( item != NULL && e->source() == viewport())
00038     emit itemHasMoved();
00039 }

void PhotosIconView::drawContents QPainter *  p,
int  clipx,
int  clipy,
int  clipw,
int  cliph
[protected]
 

Definition at line 41 of file photosIconView.cpp.

References bufferPixmap.

00042 {
00043     if( bufferPixmap.size() != size())
00044     {  bufferPixmap.resize( size() ); }
00045     QPainter bufferPainter( &bufferPixmap, viewport() );
00046     int xOffset = clipx - contentsX();
00047     int yOffset = clipy - contentsY();
00048 
00049     bufferPainter.translate( -contentsX(), -contentsY() );
00050     QIconView::drawContents( &bufferPainter, clipx, clipy, clipw, cliph );
00051     bitBlt(p->device(), xOffset, yOffset, &bufferPixmap, xOffset, yOffset, clipw, cliph );
00052 }

void PhotosIconView::itemHasMoved  )  [signal]
 

Referenced by contentsDropEvent().

int PhotosIconView::numSelected  ) 
 

Definition at line 54 of file photosIconView.cpp.

Referenced by SubalbumWidget::flipHorizontallyImageAction(), SubalbumWidget::flipVerticallyImageAction(), SubalbumWidget::rotate270ImageAction(), and SubalbumWidget::rotate90ImageAction().

00055 {
00056   int num = 0;
00057   QIconViewItem* current = firstItem();
00058   while(current != NULL)
00059   {
00060     if(current->isSelected())
00061       num++;
00062     current = current->nextItem();
00063   }
00064   return num;
00065 }


Member Data Documentation

QPixmap PhotosIconView::bufferPixmap [private]
 

Definition at line 50 of file photosIconView.h.

Referenced by drawContents().


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