From 11bf52b6cf1c27a75715a8379e7893b8d1e16bf0 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 26 Feb 2012 14:15:45 +0100 Subject: Mark active Mappings When selecting pictures, mark the active mappings with a different color. --- pictureswidget.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'pictureswidget.h') diff --git a/pictureswidget.h b/pictureswidget.h index b0bd277..b8a7b40 100644 --- a/pictureswidget.h +++ b/pictureswidget.h @@ -29,6 +29,9 @@ class PicturesWidget : public QWidget { explicit PicturesWidget(QWidget *parent = 0); PictureView *picView() { return mPictureView; } + private slots: + void setMappingColors(); + private: MappingTreeWidget *mMappingTree; PictureView *mPictureView; @@ -38,6 +41,7 @@ class PictureView : public QTreeView { Q_OBJECT public: explicit PictureView(QWidget *parent = 0); + QList fileMappings() { return mFilesMappings; } public slots: void mappingChanged(int mapping); @@ -48,12 +52,19 @@ class PictureView : public QTreeView { virtual bool event(QEvent *e); virtual void contextMenuEvent(QContextMenuEvent *e); + private slots: + void setFileMappings(); + + signals: + void newFileMappigs(); + private: HoverWindow *mHoverWin; QModelIndex mCurHover; QSortFilterProxyModel *mProxy; PicFilesModel *mModel; int mCursorOffset; + QList mFilesMappings; }; class PicFilesModel : public SmTreeModel { @@ -64,6 +75,7 @@ class PicFilesModel : public SmTreeModel { enum { NumFields = 8 }; explicit PicFilesModel(const QStringList &headers, QObject *parent = 0); void setMapping(int mappingId) { mMappingId = mappingId; } + QList mappingIds(const QList &fileIds); //some data Qt::ItemFlags flags(const QModelIndex &) const { return Qt::ItemIsEnabled | Qt::ItemIsSelectable; } @@ -77,7 +89,10 @@ class PicFilesModel : public SmTreeModel { QSqlDatabase mDb; QSqlQuery *mPopulateQ; QSqlQuery *mDeleteFileQ; + QSqlQuery *mCurMappingIdsQ; + QString mCurMappingIdsQS; int mMappingId; + QList mCurMappingsIds; }; #endif // PICTURESWIDGET_H -- cgit v1.2.3-70-g09d2