summaryrefslogtreecommitdiffstats
path: root/smmodelsingleton.h
diff options
context:
space:
mode:
Diffstat (limited to 'smmodelsingleton.h')
-rw-r--r--smmodelsingleton.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/smmodelsingleton.h b/smmodelsingleton.h
new file mode 100644
index 0000000..e8a3eaf
--- /dev/null
+++ b/smmodelsingleton.h
@@ -0,0 +1,30 @@
+/*
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version
+ 2 of the License, or (at your option) any later version.
+*/
+
+#ifndef SMUBERMODELSINGLETON_H
+#define SMUBERMODELSINGLETON_H
+
+#include <QHash>
+
+class QAbstractItemModel;
+
+class SmModelSingleton : public QObject {
+ Q_OBJECT
+ public:
+ ~SmModelSingleton();
+ static SmModelSingleton *instance();
+ QAbstractItemModel *model(const QString &which);
+
+ private:
+ SmModelSingleton() {}
+ SmModelSingleton(const SmModelSingleton &other);
+ SmModelSingleton &operator=(const SmModelSingleton &other);
+ static SmModelSingleton *mInstance;
+ QHash<QString, QAbstractItemModel*> mModels;
+};
+
+#endif