EHM DAL 0.2.3
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
colour.h
1#pragma once
2
3
4// Application headers
5#include "include/schema/abstract_uid_table_item.h"
6
7// Qt headers
8class QColor;
9class QDataStream;
10#include <memory>
11
12namespace ehm_dal::schema {
13
14// --- Colours --- //
16{
17public:
18 Colour();
19 ~Colour();
20
21 // File i/o
22 bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override;
23 bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override;
24
25 // Get data
26 QColor colour() const;
27 QString text() const override;
28
29 // Initialisation
30 inline bool init() override { return false; }
31
32private:
33 struct Data;
34 std::unique_ptr<Data> data_;
35
36 // Get data
37 QVariant internalData(const qint32 column, const qint32 role) const override;
38
39 // Set data
40 bool setInternalData(const qint32 column,
41 const QVariant &value,
42 const qint32 role,
43 std::vector<qint32> &modified_columns) override;
44};
45
46} // namespace ehm_dal::schema
47
48
The DatabaseVersion class represents the database version number.
Definition: database_version.h:12
The AbstractUidTableItem class represents a row in a Table with id and uid fields.
Definition: abstract_uid_table_item.h:11
Definition: colour.h:16
bool read(QDataStream &in, ehm_dal::database::DatabaseVersion &version) override
Reads a table row from the QDataStream.
QString text() const override
Returns the row's display text. This provides a convenient way to obtain a simple description of the ...
bool init() override
Initialises the table item members. This only needs to be called once per item.
Definition: colour.h:30
bool write(QDataStream &out, ehm_dal::database::DatabaseVersion &version) override
Writes a table row to the QDataStream.