diff options
Diffstat (limited to 'pokemodr/models/CoinListObjectModel.cpp')
| -rw-r--r-- | pokemodr/models/CoinListObjectModel.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pokemodr/models/CoinListObjectModel.cpp b/pokemodr/models/CoinListObjectModel.cpp index 086eb700..0176b7e2 100644 --- a/pokemodr/models/CoinListObjectModel.cpp +++ b/pokemodr/models/CoinListObjectModel.cpp @@ -49,7 +49,13 @@ QVariant CoinListObjectModel::data(int role) const else if (object->type() == CoinListObject::Species) return m_object->pokemod()->species(object->object())->name(); } - else if (role == Qt::UserRole) + else if (role == BaseModel::XmlRole) + { + QDomDocument xml(m_object->className()); + xml.appendChild(m_object->save()); + return xml.toString(); + } + else if (role == BaseModel::WidgetRole) { QWidget* widget = new CoinListObjectUI(static_cast<CoinListObject*>(m_object), NULL); return QVariant::fromValue(widget); @@ -59,7 +65,7 @@ QVariant CoinListObjectModel::data(int role) const bool CoinListObjectModel::setData(const QVariant& value, int role) { - if (role == Qt::UserRole) + if (role == BaseModel::XmlRole) { if (value.canConvert<QString>()) { @@ -83,8 +89,3 @@ int CoinListObjectModel::indexNumber() const { // TODO: get index number } - -// bool CoinListObjectModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column) -// { -// // TODO: drag/drop -// } |
