ff7tk 0.80.25
Work with Final Fantasy 7 game data
SlotPreview.h
Go to the documentation of this file.
1/****************************************************************************/
2// copyright 2012 - 2020 Chris Rizzitello <sithlord48@gmail.com> //
3// //
4// This file is part of FF7tk //
5// //
6// FF7tk is free software: you can redistribute it and/or modify //
7// it under the terms of the GNU General Public License as published by //
8// the Free Software Foundation, either version 3 of the License, or //
9// (at your option) any later version. //
10// //
11// FF7tk is distributed in the hope that it will be useful, //
12// but WITHOUT ANY WARRANTY; without even the implied warranty of //
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
14// GNU General Public License for more details. //
15/****************************************************************************/
16#pragma once
17
18#include <QLabel>
19
20#ifndef ff7tkwidgets_export_h
21 #include <ff7tkwidgets_export.h>
22#endif
23
24class QHBoxLayout;
25class QPushButton;
26class QVBoxLayout;
27class SaveIcon;
28
34class FF7TKWIDGETS_EXPORT SlotPreview : public QLabel
35{
36 Q_OBJECT
37public:
39 enum MODE {MODE_EMPTY, MODE_PSXGAME, MODE_FF7SAVE };
40 SlotPreview(int index = 0, qreal Scale = 1, QWidget *parent = nullptr);
41 int index(void);
42 void setParty(QPixmap p1, QPixmap p2, QPixmap p3);
43 void setParty(QString p1_style, QString p2_style, QString p3_style);
44 void setName(QString);
45 void setLevel(int);
46 void setLocation(QString);
47 void setGil(int);
48 void setTime(int hour, int min);
49 void setPsxIcon(QByteArray icon_data, quint8 frames = 1);
50 void setPsxIcon(QList<QByteArray> icon_data);
51 void setMode(int mode);
52
53signals:
54 void clicked(int);
56 void btn_copy_clicked(int);
59protected:
60 void mousePressEvent(QMouseEvent *ev);
61
62private:
63 void init_display(void);
64 void set_ff7_save(void);
65 void set_empty(void);
66 void set_psx_game(void);
67 QLabel *party1 = nullptr;
68 QLabel *party2 = nullptr;
69 QLabel *party3 = nullptr;
70 QLabel *name = nullptr;
71 QLabel *lbl_Slot = nullptr;
72 QLabel *lbl_time = nullptr;
73 QLabel *lbl_level = nullptr;
74 QLabel *location = nullptr;
75 QLabel *lbl_gil = nullptr;
76 QPushButton *btn_copy = nullptr;
77 QPushButton *btn_paste = nullptr;
78 QPushButton *btn_remove = nullptr;
79 SaveIcon *icon = nullptr;
80 QHBoxLayout *btnLayout = nullptr;
81 QVBoxLayout *Final = nullptr;
82 QVBoxLayout *top_layout = nullptr;
83 qreal scale;
84 int m_index;
85 static inline QString _previewStyle = QStringLiteral(R"(SlotPreview{border: .5ex solid;}\nQPushButton{border: 1px solid})");
86 static inline QString _genericStyle = QStringLiteral(R"(font: 75 16pt "Verdana"; color: white)");
87 static inline QString _ff7SlotStyle = QStringLiteral(R"(background-color:rgba(0,0,0,0);font: 75 16pt "Verdana";color:white)");
88 static inline QString _emptyTextStyle = QStringLiteral(R"(font: 75 20pt "Verdana"; color:yellow;)");
89};
PSX icon data as a QPixmap.
Definition: SaveIcon.h:29
Preview a Single Slot on a Psx memory card or FF7 Save file.
Definition: SlotPreview.h:35
void clicked(int)
Signal: User Clicked on preview, returns index of click.
MODE
Definition: SlotPreview.h:39
void btn_paste_clicked(int)
Signal: User Clicked on paste, returns index of click.
void btn_copy_clicked(int)
Signal: User Clicked on copy, returns index of click.
void btn_remove_clicked(int)
Signal: User Clicked on remove, returns index of click.