33 const QList<BrowserWindow*> windows =
mApp->windows();
35 m_windowIdHash.insert(window, m_newWindowId++);
39 m_windowIdHash.insert(window, m_newWindowId++);
43 m_windowIdHash.remove(window);
49 qDeleteAll(m_bookmarkTreeNodes);
50 qDeleteAll(m_cookies);
51 qDeleteAll(m_historyItems);
54 qDeleteAll(m_windows);
68 m_bookmarkTreeNodes.insert(item, node);
75 QmlCookie *qmlCookie = m_cookies.value(cookie);
77 qmlCookie =
new QmlCookie(
new QNetworkCookie(cookie));
78 m_cookies.insert(cookie, qmlCookie);
88 m_historyItems.insert(entry, item);
95 QmlTab *tab = m_tabs.value(webTab);
98 m_tabs.insert(webTab, tab);
108 m_urls.insert({title, url}, visitedUrl);
115 QmlWindow *qmlWindow = m_windows.value(window);
118 m_windows.insert(window, qmlWindow);
125 return m_windowIdHash;
131 if (QIcon::hasThemeIcon(iconPath)) {
132 icon = QIcon::fromTheme(iconPath);
135 icon = QIcon(fileUtils.
resolve(iconPath));
143 QQmlEngine::setObjectOwnership(bookmarks, QQmlEngine::CppOwnership);
150 QQmlEngine::setObjectOwnership(history, QQmlEngine::CppOwnership);
157 QQmlEngine::setObjectOwnership(cookies, QQmlEngine::CppOwnership);
164 QQmlEngine::setObjectOwnership(topSites, QQmlEngine::CppOwnership);
170 static auto *tabs =
new QmlTabs(
this);
171 QQmlEngine::setObjectOwnership(tabs, QQmlEngine::CppOwnership);
178 QQmlEngine::setObjectOwnership(clipboard, QQmlEngine::CppOwnership);
185 QQmlEngine::setObjectOwnership(windows, QQmlEngine::CppOwnership);
192 QQmlEngine::setObjectOwnership(externalJsObject, QQmlEngine::CppOwnership);
193 return externalJsObject;
199 QQmlEngine::setObjectOwnership(userScripts, QQmlEngine::CppOwnership);
void mainWindowDeleted(BrowserWindow *window)
void mainWindowCreated(BrowserWindow *window)
The class exposing the bookmark item to QML.
The class exposing the Bookmarks API to QML.
The class exposing application clipboard to QML.
The class exposing QNetworkCookie to QML.
The class exposing Cookies API to QML.
The QmlFileUtils class, exposed to QML as FileUtils.
Q_INVOKABLE QString resolve(const QString &filePath)
Get the path of the file within the plugin directory. If the filePath provided is resolved to be outs...
The class exposing the History API to QML.
The class exposing HistoryEntry to QML.
The class exposing MostVisitedUrl type to QML.
QmlClipboard * getClipboardSingleton()
QHash< BrowserWindow *, int > windowIdHash()
QmlCookie * getCookie(const QNetworkCookie &cookie)
QmlBookmarks * getBookmarksSingleton()
QmlTab * getTab(WebTab *webTab)
QmlUserScripts * getUserScriptsSingleton()
QmlHistoryItem * getHistoryItem(const HistoryEntry &entry)
QmlExternalJsObject * getExternalJsObjectSingleton()
QmlTopSites * getTopSitesSingleton()
QmlStaticData(QObject *parent=nullptr)
static QmlStaticData & instance()
QmlWindow * getWindow(BrowserWindow *window)
QIcon getIcon(const QString &iconPath, const QString &pluginPath)
QmlTabs * getTabsSingleton()
QmlCookies * getCookiesSingleton()
QmlMostVisitedUrl * getMostVisitedUrl(const QString &title=QString(), const QString &url=QString())
QmlBookmarkTreeNode * getBookmarkTreeNode(BookmarkItem *item)
QmlWindows * getWindowsSingleton()
QmlHistory * getHistorySingleton()
The class exposing a browser tab to QML.
The class exposing Tabs API to QML.
The class exposing TopSites API to QML.
The class exposing QWebEngineScriptCollection to QML.
The class exposing Browser window to QML.
The class exposing Windows API to QML.