00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <qpixmap.h>
00019 #include <qpainter.h>
00020
00021
00022 #include "subalbumsIconView.h"
00023
00024
00025 SubalbumsIconView::SubalbumsIconView( QWidget *parent ) : QIconView( parent )
00026 {
00027 }
00028
00029 void SubalbumsIconView::contentsDropEvent( QDropEvent *e )
00030 {
00031 QIconView::contentsDropEvent( e );
00032
00033
00034 QIconViewItem *item = findItem( e->pos() );
00035
00036
00037
00038 if( item != NULL && e->source() == viewport())
00039 emit itemHasMoved();
00040 }
00041
00042 void SubalbumsIconView::drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph )
00043 {
00044 if( bufferPixmap.size() != size())
00045 { bufferPixmap.resize( size() ); }
00046 QPainter bufferPainter( &bufferPixmap, viewport() );
00047 int xOffset = clipx - contentsX();
00048 int yOffset = clipy - contentsY();
00049
00050 bufferPainter.translate( -contentsX(), -contentsY() );
00051 QIconView::drawContents( &bufferPainter, clipx, clipy, clipw, cliph );
00052 bitBlt(p->device(), xOffset, yOffset, &bufferPixmap, xOffset, yOffset, clipw, cliph );
00053 }
00054