summaryrefslogtreecommitdiffstats
path: root/pokemodr/models/CoinListObjectModel.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-06-30 03:46:19 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-06-30 03:46:19 +0000
commitab30493f374c0e4cf52bfe711dd8c9f6c90396d6 (patch)
tree915903ada290bdd94314439bc163a000011b6142 /pokemodr/models/CoinListObjectModel.cpp
parenta423cf3db8fa90cc09d2f92ff892e4fcdda4af16 (diff)
downloadsigen-ab30493f374c0e4cf52bfe711dd8c9f6c90396d6.tar.gz
sigen-ab30493f374c0e4cf52bfe711dd8c9f6c90396d6.tar.xz
sigen-ab30493f374c0e4cf52bfe711dd8c9f6c90396d6.zip
[FIX] Using qobject_cast now where possible
[FIX] ScriptWidget now uses KTextEditor (highlighting) git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@218 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'pokemodr/models/CoinListObjectModel.cpp')
-rw-r--r--pokemodr/models/CoinListObjectModel.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/pokemodr/models/CoinListObjectModel.cpp b/pokemodr/models/CoinListObjectModel.cpp
index 373c77c4..b1f76cd1 100644
--- a/pokemodr/models/CoinListObjectModel.cpp
+++ b/pokemodr/models/CoinListObjectModel.cpp
@@ -50,18 +50,18 @@ QVariant Pokemodr::CoinListObjectModel::data(int role) const
{
if (role == Qt::DisplayRole)
{
- Pokemod::CoinListObject* object = static_cast<Pokemod::CoinListObject*>(m_object);
+ Pokemod::CoinListObject* object = qobject_cast<Pokemod::CoinListObject*>(m_object);
if (object->type() == Pokemod::CoinListObject::Item)
{
- const int index = static_cast<const Pokemod::Pokemod*>(m_object->pokemod())->itemIndex(object->object());
+ const int index = qobject_cast<const Pokemod::Pokemod*>(m_object->pokemod())->itemIndex(object->object());
if (index != INT_MAX)
- return static_cast<const Pokemod::Pokemod*>(m_object->pokemod())->item(index)->name();
+ return qobject_cast<const Pokemod::Pokemod*>(m_object->pokemod())->item(index)->name();
}
else if (object->type() == Pokemod::CoinListObject::Species)
{
- const int index = static_cast<const Pokemod::Pokemod*>(m_object->pokemod())->speciesIndex(object->object());
+ const int index = qobject_cast<const Pokemod::Pokemod*>(m_object->pokemod())->speciesIndex(object->object());
if (index != INT_MAX)
- return static_cast<const Pokemod::Pokemod*>(m_object->pokemod())->species(index)->name();
+ return qobject_cast<const Pokemod::Pokemod*>(m_object->pokemod())->species(index)->name();
}
return "";
}
@@ -73,7 +73,7 @@ QVariant Pokemodr::CoinListObjectModel::data(int role) const
}
else if (role == Pokemodr::BaseModel::WidgetRole)
{
- QWidget* widget = new CoinListObjectUI(static_cast<Pokemod::CoinListObject*>(m_object), NULL);
+ QWidget* widget = new CoinListObjectUI(qobject_cast<Pokemod::CoinListObject*>(m_object), NULL);
return QVariant::fromValue(widget);
}
else if (role == Pokemodr::BaseModel::ContextMenuRole)
@@ -109,5 +109,5 @@ bool Pokemodr::CoinListObjectModel::setData(const QVariant& value, int role)
void Pokemodr::CoinListObjectModel::deleteSelf()
{
-// static_cast<GroupObjectModel*>(m_parent)->deleteObject(this);
+// qobject_cast<GroupObjectModel*>(m_parent)->deleteObject(this);
}