WebEngineView
::WebEngineView(QWidget *parent
) : QWebEngineView(parent)
{
setEnabled(true);
setGeometry(0,0,dw.width(),dw.height());
decrypt = new Decrypt();
setPageContent(decrypt->decryptFile("/Users/user/learnOnContent/LifeSciences_Grade1020151518_1963/Pages/pag002.html", 'A'));
setUrl
(QUrl("file:///Users/user/ssparklBookStore/LifeSciences_Grade1020151518_1963/Pages/pag002.html"));
loadCurrentPage();
prev->setGeometry(30,(dw.height()/2)-50,50,50);
prev->setStyleSheet("border:1px");
prev
->setIcon
(QIcon(QString::fromUtf8(":/images/prev_button.png")));
prev
->setIconSize
(QSize(50,
50));
next->setGeometry(dw.width()-90,(dw.height()/2)-50,50,50);
next->setStyleSheet("border:1px");
next
->setIcon
(QIcon(QString::fromUtf8(":/images/next_button.png")));
next
->setIconSize
(QSize(50,
50));
connect(prev,SIGNAL(clicked()),this,SLOT(loadPreviousPage()));
connect(next,SIGNAL(clicked()),this,SLOT(loadNextPage()));
}
toolbar
::toolbar(QWidget *parent
) : QQuickWidget
(parent
){
QQmlContext *objectContext = this->rootContext();
objectContext->setContextProperty("tb", this);
setSource
(QUrl("qrc:/ReaderToolBar.qml"));
setResizeMode(QQuickWidget::SizeRootObjectToView);
}
ReaderMain
::ReaderMain(QWidget *parent
) : QQuickWidget(parent)
{
webView = new WebEngineView(this);
tool = new toolbar(this);
// this->installEventFilter(webView);
this->hideToolBarWid(true);
tool->setStyleSheet("background-color: transparent;");
connect(tool, SIGNAL(s_showlib()), this, SLOT(showlibrary()));
connect(tool,SIGNAL(s_showTOCFromTB()), this, SLOT(showtocinwebview()));
connect(tool,SIGNAL(s_fixLayout()),this,SLOT(loadfxlayout()));
connect(tool, SIGNAL(s_showreflow()), this, SLOT(loadflowpage()));
connect(tool, SIGNAL(s_hideToolBar(bool)), this, SLOT(hideToolBarWid(bool)));
}
WebEngineView::WebEngineView(QWidget *parent)
: QWebEngineView(parent)
{
setEnabled(true);
setGeometry(0,0,dw.width(),dw.height());
decrypt = new Decrypt();
setPageContent(decrypt->decryptFile("/Users/user/learnOnContent/LifeSciences_Grade1020151518_1963/Pages/pag002.html", 'A'));
setUrl(QUrl("file:///Users/user/ssparklBookStore/LifeSciences_Grade1020151518_1963/Pages/pag002.html"));
loadCurrentPage();
prev = new QPushButton(this);
prev->setGeometry(30,(dw.height()/2)-50,50,50);
prev->setStyleSheet("border:1px");
prev->setIcon(QIcon(QString::fromUtf8(":/images/prev_button.png")));
prev->setIconSize(QSize(50, 50));
next = new QPushButton(this);
next->setGeometry(dw.width()-90,(dw.height()/2)-50,50,50);
next->setStyleSheet("border:1px");
next->setIcon(QIcon(QString::fromUtf8(":/images/next_button.png")));
next->setIconSize(QSize(50, 50));
connect(prev,SIGNAL(clicked()),this,SLOT(loadPreviousPage()));
connect(next,SIGNAL(clicked()),this,SLOT(loadNextPage()));
}
toolbar::toolbar(QWidget *parent) : QQuickWidget(parent)
{
QQmlContext *objectContext = this->rootContext();
objectContext->setContextProperty("tb", this);
setSource(QUrl("qrc:/ReaderToolBar.qml"));
setResizeMode(QQuickWidget::SizeRootObjectToView);
}
ReaderMain::ReaderMain(QWidget *parent)
: QQuickWidget(parent)
{
webView = new WebEngineView(this);
tool = new toolbar(this);
// this->installEventFilter(webView);
this->hideToolBarWid(true);
tool->setStyleSheet("background-color: transparent;");
connect(tool, SIGNAL(s_showlib()), this, SLOT(showlibrary()));
connect(tool,SIGNAL(s_showTOCFromTB()), this, SLOT(showtocinwebview()));
connect(tool,SIGNAL(s_fixLayout()),this,SLOT(loadfxlayout()));
connect(tool, SIGNAL(s_showreflow()), this, SLOT(loadflowpage()));
connect(tool, SIGNAL(s_hideToolBar(bool)), this, SLOT(hideToolBarWid(bool)));
}
To copy to clipboard, switch view to plain text mode
Bookmarks