#include <subalbumPreviewWidget.h>
Inheritance diagram for SubalbumPreviewWidget:


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 33 of file subalbumPreviewWidget.cpp. References MEDIUM, and subalbum.
00034 : 00035 QIconViewItem(parent, 00036 salbum->getName(), 00037 *salbum->getRepresentativeImage(MEDIUM)) 00038 { 00039 this->parent = parent; 00040 subalbum = salbum; 00041 } //============================================== |
|
|
Definition at line 122 of file subalbumPreviewWidget.cpp.
00123 {
00124 return true;
00125 }
|
|
|
Definition at line 127 of file subalbumPreviewWidget.cpp.
00128 {
00129 if(pos().y() >= i->pos().y())
00130 { return 1; }
00131 else
00132 { return -1; }
00133 }
|
|
||||||||||||
|
Definition at line 67 of file subalbumPreviewWidget.cpp. References Subalbum::addPhoto(), SubalbumWidget::getPhotos(), SubalbumWidget::getSubalbum(), parent, Subalbum::photoMoved(), and subalbum.
00068 {
00069 if(e->source()->parentWidget() == parent)
00070 {
00071 if(e->pos().y() < (y() + (height()/2)))
00072 {
00073 parent->currentItem()->move(x(), y() - 1);
00074 }
00075 else
00076 {
00077 parent->currentItem()->move(x(), y() + (height()/2) + 1);
00078 }
00079 }
00080 else
00081 {
00082 //if the source of the items is the current subalbum icon view and
00083 //this is a different subalbum then
00084 //move photos from that subalbum to this one
00085 if(!isSelected() && e->source()->parentWidget() == ((LayoutWidget*)(parent->parentWidget()->parentWidget()))->getSubalbum()->getPhotos())
00086 {
00087 //iterate over all selected photos, inserting each
00088 //into this subalbum, removing from old subalbum,
00089 //and deleting old photo widgets
00090 SubalbumWidget* oldSubalbumWidget = ((LayoutWidget*)(parent->parentWidget()->parentWidget()))->getSubalbum();
00091 Subalbum* oldSubalbum = oldSubalbumWidget->getSubalbum();
00092 QIconViewItem* current = oldSubalbumWidget->getPhotos()->firstItem();
00093
00094 while(current != NULL)
00095 {
00096 //found a selected photo
00097 if(current->isSelected())
00098 {
00099 //get pointer to photo
00100 Photo* photo = ((PhotoWidget*)current)->getPhoto();
00101
00102 //remove photo from that subalbum
00103 oldSubalbum->photoMoved(photo);
00104
00105 //add photo to this subalbum
00106 subalbum->addPhoto(photo);
00107
00108 //delete photo widget and rearrange photos
00109 QIconViewItem* temp = current;
00110 current = current->nextItem();
00111 delete temp;
00112
00113 oldSubalbumWidget->getPhotos()->arrangeItemsInGrid();
00114 }
00115 else
00116 current = current->nextItem();
00117 }
00118 }
00119 }
00120 }
|
|
|
Returns subalbum pointer.
Definition at line 43 of file subalbumPreviewWidget.cpp. References subalbum. Referenced by Album::syncSubalbumList().
00044 {
00045 return subalbum;
00046 }
|
|
||||||||||||
|
Definition at line 48 of file subalbumPreviewWidget.cpp.
00050 {
00051 if(isSelected())
00052 {
00053 //draw red border around item
00054 int align = AlignHCenter;
00055 align |= WordBreak | BreakAnywhere;
00056 p->drawPixmap(pixmapRect(false),*pixmap());
00057 p->drawText(textRect(false),align, text());
00058 p->setPen( red );
00059 p->drawRect(rect());
00060 }
00061 else
00062 {
00063 QIconViewItem::paintItem ( p, cg);
00064 }
00065 }
|
|
|
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. |
1.3.4