diff options
author | Arno <am@disconnect.de> | 2013-10-12 15:35:24 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-10-12 15:35:24 +0200 |
commit | 89662ce745c1eee152e7bc2200be5f08caee78a8 (patch) | |
tree | 8d1e1de7d33c9a2ba78ba4cecb5683cf8db0f587 /pictureviewer2.h | |
parent | f4d47b31976bf0b95c8ee3e4c1f010ffe1d2fd21 (diff) | |
download | SheMov-89662ce745c1eee152e7bc2200be5f08caee78a8.tar.gz SheMov-89662ce745c1eee152e7bc2200be5f08caee78a8.tar.bz2 SheMov-89662ce745c1eee152e7bc2200be5f08caee78a8.zip |
Improve PictureViewer2
* implement Mark Files
* always show all pictures from context
* change navigation:
N -> next
P -> previous
M -> mark/unmark file
Diffstat (limited to 'pictureviewer2.h')
-rw-r--r-- | pictureviewer2.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/pictureviewer2.h b/pictureviewer2.h index 622397a..2e879d1 100644 --- a/pictureviewer2.h +++ b/pictureviewer2.h @@ -34,15 +34,18 @@ typedef QList<QList<QVariant> > PicDataList; class PictureViewer2 : public QGraphicsView { Q_OBJECT public: - enum AssocActions { SlideAction, HideAction }; + enum AssocActions { SlideAction, HideAction, MarkAction }; explicit PictureViewer2(QWidget *parent = 0); void addFiles(const PicDataList &files, bool clear = true); void addFiles(const QString &dir, bool clear = true); + void addFiles(const QStringList &files, bool clear = true); void setFile(const PicData &file); void setFile(QString fullPath = mDefaultFile); void setPixmap(const QPixmap &pm); void setShowInfoItem(bool show) { mShowInfoItem = show; } void setShowMappingItem(bool show) { mShowMappingItem = show; } + void setShowMarkItem(bool show) { mShowMarkItem = show; } + const PicDataList marked() { return mMarkedFiles; } PicData picData(const QString &fullPath); virtual QSize sizeHint() const; @@ -58,6 +61,8 @@ class PictureViewer2 : public QGraphicsView { void copyCurrent(); void showNewPicsDialog(); void addToNewPics(); + void markCurrent(); + void clearMarks(); protected: virtual void wheelEvent(QWheelEvent *event); @@ -79,6 +84,7 @@ class PictureViewer2 : public QGraphicsView { QPointF getPos(PictureViewer2Item *item, int pos, const QPointF &movPos); QString constructWindowTitle() const; PicDataList mFiles; + PicDataList mMarkedFiles; QGraphicsScene *mScene; QSize mSize; QGraphicsPixmapItem *mCur; @@ -95,12 +101,14 @@ class PictureViewer2 : public QGraphicsView { QPointF mMappingPos; QAction *mSlideA; QAction *mHideA; + QAction *mMarkA; MappingTreeModel *mMappingTreeModel; PicFilesModel *mPicFilesModel; PicData mCurPicData; NewPicsDialog *mNewPicsDlg; bool mShowInfoItem; bool mShowMappingItem; + bool mShowMarkItem; }; class PictureViewer2Item : public QGraphicsItem { @@ -109,10 +117,11 @@ class PictureViewer2Item : public QGraphicsItem { explicit PictureViewer2Item(QTextDocument *doc, QGraphicsItem *parent = 0); ~PictureViewer2Item(); QRectF boundingRect() const; + void appendText(const QString &text); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); private: - QStaticText mText; + QStringList mTextList; QTextDocument *mDoc; }; |