23#include <QWebEngineHistory>
30 QQmlEngine::setObjectOwnership(
this, QQmlEngine::CppOwnership);
91 req.
setUrl(QUrl::fromEncoded(
url.toUtf8()));
205 if (!m_webPage && !m_webTab) {
217 if (!m_webPage && !m_webTab) {
234 return QString::fromUtf8(m_webTab->
url().toEncoded());
243 return m_webTab->
title();
352 return m_webTab->
webView()->history()->canGoBack();
361 return m_webTab->
webView()->history()->canGoForward();
370 auto *tabbedWebView = qobject_cast<TabbedWebView*>(m_webPage->
view());
371 m_webTab = tabbedWebView->webTab();
377void QmlTab::createConnections()
379 Q_ASSERT(m_lambdaConnections.length() == 0);
384 m_lambdaConnections.append(titleChangedConnection);
389 m_lambdaConnections.append(pinnedChangedConnection);
394 m_lambdaConnections.append(loadingChangedConnection);
399 m_lambdaConnections.append(mutedChangedConnection);
404 m_lambdaConnections.append(restoredChangedConnection);
409 m_lambdaConnections.append(playingChangedConnection);
419void QmlTab::removeConnections()
void setUrl(const QUrl &url)
static QmlStaticData & instance()
QmlWindow * getWindow(BrowserWindow *window)
Q_INVOKABLE void detach()
Detaches the tab.
int index
index of the tab
bool pinned
checks if the tab is pinned
Q_INVOKABLE void printPage()
Prints the page.
bool restored
checks if the tab is restored
Q_INVOKABLE void reload()
Reloads webview associated with the tab.
void pinnedChanged(bool pinned)
The signal emitted when pinned state of the tab is changed.
void setWebPage(WebPage *webPage)
bool loading
checks if the tab is loading
void backgroundActivityChanged(int backgroundActivityChanged)
The signal emitted when background activity of the tab is changed.
int loadingProgress
get the loading progress of the tab
bool backgroundActivity
checks if the tab has associated background activity
QString title
title of the tab
int zoomLevel
zoom level of the tab
Q_INVOKABLE void showSource()
Shows the page source.
Q_INVOKABLE void stop()
Stops webview associated with the tab.
Q_INVOKABLE void reloadBypassCache()
Reloads the tab by bypassing the cache.
bool current
checks if the tab is the current tab
void titleChanged(const QString &title)
The signal emitted when the tab title is changed.
QmlTab(WebTab *webTab=nullptr, QObject *parent=nullptr)
Q_INVOKABLE void selectAll()
Performs edit select-all on the tab.
Q_INVOKABLE void setZoomLevel(int zoomLevel)
Set the zoom level of the tab.
void restoredChanged(bool restored)
The signal emitted when restored state of the tab is changed.
bool canGoForward
checks if the tab is can go forward
Q_INVOKABLE void back()
Loads the previous page.
void zoomLevelChanged(int zoomLevel)
The signal emitted when zoom level of the tab is changed.
void navigationRequestAccepted(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame)
The signal emitted when navigation request is accepted.
Q_INVOKABLE void unload()
Unloads the tab.
void playingChanged(bool playing)
The signal emitted when playing state of the tab is changed.
Q_INVOKABLE void forward()
Loads the next page.
Q_INVOKABLE void undo()
Performs edit undo on the tab.
QString url
url of the tab
void loadingChanged(bool loading)
The signal emitted when loading state of the tab is changed.
Q_INVOKABLE QVariant execJavaScript(const QJSValue &value)
execute JavaScript function in a page
bool muted
checks if the tab is muted
Q_INVOKABLE void load(const QString &url)
Loads webview associated with the tab.
Q_INVOKABLE void zoomOut()
Increases the zoom level of the tab.
Q_INVOKABLE void zoomReset()
Resets the tab zoom level.
bool playing
checks if the tab is playing
Q_INVOKABLE void redo()
Performs edit redo on the tab.
void mutedChanged(bool muted)
The signal emitted when muted state of the tab is changed.
Q_INVOKABLE void zoomIn()
Decreases the zoom level of the tab.
Q_INVOKABLE QmlWebHitTestResult * hitTestContent(const QPoint &point)
Gets result of web hit test at a given point.
Q_INVOKABLE void sendPageByMail()
Sends page by mail.
bool canGoBack
checks if the tab is can go back
QmlWindow * browserWindow
window of the tab
The class exposing result of WebHitTest to QML.
The class exposing Browser window to QML.
QVariant execJavaScript(const QString &scriptSource, quint32 worldId=UnsafeJsWorld, int timeout=500)
void navigationRequestAccepted(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame)
WebHitTestResult hitTestContent(const QPoint &pos) const
void setZoomLevel(int level)
void mutedChanged(bool muted)
void titleChanged(const QString &title)
bool isCurrentTab() const
void restoredChanged(bool restored)
void pinnedChanged(bool pinned)
QString title(bool allowEmpty=false) const
void load(const LoadRequest &request)
BrowserWindow * browserWindow() const
TabbedWebView * webView() const
void loadingChanged(bool loading)
void playingChanged(bool playing)
bool backgroundActivity() const
int loadingProgress() const
void backgroundActivityChanged(bool)
void zoomLevelChanged(int)
int value(const QColor &c)