From d7b6b0627a7d5e0875a263bf9501506a3d8da450 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 24 Apr 2008 18:46:14 +0000 Subject: [ADD] New classes for the models [FIX] Stuff cleaned up for better profiling (no inlining until profiler says so) git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@105 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- pokemodr/models/AbilityEffectModel.cpp | 89 ++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 pokemodr/models/AbilityEffectModel.cpp (limited to 'pokemodr/models/AbilityEffectModel.cpp') diff --git a/pokemodr/models/AbilityEffectModel.cpp b/pokemodr/models/AbilityEffectModel.cpp new file mode 100644 index 00000000..f284754e --- /dev/null +++ b/pokemodr/models/AbilityEffectModel.cpp @@ -0,0 +1,89 @@ +/* + * Copyright 2008 Ben Boeckel + * + * 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 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +// Pokemod includes +#include + +// Header include +#include "AbilityEffectModel.h" + +AbilityEffectModel::AbilityEffectModel(BaseModel* parent, Object* object) : + ObjectModel(parent, object) +{ +} + +AbilityEffectModel::~AbilityEffectModel() +{ + // TODO: destruct +} + +QVariant AbilityEffectModel::data(int role) const +{ + if (role == Qt::DisplayRole) + return AbilityEffect::EffectStr[static_cast(m_object)->effect()]; + else if (role == Qt::UserRole) + { +// QWidget* widget = new AbilityEffectUI(static_cast(m_object), NULL); +// return QVariant::fromValue(widget); + } + return QVariant(); +} + +int AbilityEffectModel::rowCount() const +{ + return 0; +} + +bool AbilityEffectModel::setData(const QVariant& value, int role) +{ + // TODO: set data +} + +BaseModel* AbilityEffectModel::childItem(const int /*row*/) +{ + return NULL; +} + +int AbilityEffectModel::indexNumber() const +{ + // TODO: get effect index +} + +bool AbilityEffectModel::canInsertRows() const +{ + return false; +} + +bool AbilityEffectModel::insertRows(const int /*rows*/) +{ + return false; +} + +bool AbilityEffectModel::canRemoveRows() const +{ + return false; +} + +bool AbilityEffectModel::removeRows(const int /*position*/, const int /*rows*/) +{ + return false; +} + +// bool AbilityEffectModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column) +// { +// // TODO: drag/drop +// } -- cgit