comparison include/gui/pages/anime_list.h @ 10:4b198a111713

Update things actually compile now btw qttest wants to fuck over the model but that might be my fault so /shrug
author Paper <mrpapersonic@gmail.com>
date Sat, 16 Sep 2023 02:06:01 -0400
parents 5c0397762b53
children cde8f67a7c7d
comparison
equal deleted inserted replaced
9:5c0397762b53 10:4b198a111713
47 AL_ID, /* Note: This is only used in Qt::UserRole to make my life easier */ 47 AL_ID, /* Note: This is only used in Qt::UserRole to make my life easier */
48 48
49 NB_COLUMNS 49 NB_COLUMNS
50 }; 50 };
51 51
52 AnimeListWidgetModel(QWidget* parent); 52 AnimeListWidgetModel(QWidget* parent, Anime::ListStatus _status);
53 ~AnimeListWidgetModel() override = default; 53 ~AnimeListWidgetModel() override = default;
54 int rowCount(const QModelIndex& parent = QModelIndex()) const override; 54 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
55 int columnCount(const QModelIndex& parent = QModelIndex()) const override; 55 int columnCount(const QModelIndex& parent = QModelIndex()) const override;
56 QVariant data(const QModelIndex& index, int role) const override; 56 QVariant data(const QModelIndex& index, int role) const override;
57 QVariant headerData(const int section, const Qt::Orientation orientation, const int role) const override; 57 QVariant headerData(const int section, const Qt::Orientation orientation, const int role) const override;
58 void UpdateAnime(int id); 58 void UpdateAnime(int id);
59 void RefreshList();
60 Anime::Anime* GetAnimeFromIndex(QModelIndex index);
61
62 private:
63 Anime::ListStatus status;
64 std::vector<Anime::Anime> list;
59 }; 65 };
60 66
61 /* todo: rename these to "page" or something more 67 /* todo: rename these to "page" or something more
62 sensible than "widget" */ 68 sensible than "widget" */
63 class AnimeListWidget : public QWidget { 69 class AnimeListWidget : public QWidget {
64 Q_OBJECT 70 Q_OBJECT
65 71
66 public: 72 public:
67 AnimeListWidget(QWidget* parent); 73 AnimeListWidget(QWidget* parent);
68 void UpdateAnimeList(); 74 void RefreshList();
69 void Reset(); 75 void Reset();
70 76
71 protected: 77 protected:
72 void paintEvent(QPaintEvent*) override; 78 void paintEvent(QPaintEvent*) override;
73 void InitStyle(QStyleOptionTabWidgetFrame* option) const; 79 void InitStyle(QStyleOptionTabWidgetFrame* option) const;