Thumbnail me
3.0
|
00001 /***************************************************************************/ 00021 #ifndef HEADER_PREVIEWGRAPHICVIEW 00022 #define HEADER_PREVIEWGRAPHICVIEW 00023 00024 #include "MainWindow.h" 00025 #include <QtOpenGL> 00026 00027 class MainWindow; 00028 00029 class PreviewGraphicView: public QGraphicsView 00030 { 00031 Q_OBJECT 00032 00033 public: 00034 explicit PreviewGraphicView(MainWindow * main_window, QAction *zoomInAction, QAction *clearSceneAction, QAction *zoomOutAction , QAction *printAction); 00035 virtual ~PreviewGraphicView(); 00036 00037 private: 00038 MainWindow *main_window; 00039 00040 QSettings *settings; 00041 QGraphicsPixmapItem *previewPixmapItem; 00042 QGraphicsScene *scene; 00043 QString currentPixmapPathLoaded; 00044 bool animatedPixmap; 00045 00046 QMenu *contextMenu; 00047 QAction *openInViewerSystemAction; 00048 QAction *zoomInAction; 00049 QAction *zoomOutAction; 00050 QAction *clearSceneAction; 00051 QAction *saveAsAction; 00052 QAction *copyAction; 00053 QAction *printAction; 00054 00055 00056 private: 00057 void animationIntro(QGraphicsPixmapItem *pixmap); 00058 void animationPixmap(QGraphicsPixmapItem *pixmap); 00059 void retranslate(); 00060 00061 protected: 00062 void changeEvent(QEvent* event); 00063 void contextMenuEvent( QContextMenuEvent *e ); 00064 void keyPressEvent ( QKeyEvent * e ) ; 00065 void mouseDoubleClickEvent ( QMouseEvent * e ) ; 00066 void wheelEvent ( QWheelEvent * e ); 00067 00068 public: 00069 QPixmap getCurrentPixmap(); 00070 void setAnimatedPixmap(bool value); 00071 void setViewportModeOpenGL(bool value); 00072 00073 public slots: 00074 void copyToClipboard(); 00075 void clear(); 00076 void manageQActionsState(); 00077 void openInViewerSystem(); 00078 void openPrintPreviewDialog(); 00079 void print(QPrinter *printer); 00080 void saveAs(); 00081 void setPreview(QString Namefile); 00082 void zoomIn (); 00083 void zoomOut(); 00084 }; 00085 00086 #endif // HEADER_PREVIEWGRAPHICVIEW