From ad322157891cec53a7b660629d7c244e75df81d5 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 24 Jul 2010 17:15:00 +0200 Subject: Act on doubleClick in FileTreeWidget When doubleclicking a picture in FileTreeWidget the pictureViewer is shown. Doubleclicking a movie file launches the default movie player. Since PictureViewer is now used in FileSystemWidget and ArchiveTreeView a global instance is needed. The appropriate place for this is a singleton. Since we already had a singleton for QAbstractItemModels I renamed it to SmGlobals and added a function to return a PictureViewer object. Renaming it was quite easy thanks to QtCreator's ability to rename variable names. --- mappingtablewidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mappingtablewidget.cpp') diff --git a/mappingtablewidget.cpp b/mappingtablewidget.cpp index a96ff1d..85e0afb 100644 --- a/mappingtablewidget.cpp +++ b/mappingtablewidget.cpp @@ -17,7 +17,7 @@ #include "mappingtablewidget.h" #include "mappingtablemodel.h" -#include "smmodelsingleton.h" +#include "smglobals.h" MappingTableWidget::MappingTableWidget(const QString &table, QWidget *parent) : QWidget(parent), mTable(table), mCurrentId(-1){ //the view @@ -28,7 +28,7 @@ MappingTableWidget::MappingTableWidget(const QString &table, QWidget *parent) : mView->setModel(mModel); //mapping model - mMappingModel = static_cast(SmModelSingleton::instance()->model(mTable)); + mMappingModel = static_cast(SmGlobals::instance()->model(mTable)); //editor QHBoxLayout *itemEditLayout = new QHBoxLayout; -- cgit v1.2.3-70-g09d2