diff --git a/reader.cpp b/reader.cpp index 23e3d8c..356ae47 100644 --- a/reader.cpp +++ b/reader.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include using namespace std; @@ -29,8 +29,7 @@ reader::reader(QWidget *parent) : global::battery::showCriticalBatteryAlert = true; // QTextDocument - QTextDocument *text = new QTextDocument(); - + QTextDocument *textDocument = new QTextDocument(); ui->setupUi(this); ui->previousBtn->setProperty("type", "borderless"); @@ -507,6 +506,15 @@ int reader::setup_book(QString book) { bookFile.close(); ittext = content; + textDocument->setHtml(content); + + // Getting the screen's size + float sW = QGuiApplication::screens()[0]->size().width(); + float sH = QGuiApplication::screens()[0]->size().height(); + QSizeF textDocumentSize(sW, sH); + textDocument->setPageSize(textDocumentSize); + + return 0; } void reader::checkwords() { diff --git a/reader.h b/reader.h index 756f720..1443690 100644 --- a/reader.h +++ b/reader.h @@ -6,6 +6,7 @@ #include "generaldialog.h" #include +#include using namespace std; @@ -96,6 +97,7 @@ private: Ui::reader *ui; alert *alertWindow; generalDialog *generalDialogWindow; + QTextDocument *textDocument; }; #endif // READER_H