From 3a2cb75c85b8f98ebb0262ec3d5b590dcb9d79a1 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Sun, 3 Apr 2016 00:29:10 +0800 Subject: move imageviewer sources to ui/imageviewer --- src/ui/imageviewer/imageviewer_origin.h | 108 ++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 src/ui/imageviewer/imageviewer_origin.h (limited to 'src/ui/imageviewer/imageviewer_origin.h') diff --git a/src/ui/imageviewer/imageviewer_origin.h b/src/ui/imageviewer/imageviewer_origin.h new file mode 100644 index 0000000..15d9c62 --- /dev/null +++ b/src/ui/imageviewer/imageviewer_origin.h @@ -0,0 +1,108 @@ +/////////////////////////////////////////////////////// +//////// the origin image viewer ////////////////////// +/////////////////////////////////////////////////////// + +#ifndef FQTERM_IMAGEVIEWER_ORIGIN_H +#define FQTERM_IMAGEVIEWER_ORIGIN_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "pictureflow.h" +#include "fqtermimage.h" + +namespace FQTerm +{ + + class FQTermCanvas; + class ExifExtractor; + + class ItemDelegate : public QItemDelegate { + public: + static QSize size_; + + ItemDelegate() { + size_ = QSize(250,200); + } + + QSize sizeHint (const QStyleOptionViewItem & option, const QModelIndex & index) const { + return size_; + } + + void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const; + }; + + class ExifTable : public QLabel { + Q_OBJECT; + + public: + ExifTable(QWidget *parent); + + signals: + void showExifDetails(); + + protected: + void mouseReleaseEvent(QMouseEvent *pEvent); + }; + + class ImageViewerDirModel : public QDirModel { + public: + ImageViewerDirModel(QObject *parent = 0); + + int columnCount(const QModelIndex & = QModelIndex()) const; + QVariant headerData ( int section, Qt::Orientation orientation, int role) const; + QVariant data(const QModelIndex &index, int role) const; + }; + + class FQTermImageOrigin: public FQTermImage { + Q_OBJECT; + + public: + FQTermImageOrigin(FQTermConfig * config, QWidget *parent, Qt::WindowFlags wflag); + ~FQTermImageOrigin(); + void scrollTo(const QString& filename); + void updateImage(const QString& filename); + + public slots: + void onChange(const QModelIndex & index); + void next(); + void previous(); + void adjustItemSize(); + void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected); + void sortFileList(int index); + void showFullExifInfo(); + void adjustLayout(bool withExifTable); + void updateExifInfo(); + + protected: + void closeEvent(QCloseEvent *clse); + + private: + FQTermCanvas* canvas_; + QTreeView* tree_; + ImageViewerDirModel* model_; + QMenuBar* menuBar_; + QComboBox* comboBox_; + FQTermConfig* config_; + ExifExtractor* exifExtractor_; + ExifTable* exifTable_; + QGridLayout* layout_; + bool isExifTableShown_; + }; + +} + +#endif -- cgit v1.2.3