#include <photoWidget.h>
Definition at line 34 of file photoWidget.h.
Public Member Functions | |
| PhotoWidget (PhotosIconView *parent, Photo *phto) | |
| Sets subalbum pointer. | |
| Photo * | getPhoto () |
| Returns photo pointer. | |
| void | sync () |
| Syncs photo's description. | |
| void | updateImage () |
| Update photo thumbnail from background object. | |
| void | updateDescription () |
| Update photo description. | |
| void | paintItem (QPainter *p, const QColorGroup &cg) |
| Repain iconview item. | |
| void | setText (const QString &text) |
| bool | acceptDrop (const QMimeSource *e) const |
| int | compare (QIconViewItem *i) const |
Private Member Functions | |
| void | dropped (QDropEvent *e, const QValueList< QIconDragItem > &lst) |
Private Attributes | |
| Photo * | phto |
| Pointer to photo backend object. | |
| PhotosIconView * | parent |
| Parent. | |
|
||||||||||||
|
Sets subalbum pointer.
Definition at line 30 of file photoWidget.cpp. References PADDED_THUMBNAIL, and phto.
00031 : QIconViewItem( parent, 00032 phto->getDescription(), 00033 *phto->getImage(PADDED_THUMBNAIL) ) 00034 { 00035 this->parent = parent; 00036 this->phto = phto; 00037 } |
|
|
Definition at line 116 of file photoWidget.cpp.
00117 {
00118 return true;
00119 }
|
|
|
Definition at line 121 of file photoWidget.cpp.
00122 {
00123 if( pos().y() > (i->pos().y() + height()) ||
00124 (
00125 pos().y() >= i->pos().y() &&
00126 pos().x() >= i->pos().x()
00127 ))
00128 { return 1; }
00129 else
00130 { return -1; }
00131 }
|
|
||||||||||||
|
Definition at line 101 of file photoWidget.cpp. References parent.
|
|
|
Returns photo pointer.
Definition at line 39 of file photoWidget.cpp. References phto. Referenced by Subalbum::syncPhotoList().
00040 {
00041 return phto;
00042 }
|
|
||||||||||||
|
Repain iconview item.
Definition at line 59 of file photoWidget.cpp.
00061 {
00062 if(isSelected())
00063 {
00064 //draw red border around item
00065 int align = AlignHCenter;
00066 align |= WordBreak | BreakAnywhere;
00067
00068 //create buffer to draw in
00069 QRect rct = rect();
00070 rct.moveBy(-x(), -y());
00071 QPixmap buffer( size() );
00072 //create a painter pointing to the buffer
00073 QPainter bp( &buffer );
00074 //paint to buffer
00075 bp.setBrushOrigin( p->brushOrigin() );
00076 bp.fillRect( rct, white );
00077 QRect pr = pixmapRect(false);
00078 pr.moveBy(-x(), -y());
00079 bp.drawPixmap(pr, *pixmap());
00080 QRect tr = textRect(false);
00081 tr.moveBy(-x(), -y());
00082 bp.drawText(tr,align, text());
00083 bp.setPen( red );
00084 bp.drawRect(rct);
00085 bp.end();
00086 //paint buffer to widget
00087 p->drawPixmap( x(), y(), buffer );
00088 }
00089 else
00090 {
00091 QIconViewItem::paintItem ( p, cg);
00092 }
00093 }
|
|
|
Definition at line 95 of file photoWidget.cpp. References sync(). Referenced by updateDescription().
00096 {
00097 sync();
00098 QIconViewItem::setText(text);
00099 }
|
|
|
Syncs photo's description.
Definition at line 44 of file photoWidget.cpp. References phto, and Photo::setDescription(). Referenced by setText(), and SubalbumWidget::syncPhotos().
00045 {
00046 phto->setDescription(text());
00047 }
|
|
|
Update photo description.
Definition at line 54 of file photoWidget.cpp. References Photo::getDescription(), phto, and setText().
00055 {
00056 this->setText( phto->getDescription() );
00057 }
|
|
|
Update photo thumbnail from background object.
Definition at line 49 of file photoWidget.cpp. References Photo::getImage(), PADDED_THUMBNAIL, and phto.
|
|
|
Parent.
Definition at line 70 of file photoWidget.h. Referenced by dropped(). |
|
|
Pointer to photo backend object.
Definition at line 67 of file photoWidget.h. Referenced by getPhoto(), PhotoWidget(), sync(), updateDescription(), and updateImage(). |
1.3.1