#include <subalbumPreviewWidget.h>
Definition at line 35 of file subalbumPreviewWidget.h.
Public Member Functions | |
SubalbumPreviewWidget (SubalbumsIconView *parent, Subalbum *salbum) | |
Sets subalbum pointer. | |
Subalbum * | getSubalbum () |
Returns subalbum pointer. | |
void | paintItem (QPainter *p, const QColorGroup &cg) |
bool | acceptDrop (const QMimeSource *e) const |
int | compare (QIconViewItem *i) const |
Private Member Functions | |
void | dropped (QDropEvent *e, const QValueList< QIconDragItem > &lst) |
Private Attributes | |
Subalbum * | subalbum |
Pointer to subalbum backend object. | |
QPixmap * | subalbumPreviewImage |
Representative Image for Subalbum. | |
QString * | subalbumName |
Subalbum's Name. | |
SubalbumsIconView * | parent |
parent icon view |
|
Sets subalbum pointer.
Definition at line 36 of file subalbumPreviewWidget.cpp. References MEDIUM, and subalbum.
00037 : 00038 QIconViewItem(parent, 00039 salbum->getName(), 00040 *salbum->getRepresentativeImage(MEDIUM)) 00041 { 00042 this->parent = parent; 00043 subalbum = salbum; 00044 } //============================================== |
|
Definition at line 125 of file subalbumPreviewWidget.cpp.
00126 { 00127 return true; 00128 } |
|
Definition at line 130 of file subalbumPreviewWidget.cpp.
00131 { 00132 if(pos().y() >= i->pos().y()) 00133 { return 1; } 00134 else 00135 { return -1; } 00136 } |
|
Definition at line 70 of file subalbumPreviewWidget.cpp. References Subalbum::addPhoto(), SubalbumWidget::getPhotos(), SubalbumWidget::getSubalbum(), parent, Subalbum::photoMoved(), and subalbum.
00071 { 00072 if(e->source()->parentWidget() == parent) 00073 { 00074 if(e->pos().y() < (y() + (height()/2))) 00075 { 00076 parent->currentItem()->move(x(), y() - 1); 00077 } 00078 else 00079 { 00080 parent->currentItem()->move(x(), y() + (height()/2) + 1); 00081 } 00082 } 00083 else 00084 { 00085 //if the source of the items is the current subalbum icon view and 00086 //this is a differnt subalbum then 00087 //move photos from that subalbum to this one 00088 if(!isSelected() && e->source()->parentWidget() == ((LayoutWidget*)(parent->parentWidget()->parentWidget()))->getSubalbum()->getPhotos()) 00089 { 00090 //iterate over all selected photos, inserting each 00091 //into this subalbum, removing from old subalbum, 00092 //and deleting old photo widgets 00093 SubalbumWidget* oldSubalbumWidget = ((LayoutWidget*)(parent->parentWidget()->parentWidget()))->getSubalbum(); 00094 Subalbum* oldSubalbum = oldSubalbumWidget->getSubalbum(); 00095 QIconViewItem* current = oldSubalbumWidget->getPhotos()->firstItem(); 00096 00097 while(current != NULL) 00098 { 00099 //found a selected photo 00100 if(current->isSelected()) 00101 { 00102 //get pointer to photo 00103 Photo* photo = ((PhotoWidget*)current)->getPhoto(); 00104 00105 //remove photo from that subalbum 00106 oldSubalbum->photoMoved(photo); 00107 00108 //add photo to this subalbum 00109 subalbum->addPhoto(photo); 00110 00111 //delete photo widget and rearrange photos 00112 QIconViewItem* temp = current; 00113 current = current->nextItem(); 00114 delete temp; 00115 00116 oldSubalbumWidget->getPhotos()->arrangeItemsInGrid(); 00117 } 00118 else 00119 current = current->nextItem(); 00120 } 00121 } 00122 } 00123 } |
|
Returns subalbum pointer.
Definition at line 46 of file subalbumPreviewWidget.cpp. References subalbum. Referenced by Album::syncSubalbumList().
00047 { 00048 return subalbum; 00049 } |
|
Definition at line 51 of file subalbumPreviewWidget.cpp.
00053 { 00054 if(isSelected()) 00055 { 00056 //draw red border around item 00057 int align = AlignHCenter; 00058 align |= WordBreak | BreakAnywhere; 00059 p->drawPixmap(pixmapRect(false),*pixmap()); 00060 p->drawText(textRect(false),align, text()); 00061 p->setPen( red ); 00062 p->drawRect(rect()); 00063 } 00064 else 00065 { 00066 QIconViewItem::paintItem ( p, cg); 00067 } 00068 } |
|
parent icon view
Definition at line 65 of file subalbumPreviewWidget.h. Referenced by dropped(). |
|
Pointer to subalbum backend object.
Definition at line 56 of file subalbumPreviewWidget.h. Referenced by dropped(), getSubalbum(), and SubalbumPreviewWidget(). |
|
Subalbum's Name.
Definition at line 62 of file subalbumPreviewWidget.h. |
|
Representative Image for Subalbum.
Definition at line 59 of file subalbumPreviewWidget.h. |