36#include <QContextMenuEvent>
42 , m_menu(new
Menu(this))
46 connect(
this, SIGNAL(loadStarted()),
this, SLOT(slotLoadStarted()));
47 connect(
this, SIGNAL(loadProgress(
int)),
this, SLOT(slotLoadProgress(
int)));
48 connect(
this, SIGNAL(loadFinished(
bool)),
this, SLOT(slotLoadFinished()));
55 connect(
page, &WebPage::linkHovered,
this, &TabbedWebView::linkHovered);
68void TabbedWebView::inspectElement()
71 triggerPageAction(QWebEnginePage::InspectElement);
86void TabbedWebView::slotLoadProgress(
int prog)
100void TabbedWebView::slotLoadStarted()
105void TabbedWebView::slotLoadFinished()
107 QHostInfo::lookupHost(url().host(),
this, SLOT(setIp(QHostInfo)));
114void TabbedWebView::setIp(
const QHostInfo &info)
116 if (info.addresses().isEmpty()) {
120 m_currentIp = QStringLiteral(
"%1 (%2)").arg(info.hostName(), info.addresses().at(0).toString());
127void TabbedWebView::linkHovered(
const QString &link)
130 if (link.isEmpty()) {
167 return m_window && m_window->isFullScreen();
185void TabbedWebView::_contextMenuEvent(QContextMenuEvent *event)
193 m_menu->addSeparator();
194 m_menu->addAction(tr(
"Inspect Element"),
this, &TabbedWebView::inspectElement);
197 if (!m_menu->isEmpty()) {
199 const QPoint pos =
event->globalPos();
200 QPoint p(pos.x(), pos.y() + 1);
209void TabbedWebView::_mouseMoveEvent(QMouseEvent *event)
211 if (m_window && m_window->isFullScreen()) {
215 else if (event->position().toPoint().y() < 5) {
bool fullScreenNavigationVisible() const
TabWidget * tabWidget() const
void updateLoadingActions()
void showNavigationWithFullScreen()
void requestHtmlFullScreen(TabbedWebView *view, bool enable)
StatusBar * statusBar() const
TabbedWebView * weView() const
void hideNavigationWithFullScreen()
void showUrl(const QUrl &url)
void showMessage(const QString &message, int timeout=0)
void closeView() override
void ipChanged(const QString &)
void requestFullScreen(bool enable) override
void setPage(WebPage *page)
void userLoadAction(const LoadRequest &req)
BrowserWindow * browserWindow() const
bool isFullScreen() override
void loadInNewTab(const LoadRequest &req, Qz::NewTabPositionFlags position) override
void setBrowserWindow(BrowserWindow *window)
QWidget * overlayWidget() override
TabbedWebView(WebTab *webTab)
WebHitTestResult hitTestContent(const QPoint &pos) const
void showWebInspector(bool inspectElement=false)
bool isCurrentTab() const
LocationBar * locationBar() const
bool haveInspector() const
void addChildTab(WebTab *tab, int index=-1)
void createContextMenu(QMenu *menu, WebHitTestResult &hitTest)
void setPage(WebPage *page)
void load(const QUrl &url)
virtual void _contextMenuEvent(QContextMenuEvent *event)
virtual void _mouseMoveEvent(QMouseEvent *event)