configurator/dialogs/HelpBrowser.cpp
2024-09-03 18:59:36 +02:00

21 lines
652 B
C++

#include "HelpBrowser.h"
#include <QToolBar>
HelpBrowser::HelpBrowser(QUrl const &url, QWidget *parent):QMainWindow(parent) {
_browser = new QWebEngineView(this);
_browser->load(url);
QToolBar *tb = addToolBar(tr("Main toolbar"));
QAction *back = new QAction(tr("Back"), tb);
connect(back, &QAction::triggered, _browser, &QWebEngineView::back);
tb->addAction(back);
QAction *forward = new QAction(tr("Forward"), tb);
connect(forward, &QAction::triggered, _browser, &QWebEngineView::forward);
tb->addAction(forward);
setCentralWidget(_browser);
}
void HelpBrowser::closeEvent(QCloseEvent *e) {
QMainWindow::closeEvent(e);
deleteLater();
}