configurator/dialogs/HelpBrowser.cpp

21 lines
652 B
C++
Raw Permalink Normal View History

2024-09-03 16:59:36 +00:00
#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();
}