8#include "TinyWebBrowser.h"
12#include <QDesktopServices>
15#include <QPrintDialog>
19#include "MarbleDebug.h"
20#include "MarbleDirs.h"
21#include "MarbleGlobal.h"
22#include "MarbleLocale.h"
23#include "MarbleWebView.h"
28class TinyWebBrowserPrivate
32static QString guessWikipediaDomain()
34 const QString code = MarbleLocale::languageCode();
39TinyWebBrowser::TinyWebBrowser(
QWidget *parent)
40 : QWebEngineView(parent)
43 auto page =
new MarbleWebPage();
48 connect(page, &MarbleWebPage::linkClicked,
this, &TinyWebBrowser::openExternalLink);
51 pageAction(QWebEnginePage::OpenLinkInNewWindow)->setEnabled(
false);
52 pageAction(QWebEnginePage::OpenLinkInNewWindow)->setVisible(
false);
55TinyWebBrowser::~TinyWebBrowser()
61void TinyWebBrowser::setWikipediaPath(
const QString &relativeUrl)
63 QUrl url(relativeUrl);
69void TinyWebBrowser::print()
76 QWebEngineView::print(&printer);
81QWebEngineView *TinyWebBrowser::createWindow(QWebEnginePage::WebWindowType type)
84 auto view =
new TinyWebBrowser(
this);
88void TinyWebBrowser::openExternalLink(
const QUrl &url)
95#include "moc_TinyWebBrowser.cpp"
QAction * load(const QObject *recvr, const char *slot, QObject *parent)
Binds a QML item to a specific geodetic location in screen coordinates.
bool openUrl(const QUrl &url)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
QUrl resolved(const QUrl &relative) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:14 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.