mirror of
https://github.com/Quill-OS/quill.git
synced 2024-10-31 21:33:22 -07:00
Some QTextDocument things
This commit is contained in:
parent
6ad18aaba7
commit
8d1ec95161
2 changed files with 13 additions and 3 deletions
14
reader.cpp
14
reader.cpp
|
@ -16,7 +16,7 @@
|
|||
#include <QDirIterator>
|
||||
#include <QDebug>
|
||||
#include <QTextDocument>
|
||||
#include <QTextCodec>
|
||||
#include <QSizeF>
|
||||
|
||||
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() {
|
||||
|
|
2
reader.h
2
reader.h
|
@ -6,6 +6,7 @@
|
|||
#include "generaldialog.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTextDocument>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
@ -96,6 +97,7 @@ private:
|
|||
Ui::reader *ui;
|
||||
alert *alertWindow;
|
||||
generalDialog *generalDialogWindow;
|
||||
QTextDocument *textDocument;
|
||||
};
|
||||
|
||||
#endif // READER_H
|
||||
|
|
Loading…
Reference in a new issue