#include <thumbnailscene.h>
Public Slots | |
| void | resize (int numItems) |
| void | add (int idx, QImage pm, QString label) |
| void | layout (int width=-1, int height=-1) |
| void | currentPage (int idx) |
Signals | |
| void | statusMessage (QString msg, int timeout=0) |
| void | statusClear () |
Public Member Functions | |
| ThumbnailScene () | |
| QString | pdftkCatPageRanges () |
| If pages have been reordered, returns the command line options for the pdftk cat command. | |
| int | currentPage () |
Protected Member Functions | |
| void | dragEnterEvent (QGraphicsSceneDragDropEvent *ev) |
| void | dragMoveEvent (QGraphicsSceneDragDropEvent *ev) |
| void | dropEvent (QGraphicsSceneDragDropEvent *ev) |
| QPoint | insertionIdx (QPointF pos) |
| At what index would the insertion occur *after* if dropped at the given position? E.g. | |
Protected Attributes | |
| int | cols |
| int | spacing |
| QVector< ThumbnailItem * > | items |
| int | selectedIdx |
| QPixmap | defaultItemIcon |
| QGraphicsLineItem | insertionPoint |
| int | row |
| int | col |
| int | maxWidth |
| int | maxHeight |
Used in the thumbnails dock widget.
Implements drag-and-drop page reordering.
Definition at line 16 of file thumbnailscene.h.
| ThumbnailScene::ThumbnailScene | ( | ) |
| void ThumbnailScene::add | ( | int | idx, | |
| QImage | pm, | |||
| QString | label | |||
| ) | [slot] |
Definition at line 29 of file thumbnailscene.cpp.
References col, cols, defaultItemIcon, ThumbnailItem::height(), items, maxHeight, maxWidth, row, selectedIdx, spacing, and ThumbnailItem::width().
| void ThumbnailScene::currentPage | ( | int | idx | ) | [slot] |
| int ThumbnailScene::currentPage | ( | ) | [inline] |
| void ThumbnailScene::dragEnterEvent | ( | QGraphicsSceneDragDropEvent * | ev | ) | [protected] |
| void ThumbnailScene::dragMoveEvent | ( | QGraphicsSceneDragDropEvent * | ev | ) | [protected] |
Definition at line 100 of file thumbnailscene.cpp.
References cols, insertionIdx(), insertionPoint, items, maxHeight, maxWidth, spacing, and statusMessage().
| void ThumbnailScene::dropEvent | ( | QGraphicsSceneDragDropEvent * | ev | ) | [protected] |
Definition at line 124 of file thumbnailscene.cpp.
References cols, insertionIdx(), insertionPoint, items, layout(), lessThan(), and statusClear().
| QPoint ThumbnailScene::insertionIdx | ( | QPointF | pos | ) | [protected] |
At what index would the insertion occur *after* if dropped at the given position? E.g.
if it's between items 5 and 6, will return 5.
Definition at line 148 of file thumbnailscene.cpp.
References col, maxHeight, maxWidth, row, and spacing.
Referenced by dragMoveEvent(), and dropEvent().
| void ThumbnailScene::layout | ( | int | width = -1, |
|
| int | height = -1 | |||
| ) | [slot] |
Definition at line 59 of file thumbnailscene.cpp.
References col, cols, ThumbnailItem::height(), items, MAX, maxHeight, maxWidth, row, spacing, and ThumbnailItem::width().
Referenced by dropEvent(), and MainWindow::open().
| QString ThumbnailScene::pdftkCatPageRanges | ( | ) |
If pages have been reordered, returns the command line options for the pdftk cat command.
Otherwise, empty string.
Definition at line 156 of file thumbnailscene.cpp.
References items, and ThumbnailItem::pageIdx.
| void ThumbnailScene::resize | ( | int | numItems | ) | [slot] |
Definition at line 17 of file thumbnailscene.cpp.
References col, items, maxHeight, maxWidth, row, and selectedIdx.
| void ThumbnailScene::statusClear | ( | ) | [signal] |
| void ThumbnailScene::statusMessage | ( | QString | msg, | |
| int | timeout = 0 | |||
| ) | [signal] |
int ThumbnailScene::col [protected] |
Definition at line 61 of file thumbnailscene.h.
Referenced by add(), insertionIdx(), layout(), and resize().
int ThumbnailScene::cols [protected] |
Definition at line 54 of file thumbnailscene.h.
Referenced by add(), dragMoveEvent(), dropEvent(), and layout().
QPixmap ThumbnailScene::defaultItemIcon [protected] |
QGraphicsLineItem ThumbnailScene::insertionPoint [protected] |
Definition at line 59 of file thumbnailscene.h.
Referenced by dragEnterEvent(), dragMoveEvent(), dropEvent(), and ThumbnailScene().
QVector<ThumbnailItem*> ThumbnailScene::items [protected] |
Definition at line 56 of file thumbnailscene.h.
Referenced by add(), dragMoveEvent(), dropEvent(), layout(), pdftkCatPageRanges(), and resize().
int ThumbnailScene::maxHeight [protected] |
Definition at line 63 of file thumbnailscene.h.
Referenced by add(), dragMoveEvent(), insertionIdx(), layout(), and resize().
int ThumbnailScene::maxWidth [protected] |
Definition at line 62 of file thumbnailscene.h.
Referenced by add(), dragMoveEvent(), insertionIdx(), layout(), and resize().
int ThumbnailScene::row [protected] |
Definition at line 60 of file thumbnailscene.h.
Referenced by add(), insertionIdx(), layout(), and resize().
int ThumbnailScene::selectedIdx [protected] |
int ThumbnailScene::spacing [protected] |
Definition at line 55 of file thumbnailscene.h.
Referenced by add(), dragMoveEvent(), insertionIdx(), and layout().
1.5.8