mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 01:23:57 -07:00
update recursiveExpand
This commit is contained in:
parent
ac30d10cb1
commit
18aca5d047
2 changed files with 12 additions and 5 deletions
|
|
@ -545,11 +545,18 @@ void DeckEditorDeckDockWidget::cleanDeck()
|
||||||
deckTagsDisplayWidget->setTags(deckModel->getDeckList()->getTags());
|
deckTagsDisplayWidget->setTags(deckModel->getDeckList()->getTags());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckEditorDeckDockWidget::recursiveExpand(const QModelIndex &index)
|
/**
|
||||||
|
* @brief Expands all parents of the given index.
|
||||||
|
* @param sourceIndex The index to expand (model source index)
|
||||||
|
*/
|
||||||
|
void DeckEditorDeckDockWidget::recursiveExpand(const QModelIndex &sourceIndex)
|
||||||
{
|
{
|
||||||
if (index.parent().isValid())
|
auto index = proxy->mapFromSource(sourceIndex);
|
||||||
recursiveExpand(index.parent());
|
|
||||||
deckView->expand(index);
|
while (index.parent().isValid()) {
|
||||||
|
index = index.parent();
|
||||||
|
deckView->expand(index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,6 @@ private:
|
||||||
|
|
||||||
QAction *aRemoveCard, *aIncrement, *aDecrement, *aSwapCard;
|
QAction *aRemoveCard, *aIncrement, *aDecrement, *aSwapCard;
|
||||||
|
|
||||||
void recursiveExpand(const QModelIndex &index);
|
|
||||||
[[nodiscard]] QModelIndexList getSelectedCardNodes() const;
|
[[nodiscard]] QModelIndexList getSelectedCardNodes() const;
|
||||||
void offsetCountAtIndex(const QModelIndex &idx, int offset);
|
void offsetCountAtIndex(const QModelIndex &idx, int offset);
|
||||||
|
|
||||||
|
|
@ -123,6 +122,7 @@ private slots:
|
||||||
void updateShowBannerCardComboBox(bool visible);
|
void updateShowBannerCardComboBox(bool visible);
|
||||||
void updateShowTagsWidget(bool visible);
|
void updateShowTagsWidget(bool visible);
|
||||||
void syncBannerCardComboBoxSelectionWithDeck();
|
void syncBannerCardComboBoxSelectionWithDeck();
|
||||||
|
void recursiveExpand(const QModelIndex &sourceIndex);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DECK_EDITOR_DECK_DOCK_WIDGET_H
|
#endif // DECK_EDITOR_DECK_DOCK_WIDGET_H
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue