diff options
Diffstat (limited to 'pokemodr/models/DialogModel.cpp')
| -rw-r--r-- | pokemodr/models/DialogModel.cpp | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/pokemodr/models/DialogModel.cpp b/pokemodr/models/DialogModel.cpp index 874b0c25..304ccff9 100644 --- a/pokemodr/models/DialogModel.cpp +++ b/pokemodr/models/DialogModel.cpp @@ -36,7 +36,6 @@ DialogModel::DialogModel(BaseModel* parent, Object* object) : DialogModel::~DialogModel() { - // TODO: destruct } QVariant DialogModel::data(int role) const @@ -45,17 +44,13 @@ QVariant DialogModel::data(int role) const return static_cast<Dialog*>(m_object)->dialog(); else if (role == Qt::UserRole) { + // TODO: DialogUI // QWidget* widget = new DialogUI(static_cast<Dialog*>(m_object), NULL); // return QVariant::fromValue(widget); } return QVariant(); } -int DialogModel::rowCount() const -{ - return 0; -} - bool DialogModel::setData(const QVariant& value, int role) { if (role == Qt::UserRole) @@ -74,50 +69,31 @@ bool DialogModel::setData(const QVariant& value, int role) if (xml.setContent(&file)) { if (xml.doctype().name() == m_object->className()) + { m_object->load(xml.documentElement()); + return true; + } } file.close(); } else if (xml.setContent(value.toString())) { if (xml.doctype().name() == m_object->className()) + { m_object->load(xml.documentElement()); + return true; + } } } } return false; } -BaseModel* DialogModel::childItem(const int row) -{ - return NULL; -} - int DialogModel::indexNumber() const { return m_object->pokemod()->dialogIndex(m_object->id()); } -bool DialogModel::canInsertRows() const -{ - return false; -} - -bool DialogModel::insertRows(const int rows) -{ - return false; -} - -bool DialogModel::canRemoveRows() const -{ - return false; -} - -bool DialogModel::removeRows(const int position, const int rows) -{ - return false; -} - // bool DialogModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column) // { // // TODO: drag/drop |
