43#include <QDesktopServices>
44#include <QWebEngineHistory>
47#include <QWebEngineContextMenuRequest>
48#include <QStackedLayout>
50#include <QPrintDialog>
52#include <QQuickWidget>
53#include <QtWebEngineWidgetsVersion>
55bool WebView::s_forceContextMenuOnMouseRelease =
false;
58 : QWebEngineView(parent)
60 , m_backgroundActivity(false)
71 m_currentZoomLevel =
zoomLevels().indexOf(100);
74 installEventFilter(
this);
76 parentWidget()->installEventFilter(
this);
84 mApp->plugins()->emitWebPageDeleted(m_page);
92 if (!QWebEngineView::icon().isNull()) {
93 return QWebEngineView::icon();
96 if (url().scheme() == QLatin1String(
"ftp")) {
100 if (url().scheme() == QLatin1String(
"file")) {
109 QString
title = QWebEngineView::title();
115 const QUrl u = url().isEmpty() ? m_page->requestedUrl() : url();
117 if (
title.isEmpty()) {
121 if (
title.isEmpty()) {
122 title = u.toString(QUrl::RemoveFragment);
126 return tr(
"Empty Page");
139 if (m_page ==
page) {
145 Q_EMIT m_page->loadProgress(100);
146 Q_EMIT m_page->loadFinished(
true);
148 mApp->plugins()->emitWebPageDeleted(m_page);
151 page->setParent(
this);
152 QWebEngineView::setPage(
page);
157 Q_EMIT loadStarted();
158 Q_EMIT loadProgress(m_page->m_loadProgress);
174 mApp->plugins()->emitWebPageCreated(m_page);
179 if (m_page && !m_page->acceptNavigationRequest(url, QWebEnginePage::NavigationTypeTyped,
true)) {
183 QWebEngineView::load(url);
193 const QUrl reqUrl = request.
url();
195 if (reqUrl.isEmpty())
198 if (reqUrl.scheme() ==
QL1S(
"javascript")) {
199 const QString scriptSource = reqUrl.toString().mid(11);
202 if (scriptSource.contains(
QL1C(
'%')))
203 page()->runJavaScript(QUrl::fromPercentEncoding(scriptSource.toUtf8()));
205 page()->runJavaScript(scriptSource);
216 return m_progress < 100;
226 return m_backgroundActivity;
231 return m_currentZoomLevel;
236 m_currentZoomLevel = level;
248 return s && s->isVisible() ? s->geometry() : QRect();
253 return m_rwhvqt ? m_rwhvqt :
const_cast<WebView*
>(
this);
260 return url.isValid() && !url.scheme().isEmpty() && (!url.host().isEmpty() || !url.path().isEmpty() || url.hasQuery());
266 return QList<int>() << 30 << 40 << 50 << 67 << 80 << 90 << 100
267 << 110 << 120 << 133 << 150 << 170 << 200
268 << 220 << 233 << 250 << 270 << 285 << 300;
274 return s_forceContextMenuOnMouseRelease;
282 s_forceContextMenuOnMouseRelease = force;
293 setZoomFactor(qreal(
zoomLevels().at(m_currentZoomLevel)) / 100.0);
300 if (m_currentZoomLevel <
zoomLevels().count() - 1) {
301 m_currentZoomLevel++;
308 if (m_currentZoomLevel > 0) {
309 m_currentZoomLevel--;
316 if (m_currentZoomLevel !=
qzSettings->defaultZoomLevel) {
317 m_currentZoomLevel =
qzSettings->defaultZoomLevel;
324 triggerPageAction(QWebEnginePage::Undo);
329 triggerPageAction(QWebEnginePage::Redo);
334 triggerPageAction(QWebEnginePage::Cut);
339 triggerPageAction(QWebEnginePage::Copy);
344 triggerPageAction(QWebEnginePage::Paste);
349 triggerPageAction(QWebEnginePage::SelectAll);
354 QKeyEvent ev(QEvent::KeyPress, Qt::Key_Delete, Qt::NoModifier);
355 QApplication::sendEvent(
this, &ev);
360 triggerPageAction(QWebEnginePage::ReloadAndBypassCache);
365 QWebEngineHistory* history =
page()->history();
367 if (history->canGoBack()) {
370 Q_EMIT urlChanged(url());
376 QWebEngineHistory* history =
page()->history();
378 if (history->canGoForward()) {
381 Q_EMIT urlChanged(url());
389 auto *printer =
new QPrinter();
393 auto *dialog =
new QPrintDialog(printer,
this);
394 dialog->setOptions(QAbstractPrintDialog::PrintToFile | QAbstractPrintDialog::PrintShowPageSize);
396 dialog->setOption(QAbstractPrintDialog::PrintPageRange);
397 dialog->setOption(QAbstractPrintDialog::PrintCollateCopies);
400 if (dialog->exec() == QDialog::Accepted) {
401 if (dialog->printer()->outputFormat() == QPrinter::PdfFormat) {
402 m_page->printToPdf(dialog->printer()->outputFileName(), dialog->printer()->pageLayout());
405 connect(
this, &QWebEngineView::printFinished,
this, [&dialog](
bool success) {
417 if (
title(
true).isEmpty()) {
418 Q_EMIT titleChanged(
title());
424 if (m_progress < 100) {
425 m_progress = progress;
429 if (!qFuzzyCompare(zoomFactor(),
zoomLevels().at(m_currentZoomLevel) / 100.0)) {
439 mApp->history()->addHistoryEntry(
this);
449 if (!url.isEmpty() &&
title(
true).isEmpty()) {
451 const bool oldActivity = m_backgroundActivity;
452 m_backgroundActivity =
true;
453 Q_EMIT titleChanged(
title());
454 m_backgroundActivity = oldActivity;
462 if (!isVisible() && !
isLoading() && !m_backgroundActivity) {
463 m_backgroundActivity =
true;
470 if (
auto* action = qobject_cast<QAction*>(sender())) {
477 if (
auto* action = qobject_cast<QAction*>(sender())) {
478 const QUrl mailUrl = QUrl::fromEncoded(
479 QByteArray(
"mailto:%20?body=" +
480 QUrl::toPercentEncoding(action->data().toString())));
481 QDesktopServices::openUrl(mailUrl);
487 const QUrl mailUrl = QUrl::fromEncoded(QByteArray(
489 QUrl::toPercentEncoding(QString::fromUtf8(url().toEncoded())) +
490 "&subject=" + QUrl::toPercentEncoding(
title())));
491 QDesktopServices::openUrl(mailUrl);
496 if (
auto* action = qobject_cast<QAction*>(sender())) {
497 QApplication::clipboard()->setText(QString::fromUtf8(action->data().toUrl().toEncoded()));
504 const QSet<QString> webPageTypes = {
506 QSL(
"application/xhtml+xml")
508 if (res.isNull() || webPageTypes.contains(res.toString())) {
509 triggerPageAction(QWebEnginePage::SavePage);
511 page()->download(url());
518 triggerPageAction(QWebEnginePage::CopyImageToClipboard);
523 triggerPageAction(QWebEnginePage::DownloadLinkToDisk);
528 triggerPageAction(QWebEnginePage::DownloadImageToDisk);
533 triggerPageAction(QWebEnginePage::DownloadMediaToDisk);
543 if (
auto* action = qobject_cast<QAction*>(sender())) {
544 load(action->data().toUrl());
551 if (url().scheme() ==
QL1S(
"view-source") || url().scheme() ==
QL1S(
"falkon") || url().scheme() ==
QL1S(
"qrc")) {
552 page()->toHtml([](
const QString &html) {
553 std::cout << html.toLocal8Bit().constData() << std::endl;
558 triggerPageAction(QWebEnginePage::ViewSource);
570 if (
auto* act = qobject_cast<QAction*>(sender())) {
571 if (act->data().isValid()) {
576 const LoadRequest req =
mApp->searchEnginesManager()->searchResult(engine, selectedText());
583 if (
auto* act = qobject_cast<QAction*>(sender())) {
584 if (act->data().isValid()) {
589 const LoadRequest req =
mApp->searchEnginesManager()->searchResult(engine, selectedText());
595 if (
auto* action = qobject_cast<QAction*>(sender())) {
596 if (action->data().isNull()) {
600 const QVariantList bData = action->data().value<QVariantList>();
601 const QString bookmarkTitle = bData.at(1).toString().isEmpty() ?
title() : bData.at(1).toString();
610 if (
auto* action = qobject_cast<QAction*>(sender())) {
617 if (
auto* action = qobject_cast<QAction*>(sender())) {
624 Qz::NewTabPositionFlags position =
qzSettings->newTabPosition;
638 if (!url.isEmpty()) {
641 else if (
auto* action = qobject_cast<QAction*>(sender())) {
642 actionUrl = action->data().toUrl();
652 if (!url.isEmpty()) {
655 else if (
auto* action = qobject_cast<QAction*>(sender())) {
656 actionUrl = action->data().toUrl();
664 QWebEngineView::showEvent(event);
666 if (m_backgroundActivity) {
667 m_backgroundActivity =
false;
675 int spellCheckActionCount = 0;
677 const QWebEngineContextMenuRequest *contextMenuDataPtr = lastContextMenuRequest();
678 if (contextMenuDataPtr == NULL) {
681 const QWebEngineContextMenuRequest &contextMenuData = *contextMenuDataPtr;
685 if (!contextMenuData.misspelledWord().isEmpty()) {
686 QFont boldFont = menu->font();
687 boldFont.setBold(
true);
689 for (
const QString &suggestion : contextMenuData.spellCheckerSuggestions()) {
690 QAction *action = menu->addAction(suggestion);
691 action->setFont(boldFont);
693 connect(action, &QAction::triggered,
this, [=]() {
694 page()->replaceMisspelledWord(suggestion);
698 if (menu->actions().isEmpty()) {
699 menu->addAction(tr(
"No suggestions"))->setEnabled(
false);
702 menu->addSeparator();
703 spellCheckActionCount = menu->actions().count();
706 if (!hitTest.
linkUrl().isEmpty() && hitTest.
linkUrl().scheme() !=
QL1S(
"javascript")) {
710 if (!hitTest.
imageUrl().isEmpty()) {
714 if (!hitTest.
mediaUrl().isEmpty()) {
720 if (menu->actions().count() == spellCheckActionCount) {
721 menu->addAction(pageAction(QWebEnginePage::Undo));
722 menu->addAction(pageAction(QWebEnginePage::Redo));
723 menu->addSeparator();
724 menu->addAction(pageAction(QWebEnginePage::Cut));
725 menu->addAction(pageAction(QWebEnginePage::Copy));
726 menu->addAction(pageAction(QWebEnginePage::Paste));
730 QAction *act = menu->addAction(QString());
731 act->setVisible(
false);
736 if (!selectedText().isEmpty()) {
740 if (menu->isEmpty()) {
744 menu->addSeparator();
745 mApp->plugins()->populateWebViewMenu(menu,
this, hitTest);
750 QAction* action = menu->addAction(tr(
"&Back"),
this, SLOT(
back()));
752 action->setEnabled(history()->canGoBack());
754 action = menu->addAction(tr(
"&Forward"),
this, SLOT(
forward()));
756 action->setEnabled(history()->canGoForward());
759 if (url().toString() ==
QL1S(
"falkon:speeddial")) {
760 menu->addSeparator();
761 menu->addAction(QIcon::fromTheme(
QSL(
"list-add")), tr(
"&Add New Page"),
this, &WebView::addSpeedDial);
763 menu->addSeparator();
764 menu->addAction(QIcon::fromTheme(
QSL(
"view-refresh")), tr(
"Reload All Dials"),
this, &WebView::reloadAllSpeedDials);
768 QAction *reloadAction = pageAction(QWebEnginePage::Reload);
769 action = menu->addAction(reloadAction->icon(), reloadAction->text(), reloadAction, &QAction::trigger);
770 action->setVisible(reloadAction->isEnabled());
771 connect(reloadAction, &QAction::changed, action, [=]() {
772 action->setVisible(reloadAction->isEnabled());
775 QAction *stopAction = pageAction(QWebEnginePage::Stop);
776 action = menu->addAction(stopAction->icon(), stopAction->text(), stopAction, &QAction::trigger);
777 action->setVisible(stopAction->isEnabled());
778 connect(stopAction, &QAction::changed, action, [=]() {
779 action->setVisible(stopAction->isEnabled());
782 menu->addSeparator();
784 menu->addAction(QIcon::fromTheme(
QSL(
"document-save")), tr(
"&Save page as..."),
this, &
WebView::savePageAs);
787 menu->addSeparator();
789 menu->addSeparator();
791 const QString scheme = url().scheme();
798 menu->addAction(QIcon::fromTheme(
QSL(
"dialog-information")), tr(
"Show info ab&out site"),
this, &
WebView::showSiteInfo);
803 menu->addSeparator();
805 act->setData(hitTest.
linkUrl());
808 menu->addAction(act);
811 menu->addSeparator();
815 menu->addAction(QIcon::fromTheme(
QSL(
"bookmark-new")), tr(
"B&ookmark link"),
this, &
WebView::bookmarkLink)->setData(bData);
820 menu->addSeparator();
822 if (!selectedText().isEmpty()) {
823 pageAction(QWebEnginePage::Copy)->setIcon(QIcon::fromTheme(
QSL(
"edit-copy")));
824 menu->addAction(pageAction(QWebEnginePage::Copy));
830 menu->addSeparator();
832 auto *act =
new Action(tr(
"Show i&mage"));
836 menu->addAction(act);
840 menu->addSeparator();
843 menu->addSeparator();
845 if (!selectedText().isEmpty()) {
846 pageAction(QWebEnginePage::Copy)->setIcon(QIcon::fromTheme(
QSL(
"edit-copy")));
847 menu->addAction(pageAction(QWebEnginePage::Copy));
855 QString selectedText =
page()->selectedText();
857 menu->addSeparator();
858 if (!menu->actions().contains(pageAction(QWebEnginePage::Copy))) {
859 menu->addAction(pageAction(QWebEnginePage::Copy));
861 menu->addAction(QIcon::fromTheme(
QSL(
"mail-message-new")), tr(
"Send text..."),
this, &
WebView::sendTextByMail)->setData(selectedText);
862 menu->addSeparator();
865 QString selectedString = selectedText.trimmed().remove(QLatin1Char(
'\n'));
866 if (!selectedString.contains(QLatin1Char(
'.'))) {
868 selectedString.append(QLatin1String(
".com"));
870 QUrl guessedUrl = QUrl::fromUserInput(selectedString);
873 auto* act =
new Action(QIcon::fromTheme(
QSL(
"document-open-remote")), tr(
"Go to &web address"));
874 act->setData(guessedUrl);
878 menu->addAction(act);
881 menu->addSeparator();
882 selectedText.truncate(20);
884 selectedText.replace(QLatin1Char(
'\n'), QLatin1Char(
' ')).replace(QLatin1Char(
'\t'), QLatin1Char(
' '));
887 auto* act =
new Action(engine.
icon, tr(
"Search \"%1 ..\" with %2").arg(selectedText, engine.
name));
890 menu->addAction(act);
893 Menu* swMenu =
new Menu(tr(
"Search with..."), menu);
896 const auto engines = searchManager->
allEngines();
898 auto* act =
new Action(en.icon, en.name);
899 act->setData(QVariant::fromValue(en));
903 swMenu->addAction(act);
906 menu->addMenu(swMenu);
914 menu->addSeparator();
915 menu->addAction(paused ? tr(
"&Play") : tr(
"&Pause"),
this, &WebView::toggleMediaPause)->setIcon(QIcon::fromTheme(paused ?
QSL(
"media-playback-start") :
QSL(
"media-playback-pause")));
916 menu->addAction(muted ? tr(
"Un&mute") : tr(
"&Mute"),
this, &WebView::toggleMediaMute)->setIcon(QIcon::fromTheme(muted ?
QSL(
"audio-volume-muted") :
QSL(
"audio-volume-high")));
917 menu->addSeparator();
926 QPointer<QAction> act = action;
929 const QVariantMap &map = res.toMap();
930 if (!act || map.isEmpty())
933 const QUrl url = map.value(
QSL(
"action")).toUrl();
934 const QString method = map.value(
QSL(
"method")).toString();
936 if (!url.isEmpty() && (method ==
QL1S(
"get") || method ==
QL1S(
"post"))) {
937 act->setVisible(
true);
938 act->setIcon(QIcon::fromTheme(
QSL(
"edit-find"), QIcon(
QSL(
":icons/menu/search-icon.svg"))));
939 act->setText(tr(
"Create Search Engine"));
948 mApp->searchEnginesManager()->addEngineFromForm(res.toMap(),
this);
952void WebView::addSpeedDial()
957void WebView::configureSpeedDial()
962void WebView::reloadAllSpeedDials()
967void WebView::toggleMediaPause()
969 triggerPageAction(QWebEnginePage::ToggleMediaPlayPause);
972void WebView::toggleMediaMute()
974 triggerPageAction(QWebEnginePage::ToggleMediaMute);
977void WebView::initializeActions()
979 QAction* undoAction = pageAction(QWebEnginePage::Undo);
980 undoAction->setText(tr(
"&Undo"));
981 undoAction->setShortcut(QKeySequence(
QSL(
"Ctrl+Z")));
982 undoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
983 undoAction->setIcon(QIcon::fromTheme(
QSL(
"edit-undo")));
985 QAction* redoAction = pageAction(QWebEnginePage::Redo);
986 redoAction->setText(tr(
"&Redo"));
987 redoAction->setShortcut(QKeySequence(
QSL(
"Ctrl+Shift+Z")));
988 redoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
989 redoAction->setIcon(QIcon::fromTheme(
QSL(
"edit-redo")));
991 QAction* cutAction = pageAction(QWebEnginePage::Cut);
992 cutAction->setText(tr(
"&Cut"));
993 cutAction->setShortcut(QKeySequence(
QSL(
"Ctrl+X")));
994 cutAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
995 cutAction->setIcon(QIcon::fromTheme(
QSL(
"edit-cut")));
997 QAction* copyAction = pageAction(QWebEnginePage::Copy);
998 copyAction->setText(tr(
"&Copy"));
999 copyAction->setShortcut(QKeySequence(
QSL(
"Ctrl+C")));
1000 copyAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
1001 copyAction->setIcon(QIcon::fromTheme(
QSL(
"edit-copy")));
1003 QAction* pasteAction = pageAction(QWebEnginePage::Paste);
1004 pasteAction->setText(tr(
"&Paste"));
1005 pasteAction->setShortcut(QKeySequence(
QSL(
"Ctrl+V")));
1006 pasteAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
1007 pasteAction->setIcon(QIcon::fromTheme(
QSL(
"edit-paste")));
1009 QAction* selectAllAction = pageAction(QWebEnginePage::SelectAll);
1010 selectAllAction->setText(tr(
"Select All"));
1011 selectAllAction->setShortcut(QKeySequence(
QSL(
"Ctrl+A")));
1012 selectAllAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
1013 selectAllAction->setIcon(QIcon::fromTheme(
QSL(
"edit-select-all")));
1015 QAction* reloadAction = pageAction(QWebEnginePage::Reload);
1016 reloadAction->setText(tr(
"&Reload"));
1017 reloadAction->setIcon(QIcon::fromTheme(
QSL(
"view-refresh")));
1019 QAction* stopAction = pageAction(QWebEnginePage::Stop);
1020 stopAction->setText(tr(
"S&top"));
1021 stopAction->setIcon(QIcon::fromTheme(
QSL(
"process-stop")));
1024 addAction(undoAction);
1025 addAction(redoAction);
1026 addAction(cutAction);
1027 addAction(copyAction);
1028 addAction(pasteAction);
1029 addAction(selectAllAction);
1039 if (event->modifiers() & Qt::ControlModifier) {
1042 switch (direction) {
1061 m_wheelHelper.
reset();
1064 if (event->spontaneous()) {
1065 const qreal multiplier = QApplication::wheelScrollLines() / 3.0;
1066 if (multiplier != 1.0) {
1067 QWheelEvent e(event->position(), event->globalPosition(), event->pixelDelta(),
1068 event->angleDelta() * multiplier, event->buttons(),
1069 event->modifiers(), event->phase(), event->inverted(), event->source());
1070 QApplication::sendEvent(m_rwhvqt, &e);
1078 m_clickedUrl = QUrl();
1079 m_clickedPos = QPointF();
1086 switch (event->button()) {
1087 case Qt::BackButton:
1092 case Qt::ForwardButton:
1097 case Qt::MiddleButton:
1099 if (!m_clickedUrl.isEmpty())
1103 case Qt::LeftButton:
1119 switch (event->button()) {
1120 case Qt::BackButton:
1121 case Qt::ForwardButton:
1125 case Qt::MiddleButton:
1126 if (!m_clickedUrl.isEmpty()) {
1128 if (m_clickedUrl == link &&
isUrlValid(link)) {
1135 case Qt::LeftButton:
1136 if (!m_clickedUrl.isEmpty()) {
1138 if (m_clickedUrl == link &&
isUrlValid(link)) {
1139 if (event->modifiers() & Qt::ControlModifier) {
1147 case Qt::RightButton:
1148 if (s_forceContextMenuOnMouseRelease) {
1149 QContextMenuEvent ev(QContextMenuEvent::Mouse, event->position().toPoint(), event->globalPosition().toPoint(), event->modifiers());
1174 switch (event->key()) {
1175 case Qt::Key_ZoomIn:
1180 case Qt::Key_ZoomOut:
1186 if (event->modifiers() & Qt::ControlModifier) {
1193 if (event->modifiers() & Qt::ControlModifier) {
1200 if (event->modifiers() & Qt::ControlModifier) {
1207 if (event->modifiers() & Qt::ControlModifier) {
1208 page()->setAudioMuted(!
page()->isAudioMuted());
1224 switch (event->key()) {
1225 case Qt::Key_Escape:
1227 triggerPageAction(QWebEnginePage::ExitFullScreen);
1244 QWebEngineView::resizeEvent(event);
1251 if (s_forceContextMenuOnMouseRelease)
1254 const QPoint pos =
event->pos();
1255 const QPoint globalPos =
event->globalPos();
1256 const QContextMenuEvent::Reason reason =
event->reason();
1258 QTimer::singleShot(0,
this, [
this, pos, globalPos, reason]() {
1259 QContextMenuEvent ev(reason, pos, globalPos);
1266 return QWebEngineView::focusNextPrevChild(next);
1277 if (obj ==
this && event->type() == QEvent::ParentChange && parentWidget()) {
1278 parentWidget()->installEventFilter(
this);
1282 if (obj ==
this && event->type() == QEvent::ChildAdded) {
1283 QPointer<QWidget> child = qobject_cast<QWidget*>(
static_cast<QChildEvent*
>(event)->child());
1284 QTimer::singleShot(0,
this, [=]() {
1287 m_rwhvqt->installEventFilter(
this);
1288 if (
auto *w = qobject_cast<QQuickWidget*>(m_rwhvqt)) {
1289 w->setClearColor(palette().color(QPalette::Window));
1296#define HANDLE_EVENT(f, t) \
1298 bool wasAccepted = event->isAccepted(); \
1299 event->setAccepted(false); \
1300 f(static_cast<t*>(event)); \
1301 bool ret = event->isAccepted(); \
1302 event->setAccepted(wasAccepted); \
1306 if (obj == m_rwhvqt) {
1307 switch (event->type()) {
1308 case QEvent::MouseButtonPress:
1311 case QEvent::MouseButtonRelease:
1314 case QEvent::MouseMove:
1325 if (obj == parentWidget()) {
1326 switch (event->type()) {
1327 case QEvent::KeyPress:
1330 case QEvent::KeyRelease:
1341 switch (event->type()) {
1342 case QEvent::KeyPress:
1343 case QEvent::KeyRelease:
1344 case QEvent::MouseButtonPress:
1345 case QEvent::MouseButtonRelease:
1346 case QEvent::MouseMove:
1352 triggerPageAction(QWebEnginePage::ExitFullScreen);
1361 const bool res = QWebEngineView::eventFilter(obj, event);
1363 if (obj == m_rwhvqt) {
1364 switch (event->type()) {
1365 case QEvent::FocusIn:
1366 case QEvent::FocusOut:
void saveIcon(WebView *view)
static QIcon settingsIcon()
static QIcon iconForUrl(const QUrl &url, bool allowNull=false)
static QIcon privateBrowsingIcon()
static IconProvider * instance()
static QIcon newWindowIcon()
static QIcon newTabIcon()
static QIcon standardIcon(QStyle::StandardPixmap icon)
QWebEngineHttpRequest webRequest() const
static QString getFormData(const QPointF &pos)
QVector< Engine > allEngines()
static bool canShowSiteInfo(const QUrl &url)
QString linkTitle() const
void updateWithContextMenuData(const QWebEngineContextMenuRequest &data)
bool isContentEditable() const
static void pushView(QWebEngineView *view)
static void unregisterView(QWebEngineView *view)
static void registerView(QWebEngineView *view)
void privacyChanged(bool status)
static QStringList internalSchemes()
WebHitTestResult hitTestContent(const QPoint &pos) const
QPointF mapToViewport(const QPointF &pos) const
void createContextMenu(QMenu *menu, WebHitTestResult &hitTest)
bool backgroundActivity() const
void downloadMediaToDisk()
void showNotification(QWidget *)
static bool isUrlValid(const QUrl &url)
static QList< int > zoomLevels()
void downloadLinkToDisk()
int loadingProgress() const
void backgroundActivityChanged(bool)
virtual bool isFullScreen()=0
static bool forceContextMenuOnMouseRelease()
void openUrlInNewWindow()
WebView(QWidget *parent=nullptr)
void copyImageToClipboard()
void slotLoadFinished(bool ok)
QIcon icon(bool allowNull=false) const
void contextMenuEvent(QContextMenuEvent *event) override
void userDefinedOpenUrlInNewTab(const QUrl &url=QUrl(), bool invert=false)
bool focusNextPrevChild(bool next) override
void createSearchEngine()
void pageChanged(WebPage *page)
void createLinkContextMenu(QMenu *menu, const WebHitTestResult &hitTest)
virtual void _wheelEvent(QWheelEvent *event)
virtual void _mousePressEvent(QMouseEvent *event)
void privacyChanged(bool)
void setPage(WebPage *page)
void checkForForm(QAction *action, const QPoint &pos)
void searchSelectedText()
virtual void _keyPressEvent(QKeyEvent *event)
void load(const QUrl &url)
virtual void _contextMenuEvent(QContextMenuEvent *event)
void createImageContextMenu(QMenu *menu, const WebHitTestResult &hitTest)
void addNotification(QWidget *notif)
void resizeEvent(QResizeEvent *event) override
void slotTitleChanged(const QString &title)
void openUrlInNewTab(const QUrl &url, Qz::NewTabPositionFlags position)
virtual void _keyReleaseEvent(QKeyEvent *event)
void zoomLevelChanged(int)
void loadRequest(const LoadRequest &req)
static void setForceContextMenuOnMouseRelease(bool force)
void userDefinedOpenUrlInBgTab(const QUrl &url=QUrl())
QPointF mapToViewport(const QPointF &pos) const
QString title(bool allowEmpty=false) const
void openUrlInSelectedTab()
void createMediaContextMenu(QMenu *menu, const WebHitTestResult &hitTest)
void openUrlInBackgroundTab()
void searchSelectedTextInBackgroundTab()
void setZoomLevel(int level)
void downloadImageToDisk()
virtual void _mouseMoveEvent(QMouseEvent *event)
void showEvent(QShowEvent *event) override
void viewportResized(QSize)
void createPageContextMenu(QMenu *menu)
QRect scrollBarGeometry(Qt::Orientation orientation) const
void slotUrlChanged(const QUrl &url)
QWidget * inputWidget() const
void copyLinkToClipboard()
bool eventFilter(QObject *obj, QEvent *event) override
void createSelectedTextContextMenu(QMenu *menu, const WebHitTestResult &hitTest)
virtual void loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position)=0
virtual void _mouseReleaseEvent(QMouseEvent *event)
void slotLoadProgress(int progress)
Direction takeDirection()
void processEvent(QWheelEvent *event)
FALKON_EXPORT const char * VERSION
FALKON_EXPORT const char * WWWADDRESS
#define HANDLE_EVENT(f, t)