Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
SetsModel Class Reference

#include <card_sets_model.h>

Inheritance diagram for SetsModel:
[legend]
Collaboration diagram for SetsModel:
[legend]

Public Types

enum  SetsColumns {
  SortKeyCol , IsKnownCol , EnabledCol , LongNameCol ,
  ShortNameCol , SetTypeCol , ReleaseDateCol , PriorityCol
}
enum  Role { SortRole = Qt::UserRole }

Public Member Functions

 SetsModel (CardDatabase *_db, QObject *parent=nullptr)
 ~SetsModel () override
int rowCount (const QModelIndex &parent=QModelIndex()) const override
int columnCount (const QModelIndex &parent=QModelIndex()) const override
QVariant data (const QModelIndex &index, int role) const override
bool setData (const QModelIndex &index, const QVariant &value, int role) override
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Qt::ItemFlags flags (const QModelIndex &index) const override
Qt::DropActions supportedDropActions () const override
QMimeData * mimeData (const QModelIndexList &indexes) const override
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
QStringList mimeTypes () const override
void swapRows (int oldRow, int newRow)
void toggleRow (int row, bool enable)
void toggleRow (int row)
void toggleAll (bool)
void sort (int column, Qt::SortOrder order=Qt::AscendingOrder) override
void save (CardDatabase *db)
void restore (CardDatabase *db)
void restoreOriginalOrder ()

Private Attributes

CardSetList sets
QSet< CardSetPtrenabledSets

Static Private Attributes

static const int NUM_COLS = 7

Friends

class SetsProxyModel

Member Enumeration Documentation

◆ Role

Enumerator
SortRole 

◆ SetsColumns

Enumerator
SortKeyCol 
IsKnownCol 
EnabledCol 
LongNameCol 
ShortNameCol 
SetTypeCol 
ReleaseDateCol 
PriorityCol 

Constructor & Destructor Documentation

◆ SetsModel()

SetsModel::SetsModel ( CardDatabase * _db,
QObject * parent = nullptr )
explicit

◆ ~SetsModel()

SetsModel::~SetsModel ( )
overridedefault

Member Function Documentation

◆ columnCount()

int SetsModel::columnCount ( const QModelIndex & parent = QModelIndex()) const
inlinenodiscardoverride
Here is the caller graph for this function:

◆ data()

QVariant SetsModel::data ( const QModelIndex & index,
int role ) const
nodiscardoverride
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dropMimeData()

bool SetsModel::dropMimeData ( const QMimeData * data,
Qt::DropAction action,
int row,
int column,
const QModelIndex & parent )
override
Here is the call graph for this function:

◆ flags()

Qt::ItemFlags SetsModel::flags ( const QModelIndex & index) const
nodiscardoverride
Here is the call graph for this function:
Here is the caller graph for this function:

◆ headerData()

QVariant SetsModel::headerData ( int section,
Qt::Orientation orientation,
int role = Qt::DisplayRole ) const
nodiscardoverride

◆ mimeData()

QMimeData * SetsModel::mimeData ( const QModelIndexList & indexes) const
nodiscardoverride

◆ mimeTypes()

QStringList SetsModel::mimeTypes ( ) const
nodiscardoverride

◆ restore()

void SetsModel::restore ( CardDatabase * db)
Here is the call graph for this function:

◆ restoreOriginalOrder()

void SetsModel::restoreOriginalOrder ( )
Here is the call graph for this function:

◆ rowCount()

int SetsModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
nodiscardoverride
Here is the caller graph for this function:

◆ save()

void SetsModel::save ( CardDatabase * db)

◆ setData()

bool SetsModel::setData ( const QModelIndex & index,
const QVariant & value,
int role )
override
Here is the call graph for this function:

◆ sort()

void SetsModel::sort ( int column,
Qt::SortOrder order = Qt::AscendingOrder )
override
Here is the call graph for this function:

◆ supportedDropActions()

Qt::DropActions SetsModel::supportedDropActions ( ) const
nodiscardoverride

◆ swapRows()

void SetsModel::swapRows ( int oldRow,
int newRow )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toggleAll()

void SetsModel::toggleAll ( bool enabled)
Here is the call graph for this function:

◆ toggleRow() [1/2]

void SetsModel::toggleRow ( int row)

◆ toggleRow() [2/2]

void SetsModel::toggleRow ( int row,
bool enable )
Here is the caller graph for this function:

◆ SetsProxyModel

friend class SetsProxyModel
friend

Member Data Documentation

◆ enabledSets

QSet<CardSetPtr> SetsModel::enabledSets
private

◆ NUM_COLS

const int SetsModel::NUM_COLS = 7
staticprivate

◆ sets

CardSetList SetsModel::sets
private

The documentation for this class was generated from the following files: