Freeciv-3.1: plr_model Class Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Public Member Functions | Private Slots | Private Attributes
plr_model Class Reference

`#include <plrdlg.h>`

Inheritance diagram for plr_model:

## Public Member Functions

| plr_model (QObject *parent=0)
| ~plr_model ()
int | rowCount (const QModelIndex &index=QModelIndex()) const
int | columnCount (const QModelIndex &parent=QModelIndex()) const
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::DisplayRole)
QVariant | headerData (int section, Qt::Orientation orientation, int role) const
QVariant | hide_data (int section) const
void | populate ()

## Private Slots

void | notify_plr_changed (int row)

## Private Attributes

QList< plr_item * > | plr_list

## Detailed Description

Definition at line 82 of file plrdlg.h.

## Constructor & Destructor Documentation

## ◆ plr_model()

plr_model::plr_model | ( | QObject * | parent = `0` | ) |

Constructor for player model

Definition at line 201 of file plrdlg.cpp.

## ◆ ~plr_model()

plr_model::~plr_model | ( |  | ) |

Destructor for player model

Definition at line 209 of file plrdlg.cpp.

## Member Function Documentation

## ◆ columnCount()

int plr_model::columnCount | ( | const QModelIndex & | parent = `QModelIndex()` | ) | const

inline

Definition at line 92 of file plrdlg.h.

Referenced by data(), plr_widget::display_header_menu(), plr_widget::hide_columns(), notify_plr_changed(), and setData().

## ◆ data()

QVariant plr_model::data | ( | const QModelIndex & | index,
|  | int | role = `Qt::DisplayRole`
| ) |  | const

Returns data from model

Definition at line 218 of file plrdlg.cpp.

## ◆ headerData()

QVariant plr_model::headerData | ( | int | section,
|  | Qt::Orientation | orientation,
|  | int | role
| ) |  | const

Returns header data from model

Definition at line 235 of file plrdlg.cpp.

Referenced by plr_widget::display_header_menu().

## ◆ hide_data()

QVariant plr_model::hide_data | ( | int | section | ) | const

Returns information about column if hidden

Definition at line 466 of file plrdlg.cpp.

Referenced by plr_widget::hide_columns().

## ◆ notify_plr_changed

void plr_model::notify_plr_changed | ( | int | row | ) |

privateslot

Notifies that row has been changed

Definition at line 278 of file plrdlg.cpp.

Referenced by setData().

## ◆ populate()

void plr_model::populate | ( |  | ) |

Fills model with data

Definition at line 286 of file plrdlg.cpp.

Referenced by plr_model(), and plr_report::update_report().

## ◆ rowCount()

int plr_model::rowCount | ( | const QModelIndex & | index = `QModelIndex()` | ) | const

inline

Definition at line 88 of file plrdlg.h.

Referenced by data(), setData(), and plr_report::update_report().

## ◆ setData()

bool plr_model::setData | ( | const QModelIndex & | index,
|  | const QVariant & | value,
|  | int | role = `Qt::DisplayRole`
| ) |  |

Sets data in model

Definition at line 254 of file plrdlg.cpp.

## Field Documentation

## ◆ plr_list

QList<plr_item *> plr_model::plr_list

private

Definition at line 106 of file plrdlg.h.

Referenced by data(), populate(), rowCount(), setData(), and ~plr_model().