mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
More granular decklist signals (#5981)
* Performance stuffs. * Actually make widgets track their indices. * Functional stuff. * More display stuff. * Determine where we will insert the card before actually inserting it in the model. * Allow overlap layouts to insert widgets at specific positions. * Modified signals. * Raise trailing widgets on overlap layout widget insertion. * Nix the logging config changes. * Lint. * Address comments. * Address comments. --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
18d9c1d609
commit
d5dc70ccee
26 changed files with 546 additions and 322 deletions
|
|
@ -25,8 +25,8 @@ private:
|
|||
DecklistCardNode *dataNode;
|
||||
|
||||
public:
|
||||
DecklistModelCardNode(DecklistCardNode *_dataNode, InnerDecklistNode *_parent)
|
||||
: AbstractDecklistCardNode(_parent), dataNode(_dataNode)
|
||||
DecklistModelCardNode(DecklistCardNode *_dataNode, InnerDecklistNode *_parent, int position = -1)
|
||||
: AbstractDecklistCardNode(_parent, position), dataNode(_dataNode)
|
||||
{
|
||||
}
|
||||
int getNumber() const override
|
||||
|
|
@ -92,6 +92,10 @@ signals:
|
|||
public:
|
||||
explicit DeckListModel(QObject *parent = nullptr);
|
||||
~DeckListModel() override;
|
||||
QModelIndex getRoot() const
|
||||
{
|
||||
return nodeToIndex(root);
|
||||
};
|
||||
QString getSortCriteriaForCard(CardInfoPtr info);
|
||||
int rowCount(const QModelIndex &parent) const override;
|
||||
int columnCount(const QModelIndex & /*parent*/ = QModelIndex()) const override;
|
||||
|
|
@ -111,6 +115,7 @@ public:
|
|||
const CardInfoPerSet &cardInfoSet,
|
||||
const QString &zoneName,
|
||||
bool abAddAnyway = false);
|
||||
int findSortedInsertRow(InnerDecklistNode *parent, CardInfoPtr cardInfo) const;
|
||||
void sort(int column, Qt::SortOrder order) override;
|
||||
void cleanList();
|
||||
DeckLoader *getDeckList() const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue