From 8c561edcded6a4eafc3588a23975d0e6f395aab2 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 2 May 2009 14:27:59 -0400 Subject: Actually use parent when creating the editor widget --- sigmodr/tree/TreeItem.cpp | 65 +++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 33 deletions(-) (limited to 'sigmodr/tree/TreeItem.cpp') diff --git a/sigmodr/tree/TreeItem.cpp b/sigmodr/tree/TreeItem.cpp index 3612ad4b..dc6e2e27 100644 --- a/sigmodr/tree/TreeItem.cpp +++ b/sigmodr/tree/TreeItem.cpp @@ -373,105 +373,104 @@ bool TreeItem::canRemove() const QWidget* TreeItem::editWidget(QWidget* parent) { - // TODO ObjectUI* editorWidget = NULL; switch (m_type) { case EntryGame: - editorWidget = new GameUI(qobject_cast(m_object), NULL); + editorWidget = new GameUI(qobject_cast(m_object), parent); break; case EntryRules: - editorWidget = new RulesUI(qobject_cast(m_object), NULL); + editorWidget = new RulesUI(qobject_cast(m_object), parent); break; case EntryAbility: - editorWidget = new AbilityUI(qobject_cast(m_object), NULL); + editorWidget = new AbilityUI(qobject_cast(m_object), parent); break; case EntryAuthor: - editorWidget = new AuthorUI(qobject_cast(m_object), NULL); + editorWidget = new AuthorUI(qobject_cast(m_object), parent); break; case EntryBadge: - editorWidget = new BadgeUI(qobject_cast(m_object), NULL); + editorWidget = new BadgeUI(qobject_cast(m_object), parent); break; case EntryCoinList: - editorWidget = new CoinListUI(qobject_cast(m_object), NULL); + editorWidget = new CoinListUI(qobject_cast(m_object), parent); break; case EntryCoinListItem: - editorWidget = new CoinListItemUI(qobject_cast(m_object), NULL); + editorWidget = new CoinListItemUI(qobject_cast(m_object), parent); break; case EntryEggGroup: - editorWidget = new EggGroupUI(qobject_cast(m_object), NULL); + editorWidget = new EggGroupUI(qobject_cast(m_object), parent); break; case EntryGlobalScript: - editorWidget = new GlobalScriptUI(qobject_cast(m_object), NULL); + editorWidget = new GlobalScriptUI(qobject_cast(m_object), parent); break; case EntryItem: - editorWidget = new ItemUI(qobject_cast(m_object), NULL); + editorWidget = new ItemUI(qobject_cast(m_object), parent); break; case EntryItemType: - editorWidget = new ItemTypeUI(qobject_cast(m_object), NULL); + editorWidget = new ItemTypeUI(qobject_cast(m_object), parent); break; case EntryMap: - editorWidget = new MapUI(qobject_cast(m_object), NULL); + editorWidget = new MapUI(qobject_cast(m_object), parent); break; case EntryMapEffect: - editorWidget = new MapEffectUI(qobject_cast(m_object), NULL); + editorWidget = new MapEffectUI(qobject_cast(m_object), parent); break; case EntryMapTrainer: - editorWidget = new MapTrainerUI(qobject_cast(m_object), NULL); + editorWidget = new MapTrainerUI(qobject_cast(m_object), parent); break; case EntryMapTrainerTeamMember: - editorWidget = new MapTrainerTeamMemberUI(qobject_cast(m_object), NULL); + editorWidget = new MapTrainerTeamMemberUI(qobject_cast(m_object), parent); break; case EntryMapWarp: - editorWidget = new MapWarpUI(qobject_cast(m_object), NULL); + editorWidget = new MapWarpUI(qobject_cast(m_object), parent); break; case EntryMapWildList: - editorWidget = new MapWildListUI(qobject_cast(m_object), NULL); + editorWidget = new MapWildListUI(qobject_cast(m_object), parent); break; case EntryMapWildListEncounter: - editorWidget = new MapWildListEncounterUI(qobject_cast(m_object), NULL); + editorWidget = new MapWildListEncounterUI(qobject_cast(m_object), parent); break; case EntryMove: - editorWidget = new MoveUI(qobject_cast(m_object), NULL); + editorWidget = new MoveUI(qobject_cast(m_object), parent); break; case EntryNature: - editorWidget = new NatureUI(qobject_cast(m_object), NULL); + editorWidget = new NatureUI(qobject_cast(m_object), parent); break; case EntrySkin: - editorWidget = new SkinUI(qobject_cast(m_object), NULL); + editorWidget = new SkinUI(qobject_cast(m_object), parent); break; case EntrySound: - editorWidget = new SoundUI(qobject_cast(m_object), NULL); + editorWidget = new SoundUI(qobject_cast(m_object), parent); break; case EntrySpecies: - editorWidget = new SpeciesUI(qobject_cast(m_object), NULL); + editorWidget = new SpeciesUI(qobject_cast(m_object), parent); break; case EntrySpeciesMove: - editorWidget = new SpeciesMoveUI(qobject_cast(m_object), NULL); + editorWidget = new SpeciesMoveUI(qobject_cast(m_object), parent); break; case EntrySprite: - editorWidget = new SpriteUI(qobject_cast(m_object), NULL); + editorWidget = new SpriteUI(qobject_cast(m_object), parent); break; case EntryStatus: - editorWidget = new StatusUI(qobject_cast(m_object), NULL); + editorWidget = new StatusUI(qobject_cast(m_object), parent); break; case EntryStore: - editorWidget = new StoreUI(qobject_cast(m_object), NULL); + editorWidget = new StoreUI(qobject_cast(m_object), parent); break; case EntryTile: - editorWidget = new TileUI(qobject_cast(m_object), NULL); + editorWidget = new TileUI(qobject_cast(m_object), parent); break; case EntryTime: - editorWidget = new TimeUI(qobject_cast(m_object), NULL); + editorWidget = new TimeUI(qobject_cast(m_object), parent); break; case EntryTrainer: - editorWidget = new TrainerUI(qobject_cast(m_object), NULL); + editorWidget = new TrainerUI(qobject_cast(m_object), parent); break; case EntryType: - editorWidget = new TypeUI(qobject_cast(m_object), NULL); + editorWidget = new TypeUI(qobject_cast(m_object), parent); break; case EntryWeather: - editorWidget = new WeatherUI(qobject_cast(m_object), NULL); + editorWidget = new WeatherUI(qobject_cast(m_object), parent); break; default: break; -- cgit