mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
* move message_log_widget to game * move files * update headers * fix cmakelists * oracle fixes * split implementation out to cpp * fix recursive import * fix main file * format
This commit is contained in:
parent
f484c98152
commit
17dcaf9afa
337 changed files with 728 additions and 721 deletions
55
cockatrice/src/dialogs/tip_of_the_day.h
Normal file
55
cockatrice/src/dialogs/tip_of_the_day.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#ifndef TIP_OF_DAY_H
|
||||
#define TIP_OF_DAY_H
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QDate>
|
||||
|
||||
class TipOfTheDay
|
||||
{
|
||||
public:
|
||||
explicit TipOfTheDay(QString _title, QString _content, QString _imagePath, QDate _date);
|
||||
QString getTitle() const
|
||||
{
|
||||
return title;
|
||||
}
|
||||
QString getContent() const
|
||||
{
|
||||
return content;
|
||||
}
|
||||
QString getImagePath() const
|
||||
{
|
||||
return imagePath;
|
||||
}
|
||||
QDate getDate() const
|
||||
{
|
||||
return date;
|
||||
}
|
||||
|
||||
private:
|
||||
QString title, content, imagePath;
|
||||
QDate date;
|
||||
};
|
||||
|
||||
class TipsOfTheDay : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Columns
|
||||
{
|
||||
TitleColumn,
|
||||
ContentColumn,
|
||||
ImagePathColumn,
|
||||
DateColumn,
|
||||
};
|
||||
|
||||
explicit TipsOfTheDay(QString xmlPath, QObject *parent = nullptr);
|
||||
~TipsOfTheDay() override;
|
||||
TipOfTheDay getTip(int tipId);
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role) const override;
|
||||
|
||||
private:
|
||||
QList<TipOfTheDay> *tipList;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue