quill/locallibrarywidget.h

59 lines
1.3 KiB
C
Raw Normal View History

2022-06-23 08:10:38 -07:00
#ifndef LOCALLIBRARYWIDGET_H
#define LOCALLIBRARYWIDGET_H
#include <QWidget>
2022-06-23 12:34:40 -07:00
#include <QLabel>
2022-06-25 20:22:38 -07:00
#include <QHBoxLayout>
2022-06-23 12:34:40 -07:00
#include "functions.h"
#include "qclickablelabel.h"
2022-06-23 08:10:38 -07:00
namespace Ui {
class localLibraryWidget;
}
class localLibraryWidget : public QWidget
{
Q_OBJECT
public:
2022-06-23 12:34:40 -07:00
QString className = this->metaObject()->className();
2022-06-23 08:10:38 -07:00
explicit localLibraryWidget(QWidget *parent = nullptr);
~localLibraryWidget();
2022-06-23 12:34:40 -07:00
int buttonsNumber;
int sW;
int sH;
int stdIconWidth;
int stdIconHeight;
QJsonDocument databaseJsonDocument;
QJsonObject databaseJsonObject;
QJsonArray databaseJsonArrayList;
int currentPageNumber = 1;
2022-06-25 20:22:38 -07:00
int pagesNumber;
int booksNumber;
int bookTitleTruncateThreshold;
QVector<int> idList;
2022-06-23 12:34:40 -07:00
private slots:
void setupDatabase();
void setupBooksList(int pageNumber);
void on_previousPageBtn_clicked();
void on_nextPageBtn_clicked();
void openBook(int id);
void btnOpenBook(int buttonNumber);
2022-06-26 10:21:43 -07:00
void refreshScreenNative();
2022-06-23 08:10:38 -07:00
private:
2022-06-23 12:34:40 -07:00
Ui::localLibraryWidget * ui;
QVector<QHBoxLayout*> horizontalLayoutArray;
QVector<QLabel*> bookIconArray;
QVector<QClickableLabel*> bookBtnArray;
QVector<QFrame*> lineArray;
signals:
void openBookSignal(QString bookFile, bool relativePath);
2022-06-26 10:21:43 -07:00
void refreshScreen();
2022-06-23 08:10:38 -07:00
};
#endif // LOCALLIBRARYWIDGET_H