diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-05-21 17:34:41 -0400 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-05-21 17:34:41 -0400 |
| commit | ba4f9b599069b93d2c73e13b43493da5bfe9b40e (patch) | |
| tree | 33ae8f45b810d751e292a8a303dd878b0a15d7a5 /sigmodr/tree/TreeWidget.cpp | |
| parent | 1c40145b3bfc2c1310bb126b5d876168dc3919cd (diff) | |
| download | sigen-ba4f9b599069b93d2c73e13b43493da5bfe9b40e.tar.gz sigen-ba4f9b599069b93d2c73e13b43493da5bfe9b40e.tar.xz sigen-ba4f9b599069b93d2c73e13b43493da5bfe9b40e.zip | |
Add method for getting the game for an index instead of only the current index
Diffstat (limited to 'sigmodr/tree/TreeWidget.cpp')
| -rw-r--r-- | sigmodr/tree/TreeWidget.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sigmodr/tree/TreeWidget.cpp b/sigmodr/tree/TreeWidget.cpp index fb7102dc..f1b46e5c 100644 --- a/sigmodr/tree/TreeWidget.cpp +++ b/sigmodr/tree/TreeWidget.cpp @@ -65,11 +65,6 @@ ObjectUI* TreeWidget::editorWidget(const QModelIndex& index) return widget; } -const Game* TreeWidget::currentGame() const -{ - return qobject_cast<TreeModel*>(model())->findGame(currentIndex()); -} - // QDomDocument TreeWidget::copy(const QModelIndex& index) // { // QDomDocument xml; @@ -82,6 +77,11 @@ const Game* TreeWidget::currentGame() const // model()->setData(index, data.toString(), BaseModel::XmlRole); // } // +const Game* TreeWidget::game(const QModelIndex& index) const +{ + return qobject_cast<TreeModel*>(model())->findGame(index); +} + QList<const Game*> TreeWidget::openedGames() const { return m_games.keys(); |
