00001 #ifndef THUMBNAILSCENE_H 00002 #define THUMBNAILSCENE_H 00003 00004 #include <QGraphicsScene> 00005 #include <QGraphicsGridLayout> 00006 #include "thumbnailitem.h" 00007 00016 class ThumbnailScene : public QGraphicsScene 00017 { 00018 Q_OBJECT 00019 00020 public: 00021 ThumbnailScene(); 00022 00027 QString pdftkCatPageRanges(); 00028 00029 int currentPage() { return selectedIdx; } 00030 00031 public slots: 00032 void resize(int numItems); 00033 void add(int idx, QImage pm, QString label); 00034 void layout(int width = -1, int height = -1); 00035 void currentPage(int idx); 00036 00037 signals: 00038 void statusMessage(QString msg, int timeout = 0); 00039 void statusClear(); 00040 00041 protected: 00042 void dragEnterEvent ( QGraphicsSceneDragDropEvent * ev ); 00043 void dragMoveEvent ( QGraphicsSceneDragDropEvent * ev ); 00044 void dropEvent ( QGraphicsSceneDragDropEvent * ev ); 00045 00051 QPoint insertionIdx(QPointF pos); 00052 00053 protected: 00054 int cols; 00055 int spacing; 00056 QVector<ThumbnailItem*> items; 00057 int selectedIdx; 00058 QPixmap defaultItemIcon; 00059 QGraphicsLineItem insertionPoint; 00060 int row; 00061 int col; 00062 int maxWidth; 00063 int maxHeight; 00064 }; 00065 00066 #endif // THUMBNAILSCENE_H
1.5.8