Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
Loading...
Searching...
No Matches
tip_of_the_day.h
Go to the documentation of this file.
1
6
7
#ifndef TIP_OF_DAY_H
8
#define TIP_OF_DAY_H
9
10
#include <QAbstractListModel>
11
#include <QDate>
12
#include <QModelIndex>
13
#include <QString>
14
#include <qtmetamacros.h>
15
16
class
QObject;
17
template
<
typename
T>
class
QList
;
18
19
class
TipOfTheDay
20
{
21
public
:
22
explicit
TipOfTheDay
(QString _title, QString _content, QString _imagePath, QDate _date);
23
[[nodiscard]] QString
getTitle
()
const
24
{
25
return
title
;
26
}
27
[[nodiscard]] QString
getContent
()
const
28
{
29
return
content
;
30
}
31
[[nodiscard]] QString
getImagePath
()
const
32
{
33
return
imagePath
;
34
}
35
[[nodiscard]] QDate
getDate
()
const
36
{
37
return
date
;
38
}
39
40
private
:
41
QString
title
,
content
,
imagePath
;
42
QDate
date
;
43
};
44
45
class
TipsOfTheDay
:
public
QAbstractListModel
46
{
47
Q_OBJECT
48
public
:
49
enum
Columns
50
{
51
TitleColumn
,
52
ContentColumn
,
53
ImagePathColumn
,
54
DateColumn
,
55
};
56
57
explicit
TipsOfTheDay
(QString xmlPath, QObject *parent =
nullptr
);
58
~TipsOfTheDay
()
override
;
59
TipOfTheDay
getTip
(
int
tipId);
60
[[nodiscard]]
int
rowCount
(
const
QModelIndex &parent = QModelIndex())
const override
;
61
[[nodiscard]] QVariant
data
(
const
QModelIndex &index,
int
role)
const override
;
62
63
private
:
64
QList<TipOfTheDay>
*
tipList
;
65
};
66
67
#endif
QList
Definition
remote_connection_controller.h:20
TipOfTheDay
Definition
tip_of_the_day.h:20
TipOfTheDay::getTitle
QString getTitle() const
Definition
tip_of_the_day.h:23
TipOfTheDay::getContent
QString getContent() const
Definition
tip_of_the_day.h:27
TipOfTheDay::getDate
QDate getDate() const
Definition
tip_of_the_day.h:35
TipOfTheDay::content
QString content
Definition
tip_of_the_day.h:41
TipOfTheDay::date
QDate date
Definition
tip_of_the_day.h:42
TipOfTheDay::getImagePath
QString getImagePath() const
Definition
tip_of_the_day.h:31
TipOfTheDay::imagePath
QString imagePath
Definition
tip_of_the_day.h:41
TipOfTheDay::title
QString title
Definition
tip_of_the_day.h:41
TipOfTheDay::TipOfTheDay
TipOfTheDay(QString _title, QString _content, QString _imagePath, QDate _date)
Definition
tip_of_the_day.cpp:21
TipsOfTheDay
Definition
tip_of_the_day.h:46
TipsOfTheDay::getTip
TipOfTheDay getTip(int tipId)
Definition
tip_of_the_day.cpp:104
TipsOfTheDay::Columns
Columns
Definition
tip_of_the_day.h:50
TipsOfTheDay::ContentColumn
@ ContentColumn
Definition
tip_of_the_day.h:52
TipsOfTheDay::TitleColumn
@ TitleColumn
Definition
tip_of_the_day.h:51
TipsOfTheDay::ImagePathColumn
@ ImagePathColumn
Definition
tip_of_the_day.h:53
TipsOfTheDay::DateColumn
@ DateColumn
Definition
tip_of_the_day.h:54
TipsOfTheDay::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition
tip_of_the_day.cpp:109
TipsOfTheDay::tipList
QList< TipOfTheDay > * tipList
Definition
tip_of_the_day.h:64
TipsOfTheDay::TipsOfTheDay
TipsOfTheDay(QString xmlPath, QObject *parent=nullptr)
Definition
tip_of_the_day.cpp:26
TipsOfTheDay::data
QVariant data(const QModelIndex &index, int role) const override
Definition
tip_of_the_day.cpp:83
cockatrice
src
interface
widgets
dialogs
tip_of_the_day.h
Generated by
1.18.0