Manages and provides access to the data displayed in the file conflicts window.
More...
#include <conflictsmodel.h>
|
| ConflictsModel (QObject *parent=nullptr) |
| Constructor.
|
|
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| Returns the horizontal header section names and vertical header section indices.
|
|
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of rows to display.
|
|
int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of columns to display.
|
|
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| Used to access the data stored in this model.
|
|
void | setConflicts (const std::vector< ConflictInfo > &newConflicts, int base_id) |
| Updates the data in this model with the new conflicts.
|
|
|
static constexpr int | file_col = 0 |
| Index of the file path column.
|
|
static constexpr int | winner_col = 1 |
| Index of the winning mod column.
|
|
static constexpr int | order_col = 2 |
| Index of the overwrite order column.
|
|
|
std::vector< ConflictInfo > | conflicts_ |
| For every conflict: File, winner name and winner id.
|
|
int | base_id_ |
| Id of the mod for which the conflicts are displayed.
|
|
Manages and provides access to the data displayed in the file conflicts window.
◆ ConflictsModel()
ConflictsModel::ConflictsModel |
( |
QObject * | parent = nullptr | ) |
|
|
explicit |
Constructor.
- Parameters
-
parent | Parent for this model. |
◆ columnCount()
int ConflictsModel::columnCount |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
|
override |
Returns the number of columns to display.
- Parameters
-
- Returns
- The number of columns.
◆ data()
QVariant ConflictsModel::data |
( |
const QModelIndex & | index, |
|
|
int | role = Qt::DisplayRole ) const |
|
override |
Used to access the data stored in this model.
- Parameters
-
index | Holds row and column for which to return data. |
role | Describes type of data to return. |
- Returns
- The requested data.
◆ headerData()
QVariant ConflictsModel::headerData |
( |
int | section, |
|
|
Qt::Orientation | orientation, |
|
|
int | role = Qt::DisplayRole ) const |
|
override |
Returns the horizontal header section names and vertical header section indices.
- Parameters
-
section | Target section. |
orientation | Header orientation. |
role | Data role. |
- Returns
- Name of the section.
◆ rowCount()
int ConflictsModel::rowCount |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
|
override |
Returns the number of rows to display.
- Parameters
-
- Returns
- The number of rows.
◆ setConflicts()
void ConflictsModel::setConflicts |
( |
const std::vector< ConflictInfo > & | newConflicts, |
|
|
int | base_id ) |
Updates the data in this model with the new conflicts.
- Parameters
-
newConflicts | Contains file, winner name and winner id for every conflict. |
base_id | Id of the mod for which the conflicts are displayed. |
The documentation for this class was generated from the following files: