diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-06-03 19:04:50 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-03 16:40:01 -0700 |
commit | eb24d90c8e0aae60c0f0af4a9c7894007be47269 (patch) | |
tree | 9fe95c0c1d8397136be531adac73d211cd29dac5 /qt-ui/divepicturewidget.cpp | |
parent | f53b5c4d3f5bcf396d9abaa72f0be31a3d5512dc (diff) | |
download | subsurface-eb24d90c8e0aae60c0f0af4a9c7894007be47269.tar.gz |
Add a static 'instance()' member for the Photos model.
This will make referencing it from a few places more easy.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divepicturewidget.cpp')
-rw-r--r-- | qt-ui/divepicturewidget.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/qt-ui/divepicturewidget.cpp b/qt-ui/divepicturewidget.cpp index e5824e608..5da7c73a4 100644 --- a/qt-ui/divepicturewidget.cpp +++ b/qt-ui/divepicturewidget.cpp @@ -8,7 +8,13 @@ void DivePictureDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o QStyledItemDelegate::paint(painter, option, index); } -DivePictureModel::DivePictureModel(QObject *parent): QAbstractTableModel(parent) +DivePictureModel *DivePictureModel::instance() +{ + static DivePictureModel* self = new DivePictureModel(); + return self; +} + +DivePictureModel::DivePictureModel() { } |