QTfrontend/themesmodel.cpp
branchhedgeroid
changeset 6224 42b256eca362
parent 6055 88cfcd9161d3
parent 6223 cc3eb9b7230f
child 6226 3106add9a5bf
--- a/QTfrontend/themesmodel.cpp	Fri Oct 28 17:41:39 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-
-#include "themesmodel.h"
-
-ThemesModel::ThemesModel(QStringList themes, QObject *parent) :
-    QAbstractListModel(parent)
-{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
-    m_data.reserve(themes.size());
-#endif
-
-    foreach(QString theme, themes)
-    {
-        m_data.append(QHash<int, QVariant>());
-        m_data.last().insert(Qt::DisplayRole, theme);
-    }
-}
-
-int ThemesModel::rowCount(const QModelIndex &parent) const
-{
-    if(parent.isValid())
-        return 0;
-    else
-        return m_data.size();
-}
-
-QVariant ThemesModel::data(const QModelIndex &index, int role) const
-{
-    if(index.column() > 0 || index.row() >= m_data.size())
-        return QVariant();
-    else
-        return m_data.at(index.row()).value(role);
-}
-
-bool ThemesModel::setData(const QModelIndex &index, const QVariant &value, int role)
-{
-    if(index.column() > 0 || index.row() >= m_data.size())
-        return false;
-    else
-    {
-        m_data[index.row()].insert(role, value);
-
-        return true;
-    }
-
-}
-
-
-
-