summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2016-11-16 12:53:06 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-02-10 10:35:34 +0000
commit9464e7f4646ce4bdc8e16c1716bf07345531db28 (patch)
tree85bb84ccc9b35fee9fbbe61b8ae955fbcd05090a
parent49f2cb3d576f5940e296dd475749025f336429a3 (diff)
downloadqtwebengine-9464e7f4646ce4bdc8e16c1716bf07345531db28.tar.gz
Remove new API added in 5.7
Return the API to what it was in 5.6 Change-Id: I25e7f321802cfd69017120d5645e93c6e0d2fd32 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r--examples/webengine/quicknanobrowser/BrowserWindow.qml18
-rw-r--r--examples/webenginewidgets/demobrowser/browserapplication.cpp85
-rw-r--r--examples/webenginewidgets/demobrowser/browserapplication.h12
-rw-r--r--examples/webenginewidgets/demobrowser/browsermainwindow.cpp35
-rw-r--r--examples/webenginewidgets/demobrowser/browsermainwindow.h3
-rw-r--r--examples/webenginewidgets/demobrowser/demobrowser.pro6
-rw-r--r--examples/webenginewidgets/demobrowser/printtopdfdialog.cpp132
-rw-r--r--examples/webenginewidgets/demobrowser/printtopdfdialog.h86
-rw-r--r--examples/webenginewidgets/demobrowser/printtopdfdialog.ui119
-rw-r--r--examples/webenginewidgets/demobrowser/savepagedialog.cpp139
-rw-r--r--examples/webenginewidgets/demobrowser/savepagedialog.h90
-rw-r--r--examples/webenginewidgets/demobrowser/savepagedialog.ui139
-rw-r--r--examples/webenginewidgets/demobrowser/settings.cpp9
-rw-r--r--examples/webenginewidgets/demobrowser/settings.ui130
-rw-r--r--examples/webenginewidgets/demobrowser/tabwidget.cpp78
-rw-r--r--examples/webenginewidgets/demobrowser/tabwidget.h7
-rw-r--r--examples/webenginewidgets/demobrowser/urllineedit.cpp9
-rw-r--r--examples/webenginewidgets/demobrowser/urllineedit.h2
-rw-r--r--examples/webenginewidgets/demobrowser/webview.cpp74
-rw-r--r--examples/webenginewidgets/demobrowser/webview.h9
-rw-r--r--examples/webenginewidgets/simplebrowser/browser.cpp11
-rw-r--r--examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc13
-rw-r--r--examples/webenginewidgets/simplebrowser/main.cpp3
-rw-r--r--examples/webenginewidgets/simplebrowser/simplebrowser.pro2
-rw-r--r--examples/webenginewidgets/simplebrowser/tabwidget.cpp16
-rw-r--r--examples/webenginewidgets/simplebrowser/webpopupwindow.cpp7
-rw-r--r--examples/webenginewidgets/simplebrowser/webview.cpp55
-rw-r--r--examples/webenginewidgets/simplebrowser/webview.h8
-rw-r--r--src/core/api/qwebengineurlrequestinfo.cpp8
-rw-r--r--src/core/api/qwebengineurlrequestinfo.h2
-rw-r--r--src/core/config/common.pri2
-rw-r--r--src/core/gyp_run.pro9
-rw-r--r--src/src.pro8
-rw-r--r--src/tools/qwebengine_convert_dict/main.cpp183
-rw-r--r--src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro22
-rw-r--r--src/webengine/api/qquickwebenginecertificateerror.cpp3
-rw-r--r--src/webengine/api/qquickwebenginecertificateerror_p.h2
-rw-r--r--src/webengine/api/qquickwebenginecontextmenudata.cpp209
-rw-r--r--src/webengine/api/qquickwebenginecontextmenudata_p.h132
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem.cpp34
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem_p.h12
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem_p_p.h1
-rw-r--r--src/webengine/api/qquickwebenginefaviconprovider.cpp187
-rw-r--r--src/webengine/api/qquickwebenginefaviconprovider_p_p.h87
-rw-r--r--src/webengine/api/qquickwebenginehistory.cpp17
-rw-r--r--src/webengine/api/qquickwebenginehistory_p.h1
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp42
-rw-r--r--src/webengine/api/qquickwebengineprofile.h5
-rw-r--r--src/webengine/api/qquickwebenginesettings.cpp106
-rw-r--r--src/webengine/api/qquickwebenginesettings_p.h20
-rw-r--r--src/webengine/api/qquickwebengineview.cpp277
-rw-r--r--src/webengine/api/qquickwebengineview_p.h189
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h10
-rw-r--r--src/webengine/doc/qtwebengine.qdocconf1
-rw-r--r--src/webengine/doc/src/qtwebengine-features.qdoc16
-rw-r--r--src/webengine/doc/src/qtwebengine-qmlmodule.qdoc4
-rw-r--r--src/webengine/doc/src/webengineview.qdoc292
-rw-r--r--src/webengine/plugin/experimental/plugin.cpp3
-rw-r--r--src/webengine/plugin/plugin.cpp12
-rw-r--r--src/webengine/plugin/plugin.pro2
-rw-r--r--src/webengine/plugin/plugins.qmltypes712
-rw-r--r--src/webengine/ui/ColorDialog.qml50
-rw-r--r--src/webengine/ui/ui.pro1
-rw-r--r--src/webengine/ui_delegates_manager.cpp37
-rw-r--r--src/webengine/ui_delegates_manager.h2
-rw-r--r--src/webengine/webengine.pro8
-rw-r--r--src/webenginewidgets/api/qwebenginecertificateerror.cpp1
-rw-r--r--src/webenginewidgets/api/qwebenginecertificateerror.h2
-rw-r--r--src/webenginewidgets/api/qwebenginecontextmenudata.cpp199
-rw-r--r--src/webenginewidgets/api/qwebenginecontextmenudata.h92
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.cpp39
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.h10
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem_p.h1
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp284
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h42
-rw-r--r--src/webenginewidgets/api/qwebenginepage_p.h4
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp20
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.h5
-rw-r--r--src/webenginewidgets/api/qwebenginesettings.cpp11
-rw-r--r--src/webenginewidgets/api/qwebenginesettings.h10
-rw-r--r--src/webenginewidgets/api/qwebengineview.cpp26
-rw-r--r--src/webenginewidgets/api/qwebengineview.h3
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc95
-rw-r--r--src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc14
-rw-r--r--src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc12
-rw-r--r--src/webenginewidgets/webenginewidgets.pro6
-rw-r--r--tests/auto/quick/publicapi/tst_publicapi.cpp168
-rw-r--r--tests/auto/quick/qmltests/data/TestWebEngineView.qml2
-rw-r--r--tests/auto/quick/qmltests/data/favicon-candidates-gray.html29
-rw-r--r--tests/auto/quick/qmltests/data/favicon-misc.html11
-rw-r--r--tests/auto/quick/qmltests/data/favicon-multi-gray.html25
-rw-r--r--tests/auto/quick/qmltests/data/favicon-multi.html9
-rw-r--r--tests/auto/quick/qmltests/data/favicon-shortcut.html10
-rw-r--r--tests/auto/quick/qmltests/data/favicon-single.html9
-rw-r--r--tests/auto/quick/qmltests/data/favicon-touch.html10
-rw-r--r--tests/auto/quick/qmltests/data/favicon-unavailable.html9
-rw-r--r--tests/auto/quick/qmltests/data/test4.html11
-rw-r--r--tests/auto/quick/qmltests/data/tst_favIconLoad.qml105
-rw-r--r--tests/auto/quick/qmltests/data/tst_favicon.qml328
-rw-r--r--tests/auto/quick/qmltests/data/tst_faviconDownload.qml120
-rw-r--r--tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml44
-rw-r--r--tests/auto/quick/qmltests/data/tst_runJavaScript.qml1
-rw-r--r--tests/auto/quick/qmltests/data/tst_scrollPosition.qml85
-rw-r--r--tests/auto/quick/qmltests/qmltests.pro21
-rw-r--r--tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp22
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/qwebenginefaviconmanager.pro1
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-misc.html11
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-multi.html9
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-shortcut.html10
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-single.html9
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-touch.html10
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-unavailable.html9
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt144.pngbin8315 -> 0 bytes
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt32.icobin4286 -> 0 bytes
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qtmulti.icobin22382 -> 0 bytes
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/resources/test1.html1
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp478
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.qrc14
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp37
-rw-r--r--tests/auto/widgets/qwebengineprofile/BLACKLIST5
-rw-r--r--tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp73
-rw-r--r--tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp8
-rw-r--r--tests/auto/widgets/qwebenginespellcheck/dict/en-US.aff5
-rw-r--r--tests/auto/widgets/qwebenginespellcheck/dict/en-US.dic11
-rw-r--r--tests/auto/widgets/qwebenginespellcheck/qwebenginespellcheck.pro22
-rw-r--r--tests/auto/widgets/qwebenginespellcheck/resources/index.html36
-rw-r--r--tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp178
-rw-r--r--tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.qrc5
-rw-r--r--tests/auto/widgets/qwebengineview/resources/basic_printing_page.html8
-rw-r--r--tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc1
-rw-r--r--tests/auto/widgets/util.h7
-rw-r--r--tests/auto/widgets/widgets.pro6
132 files changed, 1000 insertions, 5854 deletions
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml
index c008425d9..0b95c0db1 100644
--- a/examples/webengine/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml
@@ -84,8 +84,6 @@ ApplicationWindow {
property alias errorPageEnabled: errorPageEnabled.checked;
property alias pluginsEnabled: pluginsEnabled.checked;
property alias fullScreenSupportEnabled: fullScreenSupportEnabled.checked;
- property alias autoLoadIconsForPage: autoLoadIconsForPage.checked;
- property alias touchIconsEnabled: touchIconsEnabled.checked;
}
Action {
@@ -237,7 +235,6 @@ ApplicationWindow {
z: 2
id: faviconImage
width: 16; height: 16
- sourceSize: Qt.size(width, height)
source: currentWebView && currentWebView.icon
}
style: TextFieldStyle {
@@ -297,19 +294,6 @@ ApplicationWindow {
checked: (currentWebView.profile.httpCacheType == WebEngineProfile.DiskHttpCache)
onToggled: currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache
}
- MenuItem {
- id: autoLoadIconsForPage
- text: "Icons On"
- checkable: true
- checked: WebEngine.settings.autoLoadIconsForPage
- }
- MenuItem {
- id: touchIconsEnabled
- text: "Touch Icons On"
- checkable: true
- checked: WebEngine.settings.touchIconsEnabled
- enabled: autoLoadIconsForPage.checked
- }
}
}
}
@@ -381,8 +365,6 @@ ApplicationWindow {
settings.errorPageEnabled: appSettings.errorPageEnabled
settings.pluginsEnabled: appSettings.pluginsEnabled
settings.fullScreenSupportEnabled: appSettings.fullScreenSupportEnabled
- settings.autoLoadIconsForPage: appSettings.autoLoadIconsForPage
- settings.touchIconsEnabled: appSettings.touchIconsEnabled
onCertificateError: {
error.defer()
diff --git a/examples/webenginewidgets/demobrowser/browserapplication.cpp b/examples/webenginewidgets/demobrowser/browserapplication.cpp
index 26764b93c..cf146ac4f 100644
--- a/examples/webenginewidgets/demobrowser/browserapplication.cpp
+++ b/examples/webenginewidgets/demobrowser/browserapplication.cpp
@@ -72,6 +72,7 @@
#include <QtNetwork/QLocalServer>
#include <QtNetwork/QLocalSocket>
#include <QtNetwork/QNetworkProxy>
+#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QSslSocket>
#include <QWebEngineProfile>
@@ -296,21 +297,6 @@ void BrowserApplication::loadSettings()
defaultProfile->setHttpUserAgent(settings.value(QLatin1String("httpUserAgent")).toString());
defaultProfile->setHttpAcceptLanguage(settings.value(QLatin1String("httpAcceptLanguage")).toString());
-
- switch (settings.value(QLatin1String("faviconDownloadMode"), 1).toInt()) {
- case 0:
- defaultSettings->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, false);
- break;
- case 1:
- defaultSettings->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, true);
- defaultSettings->setAttribute(QWebEngineSettings::TouchIconsEnabled, false);
- break;
- case 2:
- defaultSettings->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, true);
- defaultSettings->setAttribute(QWebEngineSettings::TouchIconsEnabled, true);
- break;
- }
-
settings.endGroup();
settings.beginGroup(QLatin1String("cookies"));
@@ -525,6 +511,10 @@ QNetworkAccessManager *BrowserApplication::networkAccessManager()
{
if (!s_networkAccessManager) {
s_networkAccessManager = new QNetworkAccessManager();
+ connect(s_networkAccessManager, &QNetworkAccessManager::authenticationRequired,
+ BrowserApplication::instance(), &BrowserApplication::authenticationRequired);
+ connect(s_networkAccessManager, &QNetworkAccessManager::proxyAuthenticationRequired,
+ BrowserApplication::instance(), &BrowserApplication::proxyAuthenticationRequired);
}
return s_networkAccessManager;
}
@@ -583,3 +573,68 @@ void BrowserApplication::setPrivateBrowsing(bool privateBrowsing)
}
emit privateBrowsingChanged(privateBrowsing);
}
+
+void BrowserApplication::setLastAuthenticator(QAuthenticator *authenticator)
+{
+ m_lastAuthenticator = QAuthenticator(*authenticator);
+}
+
+void BrowserApplication::setLastProxyAuthenticator(QAuthenticator *authenticator)
+{
+ m_lastProxyAuthenticator = QAuthenticator(*authenticator);
+}
+
+void BrowserApplication::authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator)
+{
+ if (m_lastAuthenticator.isNull())
+ return;
+
+
+ Q_ASSERT(m_lastAuthenticator.option("key").isValid());
+ QByteArray lastKey = m_lastAuthenticator.option("key").toByteArray();
+ QByteArray key = BrowserApplication::authenticationKey(reply->url(), authenticator->realm());
+
+ if (lastKey == key)
+ *authenticator = m_lastAuthenticator;
+}
+
+void BrowserApplication::proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator)
+{
+ if (m_lastProxyAuthenticator.isNull())
+ return;
+
+ QNetworkProxy::ProxyType proxyType = proxy.type();
+ if (proxyType != QNetworkProxy::HttpProxy || proxyType != QNetworkProxy::HttpCachingProxy)
+ return;
+
+ Q_ASSERT(m_lastProxyAuthenticator.option("host").isValid());
+ QByteArray lastKey = m_lastProxyAuthenticator.option("key").toByteArray();
+ QByteArray key = BrowserApplication::proxyAuthenticationKey(proxy, authenticator->realm());
+
+ if (lastKey == key)
+ *authenticator = m_lastAuthenticator;
+}
+
+// TODO: Remove these functions (QTBUG-47967)
+QByteArray BrowserApplication::authenticationKey(const QUrl &url, const QString &realm)
+{
+ QUrl copy = url;
+ copy.setFragment(realm);
+ return "auth:" + copy.toEncoded(QUrl::RemovePassword | QUrl::RemovePath | QUrl::RemoveQuery);
+}
+
+QByteArray BrowserApplication::proxyAuthenticationKey(const QNetworkProxy &proxy, const QString &realm)
+{
+ QString host = QString("%1:%2").arg(proxy.hostName()).arg(proxy.port());
+ return BrowserApplication::proxyAuthenticationKey(proxy.user(), host, realm);
+}
+
+QByteArray BrowserApplication::proxyAuthenticationKey(const QString &user, const QString &host, const QString &realm)
+{
+ QUrl key;
+ key.setScheme(QLatin1String("proxy-http"));
+ key.setUserName(user);
+ key.setHost(host);
+ key.setFragment(realm);
+ return "auth:" + key.toEncoded();
+}
diff --git a/examples/webenginewidgets/demobrowser/browserapplication.h b/examples/webenginewidgets/demobrowser/browserapplication.h
index 5c75d41b3..112adc511 100644
--- a/examples/webenginewidgets/demobrowser/browserapplication.h
+++ b/examples/webenginewidgets/demobrowser/browserapplication.h
@@ -63,6 +63,8 @@
QT_BEGIN_NAMESPACE
class QLocalServer;
class QNetworkAccessManager;
+class QNetworkProxy;
+class QNetworkReply;
class QWebEngineProfile;
QT_END_NAMESPACE
@@ -91,6 +93,14 @@ public:
bool canRestoreSession() const;
bool privateBrowsing() const { return m_privateBrowsing; }
+ void setLastAuthenticator(QAuthenticator *);
+ void setLastProxyAuthenticator(QAuthenticator *);
+
+ // TODO: Remove these functions (QTBUG-47967)
+ static QByteArray authenticationKey(const QUrl &, const QString &);
+ static QByteArray proxyAuthenticationKey(const QNetworkProxy &, const QString &);
+ static QByteArray proxyAuthenticationKey(const QString &, const QString &, const QString &);
+
static HistoryManager *historyManager();
static CookieJar *cookieJar();
static DownloadManager *downloadManager();
@@ -107,6 +117,8 @@ public slots:
void lastWindowClosed();
void quitBrowser();
void setPrivateBrowsing(bool);
+ void authenticationRequired(QNetworkReply *, QAuthenticator *);
+ void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *);
signals:
void privateBrowsingChanged(bool);
diff --git a/examples/webenginewidgets/demobrowser/browsermainwindow.cpp b/examples/webenginewidgets/demobrowser/browsermainwindow.cpp
index f044219ca..92b231fbb 100644
--- a/examples/webenginewidgets/demobrowser/browsermainwindow.cpp
+++ b/examples/webenginewidgets/demobrowser/browsermainwindow.cpp
@@ -56,7 +56,6 @@
#include "chasewidget.h"
#include "downloadmanager.h"
#include "history.h"
-#include "printtopdfdialog.h"
#include "settings.h"
#include "tabwidget.h"
#include "toolbarsearch.h"
@@ -313,10 +312,8 @@ void BrowserMainWindow::setupMenu()
#if defined(QWEBENGINEPAGE_PRINT)
fileMenu->addAction(tr("P&rint Preview..."), this, SLOT(slotFilePrintPreview()));
fileMenu->addAction(tr("&Print..."), this, SLOT(slotFilePrint()), QKeySequence::Print);
-#endif
- fileMenu->addAction(tr("&Print to PDF..."), this, SLOT(slotFilePrintToPDF()));
fileMenu->addSeparator();
-
+#endif
QAction *action = fileMenu->addAction(tr("Private &Browsing..."), this, SLOT(slotPrivateBrowsing()));
action->setCheckable(true);
action->setChecked(BrowserApplication::instance()->privateBrowsing());
@@ -717,36 +714,6 @@ void BrowserMainWindow::slotFilePrint()
#endif
}
-void BrowserMainWindow::slotHandlePdfPrinted(const QByteArray& result)
-{
- if (!result.size())
- return;
-
- QFile file(m_printerOutputFileName);
-
- m_printerOutputFileName.clear();
- if (!file.open(QFile::WriteOnly))
- return;
-
- file.write(result.data(), result.size());
- file.close();
-}
-
-void BrowserMainWindow::slotFilePrintToPDF()
-{
- if (!currentTab() || !m_printerOutputFileName.isEmpty())
- return;
-
- QFileInfo info(QStringLiteral("printout.pdf"));
- PrintToPdfDialog *dialog = new PrintToPdfDialog(info.absoluteFilePath(), this);
- dialog->setWindowTitle(tr("Print to PDF"));
- if (dialog->exec() != QDialog::Accepted || dialog->filePath().isEmpty())
- return;
-
- m_printerOutputFileName = dialog->filePath();
- currentTab()->page()->printToPdf(invoke(this, &BrowserMainWindow::slotHandlePdfPrinted), dialog->pageLayout());
-}
-
#if defined(QWEBENGINEPAGE_PRINT)
void BrowserMainWindow::printRequested(QWebEngineFrame *frame)
{
diff --git a/examples/webenginewidgets/demobrowser/browsermainwindow.h b/examples/webenginewidgets/demobrowser/browsermainwindow.h
index 9fb6b0851..3f939b367 100644
--- a/examples/webenginewidgets/demobrowser/browsermainwindow.h
+++ b/examples/webenginewidgets/demobrowser/browsermainwindow.h
@@ -109,7 +109,6 @@ private slots:
void slotFileOpen();
void slotFilePrintPreview();
void slotFilePrint();
- void slotFilePrintToPDF();
void slotPrivateBrowsing();
void slotFileSaveAs();
void slotEditFind();
@@ -138,7 +137,6 @@ private slots:
void slotOpenActionUrl(QAction *action);
void slotShowWindow();
void slotSwapFocus();
- void slotHandlePdfPrinted(const QByteArray&);
#if defined(QWEBENGINEPAGE_PRINT)
void printRequested(QWebEngineFrame *frame);
@@ -181,7 +179,6 @@ private:
QIcon m_stopIcon;
QString m_lastSearch;
- QString m_printerOutputFileName;
friend class BrowserApplication;
};
diff --git a/examples/webenginewidgets/demobrowser/demobrowser.pro b/examples/webenginewidgets/demobrowser/demobrowser.pro
index aef7b9eac..dd5cb8006 100644
--- a/examples/webenginewidgets/demobrowser/demobrowser.pro
+++ b/examples/webenginewidgets/demobrowser/demobrowser.pro
@@ -15,9 +15,7 @@ FORMS += \
downloads.ui \
history.ui \
passworddialog.ui \
- printtopdfdialog.ui \
proxy.ui \
- savepagedialog.ui \
settings.ui
HEADERS += \
@@ -33,8 +31,6 @@ HEADERS += \
fullscreennotification.h \
history.h \
modelmenu.h \
- printtopdfdialog.h \
- savepagedialog.h \
searchlineedit.h \
settings.h \
squeezelabel.h \
@@ -57,8 +53,6 @@ SOURCES += \
fullscreennotification.cpp \
history.cpp \
modelmenu.cpp \
- printtopdfdialog.cpp \
- savepagedialog.cpp \
searchlineedit.cpp \
settings.cpp \
squeezelabel.cpp \
diff --git a/examples/webenginewidgets/demobrowser/printtopdfdialog.cpp b/examples/webenginewidgets/demobrowser/printtopdfdialog.cpp
deleted file mode 100644
index 0f3b1765e..000000000
--- a/examples/webenginewidgets/demobrowser/printtopdfdialog.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "printtopdfdialog.h"
-#include "ui_printtopdfdialog.h"
-
-#include <QtCore/QDir>
-#ifndef QT_NO_PRINTER
-#include <QtPrintSupport/QPageSetupDialog>
-#include <QtPrintSupport/QPrinter>
-#endif // QT_NO_PRINTER
-#include <QtWidgets/QFileDialog>
-
-PrintToPdfDialog::PrintToPdfDialog(const QString &filePath, QWidget *parent) :
- QDialog(parent),
- currentPageLayout(QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0.0, 0.0, 0.0, 0.0))),
- ui(new Ui::PrintToPdfDialog)
-{
- ui->setupUi(this);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
- connect(ui->chooseFilePathButton, &QToolButton::clicked, this, &PrintToPdfDialog::onChooseFilePathButtonClicked);
-#ifndef QT_NO_PRINTER
- connect(ui->choosePageLayoutButton, &QToolButton::clicked, this, &PrintToPdfDialog::onChoosePageLayoutButtonClicked);
-#else
- ui->choosePageLayoutButton->hide();
-#endif // QT_NO_PRINTER
- updatePageLayoutLabel();
- setFilePath(filePath);
-}
-
-PrintToPdfDialog::~PrintToPdfDialog()
-{
- delete ui;
-}
-
-void PrintToPdfDialog::onChoosePageLayoutButtonClicked()
-{
-#ifndef QT_NO_PRINTER
- QPrinter printer;
- printer.setPageLayout(currentPageLayout);
-
- QPageSetupDialog dlg(&printer, this);
- if (dlg.exec() != QDialog::Accepted)
- return;
- currentPageLayout.setPageSize(printer.pageLayout().pageSize());
- currentPageLayout.setOrientation(printer.pageLayout().orientation());
- updatePageLayoutLabel();
-#endif // QT_NO_PRINTER
-}
-
-void PrintToPdfDialog::onChooseFilePathButtonClicked()
-{
- QFileInfo fi(filePath());
- QFileDialog dlg(this, tr("Save PDF as"), fi.absolutePath());
- dlg.setAcceptMode(QFileDialog::AcceptSave);
- dlg.setDefaultSuffix(QStringLiteral(".pdf"));
- dlg.selectFile(fi.absoluteFilePath());
- if (dlg.exec() != QDialog::Accepted)
- return;
- setFilePath(dlg.selectedFiles().first());
-}
-
-QString PrintToPdfDialog::filePath() const
-{
- return QDir::fromNativeSeparators(ui->filePathLineEdit->text());
-}
-
-void PrintToPdfDialog::setFilePath(const QString &filePath)
-{
- ui->filePathLineEdit->setText(QDir::toNativeSeparators(filePath));
-}
-
-QPageLayout PrintToPdfDialog::pageLayout() const
-{
- return currentPageLayout;
-}
-
-void PrintToPdfDialog::updatePageLayoutLabel()
-{
- ui->pageLayoutLabel->setText(QString("%1, %2").arg(
- currentPageLayout.pageSize().name()).arg(
- currentPageLayout.orientation() == QPageLayout::Portrait
- ? tr("Portrait") : tr("Landscape")
- ));
-}
diff --git a/examples/webenginewidgets/demobrowser/printtopdfdialog.h b/examples/webenginewidgets/demobrowser/printtopdfdialog.h
deleted file mode 100644
index 87fca72c3..000000000
--- a/examples/webenginewidgets/demobrowser/printtopdfdialog.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PRINTTOPDFDIALOG_H
-#define PRINTTOPDFDIALOG_H
-
-#include <QDialog>
-#include <QPageLayout>
-
-QT_BEGIN_NAMESPACE
-namespace Ui {
-class PrintToPdfDialog;
-}
-QT_END_NAMESPACE
-
-class PrintToPdfDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- explicit PrintToPdfDialog(const QString &filePath, QWidget *parent = 0);
- ~PrintToPdfDialog();
-
- QString filePath() const;
- QPageLayout pageLayout() const;
-
-private slots:
- void onChoosePageLayoutButtonClicked();
- void onChooseFilePathButtonClicked();
-
-private:
- void setFilePath(const QString &);
- void updatePageLayoutLabel();
-
- QPageLayout currentPageLayout;
- Ui::PrintToPdfDialog *ui;
-};
-
-#endif // PRINTTOPDFDIALOG_H
diff --git a/examples/webenginewidgets/demobrowser/printtopdfdialog.ui b/examples/webenginewidgets/demobrowser/printtopdfdialog.ui
deleted file mode 100644
index dcfd5a3aa..000000000
--- a/examples/webenginewidgets/demobrowser/printtopdfdialog.ui
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PrintToPdfDialog</class>
- <widget class="QDialog" name="PrintToPdfDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>372</width>
- <height>117</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Dialog</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="2" column="0">
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- <item row="0" column="0" colspan="2">
- <layout class="QGridLayout" name="gridLayout">
- <item row="1" column="3">
- <widget class="QToolButton" name="choosePageLayoutButton">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="filePathLabel">
- <property name="text">
- <string>Save as:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLineEdit" name="filePathLineEdit"/>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="layoutLabel">
- <property name="text">
- <string>Page layout:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QToolButton" name="chooseFilePathButton">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLabel" name="pageLayoutLabel">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="1" column="0">
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>PrintToPdfDialog</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>PrintToPdfDialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/examples/webenginewidgets/demobrowser/savepagedialog.cpp b/examples/webenginewidgets/demobrowser/savepagedialog.cpp
deleted file mode 100644
index 8ec21f821..000000000
--- a/examples/webenginewidgets/demobrowser/savepagedialog.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "savepagedialog.h"
-#include "ui_savepagedialog.h"
-
-#include <QtCore/QDir>
-#include <QtWidgets/QFileDialog>
-
-const QWebEngineDownloadItem::SavePageFormat SavePageDialog::m_indexToFormatTable[] = {
- QWebEngineDownloadItem::SingleHtmlSaveFormat,
- QWebEngineDownloadItem::CompleteHtmlSaveFormat,
- QWebEngineDownloadItem::MimeHtmlSaveFormat
-};
-
-SavePageDialog::SavePageDialog(QWidget *parent, QWebEngineDownloadItem::SavePageFormat format,
- const QString &filePath)
- : QDialog(parent)
- , ui(new Ui::SavePageDialog)
-{
- ui->setupUi(this);
- ui->formatComboBox->setCurrentIndex(formatToIndex(format));
- setFilePath(filePath);
-}
-
-SavePageDialog::~SavePageDialog()
-{
- delete ui;
-}
-
-QWebEngineDownloadItem::SavePageFormat SavePageDialog::pageFormat() const
-{
- return indexToFormat(ui->formatComboBox->currentIndex());
-}
-
-QString SavePageDialog::filePath() const
-{
- return QDir::fromNativeSeparators(ui->filePathLineEdit->text());
-}
-
-void SavePageDialog::on_chooseFilePathButton_clicked()
-{
- QFileInfo fi(filePath());
- QFileDialog dlg(this, tr("Save Page As"), fi.absolutePath());
- dlg.setAcceptMode(QFileDialog::AcceptSave);
- dlg.setDefaultSuffix(suffixOfFormat(pageFormat()));
- dlg.selectFile(fi.absoluteFilePath());
- if (dlg.exec() != QDialog::Accepted)
- return;
- setFilePath(dlg.selectedFiles().first());
- ensureFileSuffix(pageFormat());
-}
-
-void SavePageDialog::on_formatComboBox_currentIndexChanged(int idx)
-{
- ensureFileSuffix(indexToFormat(idx));
-}
-
-int SavePageDialog::formatToIndex(QWebEngineDownloadItem::SavePageFormat format)
-{
- for (auto i : m_indexToFormatTable) {
- if (m_indexToFormatTable[i] == format)
- return i;
- }
- Q_UNREACHABLE();
-}
-
-QWebEngineDownloadItem::SavePageFormat SavePageDialog::indexToFormat(int idx)
-{
- Q_ASSERT(idx >= 0 && size_t(idx) < (sizeof(m_indexToFormatTable)
- / sizeof(QWebEngineDownloadItem::SavePageFormat)));
- return m_indexToFormatTable[idx];
-}
-
-QString SavePageDialog::suffixOfFormat(QWebEngineDownloadItem::SavePageFormat format)
-{
- if (format == QWebEngineDownloadItem::MimeHtmlSaveFormat)
- return QStringLiteral(".mhtml");
- return QStringLiteral(".html");
-}
-
-void SavePageDialog::setFilePath(const QString &filePath)
-{
- ui->filePathLineEdit->setText(QDir::toNativeSeparators(filePath));
-}
-
-void SavePageDialog::ensureFileSuffix(QWebEngineDownloadItem::SavePageFormat format)
-{
- QFileInfo fi(filePath());
- setFilePath(fi.absolutePath() + QLatin1Char('/') + fi.completeBaseName()
- + suffixOfFormat(format));
-}
diff --git a/examples/webenginewidgets/demobrowser/savepagedialog.h b/examples/webenginewidgets/demobrowser/savepagedialog.h
deleted file mode 100644
index 77095543c..000000000
--- a/examples/webenginewidgets/demobrowser/savepagedialog.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the demonstration applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** BSD License Usage
-** Alternatively, you may use this file under the terms of the BSD license
-** as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of The Qt Company Ltd nor the names of its
-** contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SAVEPAGEDIALOG_H
-#define SAVEPAGEDIALOG_H
-
-#include <QtWidgets/QDialog>
-#include <QtWebEngineWidgets/QWebEngineDownloadItem>
-
-QT_BEGIN_NAMESPACE
-namespace Ui {
-class SavePageDialog;
-}
-QT_END_NAMESPACE
-
-class SavePageDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- explicit SavePageDialog(QWidget *parent, QWebEngineDownloadItem::SavePageFormat format,
- const QString &filePath);
- ~SavePageDialog();
-
- QWebEngineDownloadItem::SavePageFormat pageFormat() const;
- QString filePath() const;
-
-private slots:
- void on_chooseFilePathButton_clicked();
- void on_formatComboBox_currentIndexChanged(int idx);
-
-private:
- static int formatToIndex(QWebEngineDownloadItem::SavePageFormat format);
- static QWebEngineDownloadItem::SavePageFormat indexToFormat(int idx);
- static QString suffixOfFormat(QWebEngineDownloadItem::SavePageFormat format);
- void setFilePath(const QString &filePath);
- void ensureFileSuffix(QWebEngineDownloadItem::SavePageFormat format);
-
- static const QWebEngineDownloadItem::SavePageFormat m_indexToFormatTable[];
- Ui::SavePageDialog *ui;
-};
-
-#endif // SAVEPAGEDIALOG_H
diff --git a/examples/webenginewidgets/demobrowser/savepagedialog.ui b/examples/webenginewidgets/demobrowser/savepagedialog.ui
deleted file mode 100644
index 9aa7cbe55..000000000
--- a/examples/webenginewidgets/demobrowser/savepagedialog.ui
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>SavePageDialog</class>
- <widget class="QDialog" name="SavePageDialog">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>400</width>
- <height>121</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>Dialog</string>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>&amp;Format:</string>
- </property>
- <property name="buddy">
- <cstring>formatComboBox</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="formatComboBox">
- <item>
- <property name="text">
- <string>Single HTML</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Complete HTML</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>MIME HTML</string>
- </property>
- </item>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>&amp;Save to:</string>
- </property>
- <property name="buddy">
- <cstring>filePathLineEdit</cstring>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <layout class="QHBoxLayout" name="horizontalLayout">
- <item>
- <widget class="QLineEdit" name="filePathLineEdit"/>
- </item>
- <item>
- <widget class="QToolButton" name="chooseFilePathButton">
- <property name="text">
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>12</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <tabstops>
- <tabstop>formatComboBox</tabstop>
- <tabstop>filePathLineEdit</tabstop>
- <tabstop>chooseFilePathButton</tabstop>
- </tabstops>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>SavePageDialog</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>227</x>
- <y>104</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>120</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>SavePageDialog</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>295</x>
- <y>110</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>120</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
diff --git a/examples/webenginewidgets/demobrowser/settings.cpp b/examples/webenginewidgets/demobrowser/settings.cpp
index aa3110ae7..220fafdec 100644
--- a/examples/webenginewidgets/demobrowser/settings.cpp
+++ b/examples/webenginewidgets/demobrowser/settings.cpp
@@ -114,13 +114,6 @@ void SettingsDialog::loadDefaults()
sessionCookiesCombo->setCurrentIndex(QWebEngineProfile::defaultProfile()->persistentCookiesPolicy());
httpUserAgent->setText(QWebEngineProfile::defaultProfile()->httpUserAgent());
httpAcceptLanguage->setText(defaultAcceptLanguage());
-
- if (!defaultSettings->testAttribute(QWebEngineSettings::AutoLoadIconsForPage))
- faviconDownloadMode->setCurrentIndex(0);
- else if (!defaultSettings->testAttribute(QWebEngineSettings::TouchIconsEnabled))
- faviconDownloadMode->setCurrentIndex(1);
- else
- faviconDownloadMode->setCurrentIndex(2);
}
void SettingsDialog::loadFromSettings()
@@ -171,7 +164,6 @@ void SettingsDialog::loadFromSettings()
enableScrollAnimator->setChecked(settings.value(QLatin1String("enableScrollAnimator"), enableScrollAnimator->isChecked()).toBool());
httpUserAgent->setText(settings.value(QLatin1String("httpUserAgent"), httpUserAgent->text()).toString());
httpAcceptLanguage->setText(settings.value(QLatin1String("httpAcceptLanguage"), httpAcceptLanguage->text()).toString());
- faviconDownloadMode->setCurrentIndex(settings.value(QLatin1String("faviconDownloadMode"), faviconDownloadMode->currentIndex()).toInt());
settings.endGroup();
// Privacy
@@ -231,7 +223,6 @@ void SettingsDialog::saveToSettings()
settings.setValue(QLatin1String("userStyleSheet"), userStyleSheet->toPlainText());
settings.setValue(QLatin1String("httpUserAgent"), httpUserAgent->text());
settings.setValue(QLatin1String("httpAcceptLanguage"), httpAcceptLanguage->text());
- settings.setValue(QLatin1String("faviconDownloadMode"), faviconDownloadMode->currentIndex());
settings.endGroup();
//Privacy
diff --git a/examples/webenginewidgets/demobrowser/settings.ui b/examples/webenginewidgets/demobrowser/settings.ui
index c78a52dfe..38a7af344 100644
--- a/examples/webenginewidgets/demobrowser/settings.ui
+++ b/examples/webenginewidgets/demobrowser/settings.ui
@@ -27,26 +27,13 @@
<item row="1" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
- <number>0</number>
+ <number>4</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>General</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
- <item row="1" column="2">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>280</width>
- <height>18</height>
- </size>
- </property>
- </spacer>
- </item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
@@ -60,63 +47,36 @@
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="homeLineEdit"/>
</item>
- <item row="7" column="1" colspan="2">
- <spacer>
+ <item row="1" column="1">
+ <widget class="QPushButton" name="setHomeToCurrentPageButton">
+ <property name="text">
+ <string>Set to current page</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <spacer name="horizontalSpacer">
<property name="orientation">
- <enum>Qt::Vertical</enum>
+ <enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>391</width>
- <height>262</height>
+ <width>280</width>
+ <height>18</height>
</size>
</property>
</spacer>
</item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_7">
- <property name="text">
- <string>Save downloads to:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_8">
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_4">
<property name="text">
- <string>Open links from applications:</string>
+ <string>Remove history items:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="6" column="1" colspan="2">
- <widget class="QCheckBox" name="enableScrollAnimator">
- <property name="text">
- <string>Enable Scroll Animator</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="4" column="1" colspan="2">
- <widget class="QComboBox" name="openLinksIn">
- <item>
- <property name="text">
- <string>In a tab in the current window</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>In a new window</string>
- </property>
- </item>
- </widget>
- </item>
<item row="2" column="1" colspan="2">
<widget class="QComboBox" name="expireHistory">
<item>
@@ -151,10 +111,10 @@
</item>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_4">
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_7">
<property name="text">
- <string>Remove history items:</string>
+ <string>Save downloads to:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -164,45 +124,53 @@
<item row="3" column="1" colspan="2">
<widget class="QLineEdit" name="downloadsLocation"/>
</item>
- <item row="1" column="1">
- <widget class="QPushButton" name="setHomeToCurrentPageButton">
- <property name="text">
- <string>Set to current page</string>
- </property>
- </widget>
- </item>
- <item row="5" column="0">
- <widget class="QLabel" name="label_17">
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_8">
<property name="text">
- <string>Favicon download mode:</string>
+ <string>Open links from applications:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="5" column="1" colspan="2">
- <widget class="QComboBox" name="faviconDownloadMode">
- <property name="currentIndex">
- <number>1</number>
- </property>
- <item>
- <property name="text">
- <string>Disable icons</string>
- </property>
- </item>
+ <item row="4" column="1" colspan="2">
+ <widget class="QComboBox" name="openLinksIn">
<item>
<property name="text">
- <string>Enable favicons</string>
+ <string>In a tab in the current window</string>
</property>
</item>
<item>
<property name="text">
- <string>Enable favicons and touch icons</string>
+ <string>In a new window</string>
</property>
</item>
</widget>
</item>
+ <item row="5" column="1" colspan="2">
+ <widget class="QCheckBox" name="enableScrollAnimator">
+ <property name="text">
+ <string>Enable Scroll Animator</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1" colspan="2">
+ <spacer>
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>391</width>
+ <height>262</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
diff --git a/examples/webenginewidgets/demobrowser/tabwidget.cpp b/examples/webenginewidgets/demobrowser/tabwidget.cpp
index e684d3757..691206883 100644
--- a/examples/webenginewidgets/demobrowser/tabwidget.cpp
+++ b/examples/webenginewidgets/demobrowser/tabwidget.cpp
@@ -55,7 +55,6 @@
#include "downloadmanager.h"
#include "fullscreennotification.h"
#include "history.h"
-#include "savepagedialog.h"
#include "urllineedit.h"
#include "webview.h"
@@ -136,15 +135,6 @@ void TabBar::contextMenuRequested(const QPoint &position)
action = menu.addAction(tr("Reload Tab"),
this, SLOT(reloadTab()), QKeySequence::Refresh);
action->setData(index);
-
- // Audio mute / unmute.
- action = menu.addAction(tr("Mute tab"),
- this, SLOT(muteTab()));
- action->setData(index);
-
- action = menu.addAction(tr("Unmute tab"),
- this, SLOT(unmuteTab()));
- action->setData(index);
} else {
menu.addSeparator();
}
@@ -238,22 +228,6 @@ void TabBar::reloadTab()
}
}
-void TabBar::muteTab()
-{
- if (QAction *action = qobject_cast<QAction*>(sender())) {
- int index = action->data().toInt();
- emit muteTab(index, true);
- }
-}
-
-void TabBar::unmuteTab()
-{
- if (QAction *action = qobject_cast<QAction*>(sender())) {
- int index = action->data().toInt();
- emit muteTab(index, false);
- }
-}
-
TabWidget::TabWidget(QWidget *parent)
: QTabWidget(parent)
, m_recentlyClosedTabsAction(0)
@@ -279,7 +253,6 @@ TabWidget::TabWidget(QWidget *parent)
connect(m_tabBar, SIGNAL(reloadAllTabs()), this, SLOT(reloadAllTabs()));
connect(m_tabBar, SIGNAL(tabMoved(int,int)), this, SLOT(moveTab(int,int)));
connect(m_tabBar, SIGNAL(tabBarDoubleClicked(int)), this, SLOT(handleTabBarDoubleClicked(int)));
- connect(m_tabBar, SIGNAL(muteTab(int,bool)), this, SLOT(setAudioMutedForTab(int,bool)));
setTabBar(m_tabBar);
setDocumentMode(true);
@@ -345,18 +318,6 @@ void TabWidget::moveTab(int fromIndex, int toIndex)
m_lineEdits->insertWidget(toIndex, lineEdit);
}
-void TabWidget::setAudioMutedForTab(int index, bool mute)
-{
- if (index < 0)
- index = currentIndex();
- if (index < 0 || index >= count())
- return;
-
- QWidget *widget = this->widget(index);
- if (WebView *tab = qobject_cast<WebView*>(widget))
- tab->page()->setAudioMuted(mute);
-}
-
void TabWidget::addWebAction(QAction *action, QWebEnginePage::WebAction webAction)
{
if (!action)
@@ -600,14 +561,10 @@ WebView *TabWidget::newTab(bool makeCurrent)
urlLineEdit->setWebView(webView);
connect(webView, SIGNAL(loadStarted()),
this, SLOT(webViewLoadStarted()));
- connect(webView, SIGNAL(iconChanged(QIcon)),
- this, SLOT(webViewIconChanged(QIcon)));
+ connect(webView, SIGNAL(iconChanged()),
+ this, SLOT(webViewIconChanged()));
connect(webView, SIGNAL(titleChanged(QString)),
this, SLOT(webViewTitleChanged(QString)));
- connect(webView->page(), SIGNAL(audioMutedChanged(bool)),
- this, SLOT(webPageMutedOrAudibleChanged()));
- connect(webView->page(), SIGNAL(recentlyAudibleChanged(bool)),
- this, SLOT(webPageMutedOrAudibleChanged()));
connect(webView, SIGNAL(urlChanged(QUrl)),
this, SLOT(webViewUrlChanged(QUrl)));
@@ -739,12 +696,14 @@ void TabWidget::webViewLoadStarted()
}
}
-void TabWidget::webViewIconChanged(const QIcon &icon)
+void TabWidget::webViewIconChanged()
{
WebView *webView = qobject_cast<WebView*>(sender());
int index = webViewIndex(webView);
- if (-1 != index)
+ if (-1 != index) {
+ QIcon icon = webView->icon();
setTabIcon(index, icon);
+ }
}
void TabWidget::webViewTitleChanged(const QString &title)
@@ -759,23 +718,6 @@ void TabWidget::webViewTitleChanged(const QString &title)
BrowserApplication::historyManager()->updateHistoryItem(webView->url(), title);
}
-void TabWidget::webPageMutedOrAudibleChanged() {
- QWebEnginePage* webPage = qobject_cast<QWebEnginePage*>(sender());
- WebView *webView = qobject_cast<WebView*>(webPage->view());
-
- int index = webViewIndex(webView);
- if (-1 != index) {
- QString title = webView->title();
-
- bool muted = webPage->isAudioMuted();
- bool audible = webPage->recentlyAudible();
- if (muted) title += tr(" (muted)");
- else if (audible) title += tr(" (audible)");
-
- setTabText(index, title);
- }
-}
-
void TabWidget::webViewUrlChanged(const QUrl &url)
{
WebView *webView = qobject_cast<WebView*>(sender());
@@ -923,14 +865,6 @@ bool TabWidget::restoreState(const QByteArray &state)
void TabWidget::downloadRequested(QWebEngineDownloadItem *download)
{
- if (download->savePageFormat() != QWebEngineDownloadItem::UnknownSaveFormat) {
- SavePageDialog dlg(this, download->savePageFormat(), download->path());
- if (dlg.exec() != SavePageDialog::Accepted)
- return;
- download->setSavePageFormat(dlg.pageFormat());
- download->setPath(dlg.filePath());
- }
-
BrowserApplication::downloadManager()->download(download);
download->accept();
}
diff --git a/examples/webenginewidgets/demobrowser/tabwidget.h b/examples/webenginewidgets/demobrowser/tabwidget.h
index 77e7dde42..3b6ff4d52 100644
--- a/examples/webenginewidgets/demobrowser/tabwidget.h
+++ b/examples/webenginewidgets/demobrowser/tabwidget.h
@@ -74,7 +74,6 @@ signals:
void closeTab(int index);
void closeOtherTabs(int index);
void reloadTab(int index);
- void muteTab(int index, bool mute);
void reloadAllTabs();
void tabMoveRequested(int fromIndex, int toIndex);
@@ -91,8 +90,6 @@ private slots:
void closeTab();
void closeOtherTabs();
void reloadTab();
- void muteTab();
- void unmuteTab();
void contextMenuRequested(const QPoint &position);
private:
@@ -219,7 +216,6 @@ public slots:
void reloadAllTabs();
void nextTab();
void previousTab();
- void setAudioMutedForTab(int index, bool mute);
private slots:
void currentChanged(int index);
@@ -227,7 +223,7 @@ private slots:
void aboutToShowRecentTriggeredAction(QAction *action);
void downloadRequested(QWebEngineDownloadItem *download);
void webViewLoadStarted();
- void webViewIconChanged(const QIcon &icon);
+ void webViewIconChanged();
void webViewTitleChanged(const QString &title);
void webViewUrlChanged(const QUrl &url);
void lineEditReturnPressed();
@@ -235,7 +231,6 @@ private slots:
void moveTab(int fromIndex, int toIndex);
void fullScreenRequested(QWebEngineFullScreenRequest request);
void handleTabBarDoubleClicked(int index);
- void webPageMutedOrAudibleChanged();
private:
void setupPage(QWebEnginePage* page);
diff --git a/examples/webenginewidgets/demobrowser/urllineedit.cpp b/examples/webenginewidgets/demobrowser/urllineedit.cpp
index 8203e4f0f..e704489dc 100644
--- a/examples/webenginewidgets/demobrowser/urllineedit.cpp
+++ b/examples/webenginewidgets/demobrowser/urllineedit.cpp
@@ -281,8 +281,8 @@ void UrlLineEdit::setWebView(WebView *webView)
m_iconLabel->m_webView = webView;
connect(webView, SIGNAL(urlChanged(QUrl)),
this, SLOT(webViewUrlChanged(QUrl)));
- connect(webView, SIGNAL(iconChanged(QIcon)),
- this, SLOT(webViewIconChanged(QIcon)));
+ connect(webView, SIGNAL(iconChanged()),
+ this, SLOT(webViewIconChanged()));
connect(webView, SIGNAL(loadProgress(int)),
this, SLOT(update()));
}
@@ -293,10 +293,11 @@ void UrlLineEdit::webViewUrlChanged(const QUrl &url)
m_lineEdit->setCursorPosition(0);
}
-void UrlLineEdit::webViewIconChanged(const QIcon &icon)
+void UrlLineEdit::webViewIconChanged()
{
Q_ASSERT(m_webView);
- m_iconLabel->setPixmap(icon.pixmap(16, 16));
+ QPixmap pixmap = m_webView->icon().pixmap(16, 16);
+ m_iconLabel->setPixmap(pixmap);
}
QLinearGradient UrlLineEdit::generateGradient(const QColor &color) const
diff --git a/examples/webenginewidgets/demobrowser/urllineedit.h b/examples/webenginewidgets/demobrowser/urllineedit.h
index 51c5c0836..672498432 100644
--- a/examples/webenginewidgets/demobrowser/urllineedit.h
+++ b/examples/webenginewidgets/demobrowser/urllineedit.h
@@ -109,7 +109,7 @@ protected:
private slots:
void webViewUrlChanged(const QUrl &url);
- void webViewIconChanged(const QIcon &icon);
+ void webViewIconChanged();
private:
QLinearGradient generateGradient(const QColor &color) const;
diff --git a/examples/webenginewidgets/demobrowser/webview.cpp b/examples/webenginewidgets/demobrowser/webview.cpp
index a785ae48b..bdf3026b9 100644
--- a/examples/webenginewidgets/demobrowser/webview.cpp
+++ b/examples/webenginewidgets/demobrowser/webview.cpp
@@ -65,7 +65,9 @@
#include <QtWidgets/QMessageBox>
#include <QtGui/QMouseEvent>
-#include <QWebEngineContextMenuData>
+#if defined(QWEBENGINEPAGE_HITTESTCONTENT)
+#include <QWebEngineHitTestResult>
+#endif
#ifndef QT_NO_UITOOLS
#include <QtUiTools/QUiLoader>
@@ -173,8 +175,6 @@ QWebEnginePage *WebPage::createWindow(QWebEnginePage::WebWindowType type)
{
if (type == QWebEnginePage::WebBrowserTab) {
return mainWindow()->tabWidget()->newTab()->page();
- } else if (type == QWebEnginePage::WebBrowserBackgroundTab) {
- return mainWindow()->tabWidget()->newTab(false)->page();
} else if (type == QWebEnginePage::WebBrowserWindow) {
BrowserApplication::instance()->newMainWindow();
BrowserMainWindow *mainWindow = BrowserApplication::instance()->mainWindow();
@@ -271,8 +271,11 @@ void WebPage::authenticationRequired(const QUrl &requestUrl, QAuthenticator *aut
passwordDialog.introLabel->setWordWrap(true);
if (dialog.exec() == QDialog::Accepted) {
+ QByteArray key = BrowserApplication::authenticationKey(requestUrl, auth->realm());
auth->setUser(passwordDialog.userNameLineEdit->text());
auth->setPassword(passwordDialog.passwordLineEdit->text());
+ auth->setOption("key", key);
+ BrowserApplication::instance()->setLastAuthenticator(auth);
} else {
// Set authenticator null if dialog is cancelled
*auth = QAuthenticator();
@@ -299,8 +302,12 @@ void WebPage::proxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator
proxyDialog.introLabel->setWordWrap(true);
if (dialog.exec() == QDialog::Accepted) {
- auth->setUser(proxyDialog.userNameLineEdit->text());
+ QString user = proxyDialog.userNameLineEdit->text();
+ QByteArray key = BrowserApplication::proxyAuthenticationKey(user, proxyHost, auth->realm());
+ auth->setUser(user);
auth->setPassword(proxyDialog.passwordLineEdit->text());
+ auth->setOption("key", key);
+ BrowserApplication::instance()->setLastProxyAuthenticator(auth);
} else {
// Set authenticator null if dialog is cancelled
*auth = QAuthenticator();
@@ -311,6 +318,7 @@ WebView::WebView(QWidget* parent)
: QWebEngineView(parent)
, m_progress(0)
, m_page(0)
+ , m_iconReply(0)
{
connect(this, SIGNAL(loadProgress(int)),
this, SLOT(setProgress(int)));
@@ -349,9 +357,8 @@ void WebView::setPage(WebPage *_page)
connect(page(), SIGNAL(statusBarMessage(QString)),
SLOT(setStatusBarText(QString)));
#endif
- disconnect(page(), &QWebEnginePage::iconChanged, this, &WebView::iconChanged);
- connect(page(), SIGNAL(iconChanged(QIcon)),
- this, SLOT(onIconChanged(QIcon)));
+ connect(page(), SIGNAL(iconUrlChanged(QUrl)),
+ this, SLOT(onIconUrlChanged(QUrl)));
connect(page(), &WebPage::featurePermissionRequested, this, &WebView::onFeaturePermissionRequested);
#if defined(QWEBENGINEPAGE_UNSUPPORTEDCONTENT)
page()->setForwardUnsupportedContent(true);
@@ -360,20 +367,16 @@ void WebView::setPage(WebPage *_page)
void WebView::contextMenuEvent(QContextMenuEvent *event)
{
- QMenu *menu;
- if (page()->contextMenuData().linkUrl().isValid()) {
- menu = new QMenu(this);
- menu->addAction(page()->action(QWebEnginePage::OpenLinkInThisWindow));
- menu->addAction(page()->action(QWebEnginePage::OpenLinkInNewWindow));
- menu->addAction(page()->action(QWebEnginePage::OpenLinkInNewBackgroundTab));
- menu->addSeparator();
- menu->addAction(page()->action(QWebEnginePage::DownloadLinkToDisk));
- menu->addAction(page()->action(QWebEnginePage::CopyLinkToClipboard));
- } else {
- menu = page()->createStandardContextMenu();
+ QMenu *menu = page()->createStandardContextMenu();
+ const QList<QAction*> actions = menu->actions();
+ QList<QAction*>::const_iterator it = qFind(actions.cbegin(), actions.cend(), page()->action(QWebEnginePage::OpenLinkInThisWindow));
+ if (it != actions.cend()) {
+ (*it)->setText(tr("Open Link in This Window"));
+ ++it;
+ QAction *before(it == actions.cend() ? nullptr : *it);
+ menu->insertAction(before, page()->action(QWebEnginePage::OpenLinkInNewWindow));
+ menu->insertAction(before, page()->action(QWebEnginePage::OpenLinkInNewTab));
}
- if (page()->contextMenuData().selectedText().isEmpty())
- menu->addAction(page()->action(QWebEnginePage::SavePage));
connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater);
menu->popup(event->globalPos());
}
@@ -442,12 +445,33 @@ QUrl WebView::url() const
return m_initialUrl;
}
-void WebView::onIconChanged(const QIcon &icon)
+QIcon WebView::icon() const
+{
+ if (!m_icon.isNull())
+ return m_icon;
+ return BrowserApplication::instance()->defaultIcon();
+}
+
+void WebView::onIconUrlChanged(const QUrl &url)
{
- if (icon.isNull())
- emit iconChanged(BrowserApplication::instance()->defaultIcon());
- else
- emit iconChanged(icon);
+ QNetworkRequest iconRequest(url);
+ m_iconReply = BrowserApplication::networkAccessManager()->get(iconRequest);
+ m_iconReply->setParent(this);
+ connect(m_iconReply, SIGNAL(finished()), this, SLOT(iconLoaded()));
+}
+
+void WebView::iconLoaded()
+{
+ m_icon = QIcon();
+ if (m_iconReply) {
+ QByteArray data = m_iconReply->readAll();
+ QPixmap pixmap;
+ pixmap.loadFromData(data);
+ m_icon.addPixmap(pixmap);
+ m_iconReply->deleteLater();
+ m_iconReply = 0;
+ }
+ emit iconChanged();
}
void WebView::mousePressEvent(QMouseEvent *event)
diff --git a/examples/webenginewidgets/demobrowser/webview.h b/examples/webenginewidgets/demobrowser/webview.h
index 8cb502fd1..0603ee513 100644
--- a/examples/webenginewidgets/demobrowser/webview.h
+++ b/examples/webenginewidgets/demobrowser/webview.h
@@ -101,6 +101,7 @@ public:
void loadUrl(const QUrl &url);
QUrl url() const;
+ QIcon icon() const;
QString lastStatusBarText() const;
inline int progress() const { return m_progress; }
@@ -111,19 +112,25 @@ protected:
void contextMenuEvent(QContextMenuEvent *event);
void wheelEvent(QWheelEvent *event);
+signals:
+ void iconChanged();
+
private slots:
void setProgress(int progress);
void loadFinished(bool success);
void setStatusBarText(const QString &string);
void openLinkInNewTab();
void onFeaturePermissionRequested(const QUrl &securityOrigin, QWebEnginePage::Feature);
- void onIconChanged(const QIcon &icon);
+ void onIconUrlChanged(const QUrl &url);
+ void iconLoaded();
private:
QString m_statusBarText;
QUrl m_initialUrl;
int m_progress;
WebPage *m_page;
+ QIcon m_icon;
+ QNetworkReply *m_iconReply;
};
#endif
diff --git a/examples/webenginewidgets/simplebrowser/browser.cpp b/examples/webenginewidgets/simplebrowser/browser.cpp
index f1420c2a3..78b60b8f8 100644
--- a/examples/webenginewidgets/simplebrowser/browser.cpp
+++ b/examples/webenginewidgets/simplebrowser/browser.cpp
@@ -42,9 +42,20 @@
#include "browserwindow.h"
#include "webview.h"
#include <QAuthenticator>
+#include <QNetworkProxy>
+#include <QNetworkReply>
Browser::Browser()
{
+ // QTBUG-47967 , downloading favIcon support is coming in 5.7
+ QObject::connect(&WebView::networkAccessManager(), &QNetworkAccessManager::authenticationRequired,
+ [](QNetworkReply *, QAuthenticator *) {
+ qWarning("Authentication required for downloading favicon.");
+ });
+ QObject::connect(&WebView::networkAccessManager(), &QNetworkAccessManager::proxyAuthenticationRequired,
+ [](const QNetworkProxy &, QAuthenticator *) {
+ qWarning("Proxy authentication required for downloading favicon.");
+ });
}
Browser::~Browser()
diff --git a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
index e57ec80ec..b8df9b02a 100644
--- a/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
+++ b/examples/webenginewidgets/simplebrowser/doc/src/simplebrowser.qdoc
@@ -123,6 +123,7 @@
functionality:
\list
+ \li Downloading favicons
\li Displaying error messages in case \c renderProcess dies
\li Handling \c createWindow requests
\li Adding custom menu items to context menus
@@ -135,11 +136,21 @@
\printuntil WebView(
\dots
\skipto protected:
- \printuntil webActionEnabledChanged
+ \printuntil handleIconLoaded
\skipto }
\dots
\printline };
+ \section2 Downloading Favicons
+
+ To download a favicon, we use QNetworkAccessManager and create a
+ QNetworkRequest every time the URL specified by
+ QWebEngineView::iconUrlChanged is emitted:
+
+ \quotefromfile webenginewidgets/simplebrowser/webview.cpp
+ \skipto WebView::handleIconUrlChanged(
+ \printuntil }
+
\section2 Displaying Error Messages
If the render process is terminated, we display a QMessageBox with an error
diff --git a/examples/webenginewidgets/simplebrowser/main.cpp b/examples/webenginewidgets/simplebrowser/main.cpp
index fa9f44c34..be08c1cb0 100644
--- a/examples/webenginewidgets/simplebrowser/main.cpp
+++ b/examples/webenginewidgets/simplebrowser/main.cpp
@@ -41,7 +41,6 @@
#include "browser.h"
#include "browserwindow.h"
#include <QApplication>
-#include <QWebEngineSettings>
QString getCommandLineUrlArgument()
{
@@ -62,8 +61,6 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
app.setWindowIcon(QIcon(QLatin1String(":simplebrowser.svg")));
- QWebEngineSettings::defaultSettings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
-
BrowserWindow *window = new BrowserWindow();
Browser::instance().addWindow(window);
diff --git a/examples/webenginewidgets/simplebrowser/simplebrowser.pro b/examples/webenginewidgets/simplebrowser/simplebrowser.pro
index 197d68091..ad8a9a2bd 100644
--- a/examples/webenginewidgets/simplebrowser/simplebrowser.pro
+++ b/examples/webenginewidgets/simplebrowser/simplebrowser.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = simplebrowser
-QT += webenginewidgets
+QT += webenginewidgets network
CONFIG += c++11
HEADERS += \
diff --git a/examples/webenginewidgets/simplebrowser/tabwidget.cpp b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
index a7f855c2a..3c6269f52 100644
--- a/examples/webenginewidgets/simplebrowser/tabwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
@@ -80,11 +80,7 @@ void TabWidget::handleCurrentChanged(int index)
emit titleChanged(view->title());
emit loadProgress(view->loadProgress());
emit urlChanged(view->url());
- QIcon pageIcon = view->page()->icon();
- if (!pageIcon.isNull())
- emit iconChanged(pageIcon);
- else
- emit iconChanged(QIcon(QStringLiteral(":defaulticon.png")));
+ emit iconChanged(view->icon());
emit webActionEnabledChanged(QWebEnginePage::Back, view->isWebActionEnabled(QWebEnginePage::Back));
emit webActionEnabledChanged(QWebEnginePage::Forward, view->isWebActionEnabled(QWebEnginePage::Forward));
emit webActionEnabledChanged(QWebEnginePage::Stop, view->isWebActionEnabled(QWebEnginePage::Stop));
@@ -93,7 +89,7 @@ void TabWidget::handleCurrentChanged(int index)
emit titleChanged(QString());
emit loadProgress(0);
emit urlChanged(QUrl());
- emit iconChanged(QIcon(QStringLiteral(":defaulticon.png")));
+ emit iconChanged(QIcon());
emit webActionEnabledChanged(QWebEnginePage::Back, false);
emit webActionEnabledChanged(QWebEnginePage::Forward, false);
emit webActionEnabledChanged(QWebEnginePage::Stop, false);
@@ -170,14 +166,12 @@ void TabWidget::setupView(WebView *webView)
if (currentIndex() == indexOf(webView))
emit linkHovered(url);
});
- connect(webPage, &WebPage::iconChanged, [this, webView](const QIcon &icon) {
+ connect(webView, &WebView::iconChanged, [this, webView](const QIcon& icon) {
int index = indexOf(webView);
- QIcon ico = icon.isNull() ? QIcon(QStringLiteral(":defaulticon.png")) : icon;
-
if (index != -1)
- setTabIcon(index, ico);
+ setTabIcon(index, icon);
if (currentIndex() == index)
- emit iconChanged(ico);
+ emit iconChanged(icon);
});
connect(webView, &WebView::webActionEnabledChanged, [this, webView](QWebEnginePage::WebAction action, bool enabled) {
if (currentIndex() == indexOf(webView))
diff --git a/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp b/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp
index 8146dcfb7..a3175e546 100644
--- a/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp
+++ b/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp
@@ -65,7 +65,7 @@ WebPopupWindow::WebPopupWindow(QWebEngineProfile *profile)
connect(m_view, &WebView::titleChanged, this, &QWidget::setWindowTitle);
connect(m_view, &WebView::urlChanged, this, &WebPopupWindow::setUrl);
- connect(m_view->page(), &WebPage::iconChanged, this, &WebPopupWindow::handleIconChanged);
+ connect(m_view, &WebView::iconChanged, this, &WebPopupWindow::handleIconChanged);
connect(m_view->page(), &WebPage::geometryChangeRequested, this, &WebPopupWindow::handleGeometryChangeRequested);
connect(m_view->page(), &WebPage::windowCloseRequested, this, &QWidget::close);
}
@@ -91,8 +91,5 @@ void WebPopupWindow::handleGeometryChangeRequested(const QRect &newGeometry)
void WebPopupWindow::handleIconChanged(const QIcon &icon)
{
- if (icon.isNull())
- m_addressBar->setFavIcon(QIcon(QStringLiteral(":defaulticon.png")));
- else
- m_addressBar->setFavIcon(icon);
+ m_addressBar->setFavIcon(icon);
}
diff --git a/examples/webenginewidgets/simplebrowser/webview.cpp b/examples/webenginewidgets/simplebrowser/webview.cpp
index 657993fc6..d2a38523f 100644
--- a/examples/webenginewidgets/simplebrowser/webview.cpp
+++ b/examples/webenginewidgets/simplebrowser/webview.cpp
@@ -48,6 +48,7 @@
#include <QDebug>
#include <QMenu>
#include <QMessageBox>
+#include <QNetworkReply>
#include <QTimer>
WebView::WebView(QWidget *parent)
@@ -59,10 +60,11 @@ WebView::WebView(QWidget *parent)
});
connect(this, &QWebEngineView::loadFinished, [this](bool success) {
if (!success) {
+ qWarning() << "Could not load page: " << url();
m_loadProgress = 0;
}
});
-
+ connect(this, &QWebEngineView::iconUrlChanged, this, &WebView::handleIconUrlChanged);
connect(this, &QWebEngineView::renderProcessTerminated,
[this](QWebEnginePage::RenderProcessTerminationStatus termStatus, int statusCode) {
QString status;
@@ -80,11 +82,8 @@ WebView::WebView(QWidget *parent)
status = tr("Render process killed");
break;
}
- QMessageBox::StandardButton btn = QMessageBox::question(window(), status,
- tr("Render process exited with code: %1\n"
- "Do you want to reload the page ?").arg(statusCode));
- if (btn == QMessageBox::Yes)
- QTimer::singleShot(0, [this] { reload(); });
+ QMessageBox::critical(window(), status, tr("Render process exited with code: %1").arg(statusCode));
+ QTimer::singleShot(0, [this] { reload(); });
});
}
@@ -97,6 +96,13 @@ void WebView::setPage(WebPage *page)
QWebEngineView::setPage(page);
}
+QIcon WebView::icon() const
+{
+ if (!m_icon.isNull())
+ return m_icon;
+ return QIcon(QLatin1String(":defaulticon.png"));
+}
+
int WebView::loadProgress() const
{
return m_loadProgress;
@@ -115,6 +121,12 @@ bool WebView::isWebActionEnabled(QWebEnginePage::WebAction webAction) const
return page()->action(webAction)->isEnabled();
}
+QNetworkAccessManager &WebView::networkAccessManager()
+{
+ static QNetworkAccessManager networkAccessManager;
+ return networkAccessManager;
+}
+
QWebEngineView *WebView::createWindow(QWebEnginePage::WebWindowType type)
{
switch (type) {
@@ -122,10 +134,6 @@ QWebEngineView *WebView::createWindow(QWebEnginePage::WebWindowType type)
BrowserWindow *mainWindow = qobject_cast<BrowserWindow*>(window());
return mainWindow->tabWidget()->createTab();
}
- case QWebEnginePage::WebBrowserBackgroundTab: {
- BrowserWindow *mainWindow = qobject_cast<BrowserWindow*>(window());
- return mainWindow->tabWidget()->createTab(false);
- }
case QWebEnginePage::WebBrowserWindow: {
BrowserWindow *mainWindow = new BrowserWindow();
Browser::instance().addWindow(mainWindow);
@@ -155,3 +163,30 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
menu->popup(event->globalPos());
}
+void WebView::handleIconUrlChanged(const QUrl &url)
+{
+ QNetworkRequest iconRequest(url);
+#ifndef QT_NO_OPENSSL
+ QSslConfiguration conf = iconRequest.sslConfiguration();
+ conf.setPeerVerifyMode(QSslSocket::VerifyNone);
+ iconRequest.setSslConfiguration(conf);
+#endif
+ QNetworkReply *iconReply = networkAccessManager().get(iconRequest);
+ iconReply->setParent(this);
+ connect(iconReply, &QNetworkReply::finished, this, &WebView::handleIconLoaded);
+}
+
+void WebView::handleIconLoaded()
+{
+ QNetworkReply *iconReply = qobject_cast<QNetworkReply*>(sender());
+ if (iconReply && iconReply->error() == QNetworkReply::NoError) {
+ QByteArray data = iconReply->readAll();
+ QPixmap pixmap;
+ pixmap.loadFromData(data);
+ m_icon.addPixmap(pixmap);
+ iconReply->deleteLater();
+ } else {
+ m_icon = QIcon(QStringLiteral(":defaulticon.png"));
+ }
+ emit iconChanged(m_icon);
+}
diff --git a/examples/webenginewidgets/simplebrowser/webview.h b/examples/webenginewidgets/simplebrowser/webview.h
index f06162ea3..5450ee247 100644
--- a/examples/webenginewidgets/simplebrowser/webview.h
+++ b/examples/webenginewidgets/simplebrowser/webview.h
@@ -54,21 +54,29 @@ public:
WebView(QWidget *parent = nullptr);
void setPage(WebPage *page);
+ QIcon icon() const;
int loadProgress() const;
bool isWebActionEnabled(QWebEnginePage::WebAction webAction) const;
+ static QNetworkAccessManager &networkAccessManager();
protected:
void contextMenuEvent(QContextMenuEvent *event) override;
QWebEngineView *createWindow(QWebEnginePage::WebWindowType type) override;
signals:
+ void iconChanged(const QIcon &icon);
void webActionEnabledChanged(QWebEnginePage::WebAction webAction, bool enabled);
+private slots:
+ void handleIconUrlChanged(const QUrl &url);
+ void handleIconLoaded();
+
private:
void createWebActionTrigger(QWebEnginePage *page, QWebEnginePage::WebAction);
private:
int m_loadProgress;
+ QIcon m_icon;
};
#endif
diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp
index a3806fc63..b056b27fd 100644
--- a/src/core/api/qwebengineurlrequestinfo.cpp
+++ b/src/core/api/qwebengineurlrequestinfo.cpp
@@ -62,9 +62,7 @@ ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeFavicon, content::RESOU
ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeXhr, content::RESOURCE_TYPE_XHR)
ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePing, content::RESOURCE_TYPE_PING)
ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeServiceWorker, content::RESOURCE_TYPE_SERVICE_WORKER)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeCspReport, content::RESOURCE_TYPE_CSP_REPORT)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypePluginResource, content::RESOURCE_TYPE_PLUGIN_RESOURCE)
-ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeLast, content::RESOURCE_TYPE_LAST_TYPE)
+//ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeLast, content::RESOURCE_TYPE_LAST_TYPE)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::LinkNavigation, QWebEngineUrlRequestInfo::NavigationTypeLink)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::TypedNavigation, QWebEngineUrlRequestInfo::NavigationTypeTyped)
@@ -170,10 +168,6 @@ QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfoPriva
\value ResourceTypeXhr An XMLHttpRequest.
\value ResourceTypePing A ping request for <a ping>.
\value ResourceTypeServiceWorker The main resource of a service worker.
- \value ResourceTypeCspReport A report of Content Security Policy (CSP)
- violations. CSP reports are in JSON format and they are delivered by
- HTTP POST requests to specified servers. (Added in Qt 5.7)
- \value ResourceTypePluginResource A resource requested by a plugin. (Added in Qt 5.7)
\value ResourceTypeUnknown Unknown request type.
\note For forward compatibility all values not matched should be treated as unknown,
diff --git a/src/core/api/qwebengineurlrequestinfo.h b/src/core/api/qwebengineurlrequestinfo.h
index 52463a1b3..6d385701d 100644
--- a/src/core/api/qwebengineurlrequestinfo.h
+++ b/src/core/api/qwebengineurlrequestinfo.h
@@ -73,8 +73,6 @@ public:
ResourceTypeXhr, // a XMLHttpRequest
ResourceTypePing, // a ping request for <a ping>
ResourceTypeServiceWorker, // the main resource of a service worker.
- ResourceTypeCspReport, // Content Security Policy (CSP) violation report
- ResourceTypePluginResource, // A resource requested by a plugin
#ifndef Q_QDOC
ResourceTypeLast,
#endif
diff --git a/src/core/config/common.pri b/src/core/config/common.pri
index 5822bc589..c8b61da66 100644
--- a/src/core/config/common.pri
+++ b/src/core/config/common.pri
@@ -5,7 +5,7 @@ GYP_CONFIG += use_qt=1
# We do not want to ship more external binary blobs, so let v8 embed its startup data.
GYP_CONFIG += v8_use_external_startup_data=0
# Disable printing since we don't support it yet
-GYP_CONFIG += enable_basic_printing=1 enable_print_preview=0
+GYP_CONFIG += enable_basic_printing=0 enable_print_preview=0
# WebSpeech requires Google API keys and adds dependencies on speex and flac.
GYP_CONFIG += enable_web_speech=0
# We do not use or even include the extensions
diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro
index 4fab6cb97..81e1c3297 100644
--- a/src/core/gyp_run.pro
+++ b/src/core/gyp_run.pro
@@ -122,13 +122,8 @@ contains(WEBENGINE_CONFIG, use_appstore_compliant_code): GYP_CONFIG += appstore_
# but the latter are necessary for useful debug binaries.
contains(WEBENGINE_CONFIG, reduce_binary_size): GYP_CONFIG += release_optimize=s debug_optimize=s release_unwind_tables=0
-contains(WEBENGINE_CONFIG, no_spellcheck): {
- GYP_CONFIG += enable_spellcheck=0
- osx: GYP_CONFIG += use_browser_spellchecker=0
-} else {
- GYP_CONFIG += enable_spellcheck=1
- osx: GYP_CONFIG += use_browser_spellchecker=1
-}
+GYP_CONFIG += enable_spellcheck=0
+osx: GYP_CONFIG += use_browser_spellchecker=0
!contains(QT_CONFIG, qt_framework): contains(QT_CONFIG, private_tests) {
GYP_CONFIG += qt_install_data=\"$$[QT_INSTALL_DATA/get]\"
diff --git a/src/src.pro b/src/src.pro
index 64c1703fe..d083712e0 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -17,14 +17,6 @@ SUBDIRS += core \
webengine_experimental_plugin \
plugins
-# allow only desktop builds of qwebengine_convert_dict
-# osx does not use hunspell
-!contains(WEBENGINE_CONFIG, no_spellcheck):!osx:!cross_compile {
- SUBDIRS += qwebengine_convert_dict
- qwebengine_convert_dict.subdir = tools/qwebengine_convert_dict
- qwebengine_convert_dict.depends = core
-}
-
isQMLTestSupportApiEnabled() {
webengine_testsupport_plugin.subdir = webengine/plugin/testsupport
webengine_testsupport_plugin.target = sub-webengine-testsupport-plugin
diff --git a/src/tools/qwebengine_convert_dict/main.cpp b/src/tools/qwebengine_convert_dict/main.cpp
deleted file mode 100644
index 2142b5f0d..000000000
--- a/src/tools/qwebengine_convert_dict/main.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-/******************************************************************************
-** This is just slightly modified version of convert_dict.cc
-** chromium/chrome/tools/convert_dict/convert_dict.cc
-**
-** Original work:
-** Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-** Modified work:
-** Copyright (C) 2016 The Qt Company Ltd.
-**
-** Use of this source code is governed by a BSD-style license that can be
-** found in the LICENSE file.
-**
-** This tool converts Hunspell .aff/.dic pairs to a combined binary dictionary
-** format (.bdic). This format is more compact, and can be more efficiently
-** read by the client application.
-**
-******************************************************************************/
-
-#include <base/at_exit.h>
-#include <base/files/file_path.h>
-#include <base/files/file_util.h>
-#include <base/i18n/icu_util.h>
-#include <build/build_config.h>
-#include <chrome/tools/convert_dict/aff_reader.h>
-#include <chrome/tools/convert_dict/dic_reader.h>
-#include <third_party/hunspell/google/bdict_reader.h>
-#include <third_party/hunspell/google/bdict_writer.h>
-#include <base/path_service.h>
-
-#include <QTextStream>
-#include <QLibraryInfo>
-#include <QDir>
-
-// see also src/core/type_conversion.h
-inline base::FilePath::StringType toFilePathString(const QString &str)
-{
-#if defined(Q_OS_WIN)
- return QDir::toNativeSeparators(str).toStdWString();
-#else
- return str.toStdString();
-#endif
-}
-
-inline base::FilePath toFilePath(const QString &str)
-{
- return base::FilePath(toFilePathString(str));
-}
-
-inline QString toQt(const base::string16 &string)
-{
-#if defined(OS_WIN)
- return QString::fromStdWString(string.data());
-#else
- return QString::fromUtf16(string.data());
-#endif
-}
-
-inline QString toQt(const std::string &string)
-{
- return QString::fromStdString(string);
-}
-
-// Compares the given word list with the serialized trie to make sure they
-// are the same.
-inline bool VerifyWords(const convert_dict::DicReader::WordList& org_words,
- const std::string& serialized, QTextStream& out)
-{
- hunspell::BDictReader reader;
- if (!reader.Init(reinterpret_cast<const unsigned char*>(serialized.data()),
- serialized.size())) {
- out << "BDict is invalid" << endl;
- return false;
- }
- hunspell::WordIterator iter = reader.GetAllWordIterator();
-
- int affix_ids[hunspell::BDict::MAX_AFFIXES_PER_WORD];
-
- static const int buf_size = 128;
- char buf[buf_size];
- for (size_t i = 0; i < org_words.size(); i++) {
- int affix_matches = iter.Advance(buf, buf_size, affix_ids);
- if (affix_matches == 0) {
- out << "Found the end before we expected" << endl;
- return false;
- }
-
- if (org_words[i].first != buf) {
- out << "Word doesn't match, word #" << buf << endl;
- return false;
- }
-
- if (affix_matches != static_cast<int>(org_words[i].second.size())) {
- out << "Different number of affix indices, word #" << buf << endl;
- return false;
- }
-
- // Check the individual affix indices.
- for (size_t affix_index = 0; affix_index < org_words[i].second.size();
- affix_index++) {
- if (affix_ids[affix_index] != org_words[i].second[affix_index]) {
- out << "Index doesn't match, word #" << buf << endl;
- return false;
- }
- }
- }
-
- return true;
-}
-
-int main(int argc, char *argv[])
-{
- QTextStream out(stdout);
-
- if (argc != 3) {
- QTextStream out(stdout);
- out << "Usage: qwebengine_convert_dict <dic file> <bdic file>\n\nExample:\n"
- "qwebengine_convert_dict ./en-US.dic ./en-US.bdic\nwill read en-US.dic, "
- "en-US.dic_delta, and en-US.aff from the current directory and generate "
- "en-US.bdic\n" << endl;
- return 1;
- }
-
- PathService::Override(base::DIR_QT_LIBRARY_DATA,
- toFilePath(QLibraryInfo::location(QLibraryInfo::DataPath) %
- QLatin1String("/resources")));
-
- base::AtExitManager exit_manager;
- base::i18n::InitializeICU();
-
- base::FilePath file_in_path = toFilePath(argv[1]);
- base::FilePath file_out_path = toFilePath(argv[2]);
- base::FilePath aff_path = file_in_path.ReplaceExtension(FILE_PATH_LITERAL(".aff"));
-
- out << "Reading " << toQt(aff_path.value()) << endl;
- convert_dict::AffReader aff_reader(aff_path);
-
- if (!aff_reader.Read()) {
- out << "Unable to read the aff file." << endl;
- return 1;
- }
-
- base::FilePath dic_path = file_in_path.ReplaceExtension(FILE_PATH_LITERAL(".dic"));
- out << "Reading " << toQt(dic_path.value()) << endl;
-
- // DicReader will also read the .dic_delta file.
- convert_dict::DicReader dic_reader(dic_path);
- if (!dic_reader.Read(&aff_reader)) {
- out << "Unable to read the dic file." << endl;
- return 1;
- }
-
- hunspell::BDictWriter writer;
- writer.SetComment(aff_reader.comments());
- writer.SetAffixRules(aff_reader.affix_rules());
- writer.SetAffixGroups(aff_reader.GetAffixGroups());
- writer.SetReplacements(aff_reader.replacements());
- writer.SetOtherCommands(aff_reader.other_commands());
- writer.SetWords(dic_reader.words());
-
- out << "Serializing..." << endl;
-
- std::string serialized = writer.GetBDict();
-
- out << "Verifying..." << endl;
-
- if (!VerifyWords(dic_reader.words(), serialized, out)) {
- out << "ERROR converting, the dictionary does not check out OK." << endl;
- return 1;
- }
-
- out << "Writing " << toQt(file_out_path.value()) << endl;
- FILE *out_file = base::OpenFile(file_out_path, "wb");
- if (!out_file) {
- out << "ERROR writing file" << endl;
- return 1;
- }
- size_t written = fwrite(&serialized[0], 1, serialized.size(), out_file);
- Q_ASSERT(written == serialized.size());
- base::CloseFile(out_file);
- out << "Success. Dictionary converted." << endl;
- return 0;
-}
-
diff --git a/src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro b/src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro
deleted file mode 100644
index de125cc76..000000000
--- a/src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-option(host_build)
-
-# Look for linking information produced by gyp for our target according to core_generated.gyp
-!include($$OUT_PWD/../../core/$$getConfigDir()/QtWebEngineCore_linking.pri) {
- error("Could not find the linking information that gyp should have generated.")
-}
-# remove object files from linking information
-OBJECTS =
-
-# Fixme: -Werror=unused-parameter in core
-QMAKE_CXXFLAGS_WARN_ON =
-
-# Issue with some template compliation, smb smart should look at it
-win32: DEFINES += NOMINMAX
-
-CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir()
-INCLUDEPATH += $$CHROMIUM_SRC_DIR
-
-SOURCES += \
- main.cpp
-
-load(qt_tool)
diff --git a/src/webengine/api/qquickwebenginecertificateerror.cpp b/src/webengine/api/qquickwebenginecertificateerror.cpp
index 51a942abe..c07ddd3c7 100644
--- a/src/webengine/api/qquickwebenginecertificateerror.cpp
+++ b/src/webengine/api/qquickwebenginecertificateerror.cpp
@@ -192,9 +192,6 @@ QUrl QQuickWebEngineCertificateError::url() const
\value WebEngineCertificateError.CertificateNameConstraintViolation
The certificate claimed DNS names that are in violation of name
constraints.
- \value WebEngineCertificateError.CertificateValidityTooLong
- The certificate has a validity period that is too long.
- (Added in 5.7)
*/
QQuickWebEngineCertificateError::Error QQuickWebEngineCertificateError::error() const
{
diff --git a/src/webengine/api/qquickwebenginecertificateerror_p.h b/src/webengine/api/qquickwebenginecertificateerror_p.h
index d04dc2c62..0f76b0237 100644
--- a/src/webengine/api/qquickwebenginecertificateerror_p.h
+++ b/src/webengine/api/qquickwebenginecertificateerror_p.h
@@ -83,7 +83,7 @@ public:
CertificateNonUniqueName = -210,
CertificateWeakKey = -211,
CertificateNameConstraintViolation = -212,
- CertificateValidityTooLong = -213,
+// CertificateValidityTooLong = -213,
};
Q_ENUM(Error)
diff --git a/src/webengine/api/qquickwebenginecontextmenudata.cpp b/src/webengine/api/qquickwebenginecontextmenudata.cpp
deleted file mode 100644
index 2cc6eaf4b..000000000
--- a/src/webengine/api/qquickwebenginecontextmenudata.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginecontextmenudata_p.h"
-
-#include "web_contents_adapter_client.h"
-
-QT_BEGIN_NAMESPACE
-
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeNone, QQuickWebEngineContextMenuData::MediaTypeNone)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeImage, QQuickWebEngineContextMenuData::MediaTypeImage)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeAudio, QQuickWebEngineContextMenuData::MediaTypeAudio)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeVideo, QQuickWebEngineContextMenuData::MediaTypeVideo)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeCanvas, QQuickWebEngineContextMenuData::MediaTypeCanvas)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeFile, QQuickWebEngineContextMenuData::MediaTypeFile)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypePlugin, QQuickWebEngineContextMenuData::MediaTypePlugin)
-
-/*!
- \qmltype WebEngineContextMenuData
- \instantiates QQuickWebEngineContextMenuData
- \inqmlmodule QtWebEngine
- \since QtWebEngine 1.3
- \brief Provides context data for populating or extending a context menu with actions.
-
-
- WebEngineContextMenuData is returned by WebEngineView::contextMenuData() after a context menu event,
- and contains information about where the context menu event took place. This is also in the context
- in which any context specific WebEngineView::WebAction will be performed.
-*/
-
-QQuickWebEngineContextMenuData::QQuickWebEngineContextMenuData() : d(nullptr)
-{
-}
-
-QQuickWebEngineContextMenuData::~QQuickWebEngineContextMenuData()
-{
- delete d;
-}
-
-/*!
- \qmlproperty bool WebEngineContextMenuData::isValid
-
- Is \c true if the context data is valid; otherwise \c false.
-*/
-bool QQuickWebEngineContextMenuData::isValid() const
-{
- return d;
-}
-
-/*!
- \qmlproperty point WebEngineContextMenuData::position
-
-
- Returns the position of the context, usually the mouse position where the context menu event was triggered.
-*/
-QPoint QQuickWebEngineContextMenuData::position() const
-{
- return d ? d->pos : QPoint();
-}
-
-/*!
- \qmlproperty string WebEngineContextMenuData::linkText
-
- Returns the text of a link if the context is a link.
-*/
-QString QQuickWebEngineContextMenuData::linkText() const
-{
- return d ? d->linkText : QString();
-}
-
-/*!
- \qmlproperty url WebEngineContextMenuData::linkUrl
-
- Returns the URL of a link if the context is a link.
-*/
-QUrl QQuickWebEngineContextMenuData::linkUrl() const
-{
- return d ? d->linkUrl : QUrl();
-}
-
-/*!
- \qmlproperty string WebEngineContextMenuData::selectedText
-
- Returns the selected text of the context.
-*/
-QString QQuickWebEngineContextMenuData::selectedText() const
-{
- return d ? d->selectedText : QString();
-}
-
-/*!
- \qmlproperty url WebEngineContextMenuData::mediaUrl
-
- If the context is a media element, returns the URL of that media.
-*/
-QUrl QQuickWebEngineContextMenuData::mediaUrl() const
-{
- return d ? d->mediaUrl : QUrl();
-}
-
-/*!
- \qmlproperty enumeration WebEngineContextMenuData::mediaType
-
- Returns the type of the media element or \c MediaTypeNone if the context is not a media element.
-
- \value WebEngineContextMenuData.MediaTypeNone
- The context is not a media element.
- \value WebEngineContextMenuData.MediaTypeImage
- The context is an image element
- \value WebEngineContextMenuData.MediaTypeVideo
- The context is a video element
- \value WebEngineContextMenuData.MediaTypeAudio
- The context is an audio element
- \value WebEngineContextMenuData.MediaTypeCanvas
- The context is a canvas element
- \value WebEngineContextMenuData.MediaTypeFile
- The context is a file
- \value WebEngineContextMenuData.MediaTypePlugin
- The context is a plugin
-*/
-
-QQuickWebEngineContextMenuData::MediaType QQuickWebEngineContextMenuData::mediaType() const
-{
- return d ? static_cast<QQuickWebEngineContextMenuData::MediaType>(d->mediaType) : MediaTypeNone;
-}
-
-/*!
- \qmlproperty bool WebEngineContextMenuData::isContentEditable
-
- Returns \c true if the content is editable by the user; otherwise returns \c false.
-*/
-bool QQuickWebEngineContextMenuData::isContentEditable() const
-{
- return d ? d->isEditable : false;
-}
-
-void QQuickWebEngineContextMenuData::update(const QtWebEngineCore::WebEngineContextMenuData &update)
-{
- const QQuickWebEngineContextMenuData old(d);
- d = new QtWebEngineCore::WebEngineContextMenuData(update);
-
- if (isValid() != old.isValid())
- Q_EMIT isValidChanged();
-
- if (position() != old.position())
- Q_EMIT positionChanged();
-
- if (selectedText() != old.selectedText())
- Q_EMIT selectedTextChanged();
-
- if (linkText() != old.linkText())
- Q_EMIT linkTextChanged();
-
- if (linkUrl() != old.linkUrl())
- Q_EMIT linkUrlChanged();
-
- if (mediaUrl() != old.mediaUrl())
- Q_EMIT mediaUrlChanged();
-
- if (mediaType() != old.mediaType())
- Q_EMIT mediaTypeChanged();
-
- if (isContentEditable() != old.isContentEditable())
- Q_EMIT isContentEditableChanged();
-}
-
-QQuickWebEngineContextMenuData::QQuickWebEngineContextMenuData(const QQuickWebEngineContextMenuDataPrivate *p, QObject *parent)
- : QObject(parent)
- , d(p)
-{
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginecontextmenudata_p.h b/src/webengine/api/qquickwebenginecontextmenudata_p.h
deleted file mode 100644
index aa081cbe6..000000000
--- a/src/webengine/api/qquickwebenginecontextmenudata_p.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINECONTEXTMENUDATA_P_H
-#define QQUICKWEBENGINECONTEXTMENUDATA_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qtwebengineglobal_p.h>
-#include <QtCore/QObject>
-#include <QtCore/QPoint>
-#include <QtCore/QString>
-#include <QtCore/QUrl>
-#include <QtQuick/QQuickItem>
-
-namespace QtWebEngineCore {
-class WebEngineContextMenuData;
-}
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineView;
-class QQuickWebEngineViewPrivate;
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineContextMenuData : public QObject {
- Q_OBJECT
-public:
- QQuickWebEngineContextMenuData();
- ~QQuickWebEngineContextMenuData();
-
- enum MediaType {
- MediaTypeNone,
- MediaTypeImage,
- MediaTypeVideo,
- MediaTypeAudio,
- MediaTypeCanvas,
- MediaTypeFile,
- MediaTypePlugin
- };
- Q_ENUM(MediaType)
-
- Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged)
- Q_PROPERTY(QPoint position READ position NOTIFY positionChanged)
- Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged)
- Q_PROPERTY(QString linkText READ linkText NOTIFY linkTextChanged)
- Q_PROPERTY(QUrl linkUrl READ linkUrl NOTIFY linkUrlChanged)
- Q_PROPERTY(QUrl mediaUrl READ mediaUrl NOTIFY mediaUrlChanged)
- Q_PROPERTY(MediaType mediaType READ mediaType NOTIFY mediaTypeChanged)
- Q_PROPERTY(bool isContentEditable READ isContentEditable NOTIFY isContentEditableChanged)
-
- bool isValid() const;
-
- QPoint position() const;
- QString selectedText() const;
- QString linkText() const;
- QUrl linkUrl() const;
- QUrl mediaUrl() const;
- MediaType mediaType() const;
- bool isContentEditable() const;
-
-Q_SIGNALS:
- void isValidChanged();
- void positionChanged();
- void selectedTextChanged();
- void linkTextChanged();
- void linkUrlChanged();
- void mediaUrlChanged();
- void mediaTypeChanged();
- void isContentEditableChanged();
-
-private:
- void update(const QtWebEngineCore::WebEngineContextMenuData &update);
-
- friend class QQuickWebEngineView;
- friend class QQuickWebEngineViewPrivate;
- Q_DISABLE_COPY(QQuickWebEngineContextMenuData)
- typedef QtWebEngineCore::WebEngineContextMenuData QQuickWebEngineContextMenuDataPrivate;
- QQuickWebEngineContextMenuData(const QQuickWebEngineContextMenuDataPrivate *priv, QObject *parent = 0);
- QQuickWebEngineContextMenuData &operator=(const QQuickWebEngineContextMenuDataPrivate *priv);
- const QQuickWebEngineContextMenuDataPrivate *d;
-};
-
-QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(const QQuickWebEngineContextMenuData);
-
-#endif // QQUICKWEBENGINECONTEXTMENUDATA_P_H
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp
index 9f0c747f9..0c1dcf37f 100644
--- a/src/webengine/api/qquickwebenginedownloaditem.cpp
+++ b/src/webengine/api/qquickwebenginedownloaditem.cpp
@@ -65,7 +65,6 @@ QQuickWebEngineDownloadItemPrivate::QQuickWebEngineDownloadItemPrivate(QQuickWeb
: profile(p)
, downloadId(-1)
, downloadState(QQuickWebEngineDownloadItem::DownloadCancelled)
- , savePageFormat(QQuickWebEngineDownloadItem::UnknownSaveFormat)
, totalBytes(-1)
, receivedBytes(0)
{
@@ -266,39 +265,6 @@ void QQuickWebEngineDownloadItem::setPath(QString path)
}
}
-/*!
- \qmlproperty enumeration WebEngineDownloadItem::savePageFormat
- \since QtWebEngine 1.3
-
- Describes the format that is used to save a web page.
-
- \value WebEngineDownloadItem.UnknownSaveFormat
- This is not a request for downloading a complete web page.
- \value WebEngineDownloadItem.SingleHtmlSaveFormat
- The page is saved as a single HTML page. Resources such as images
- are not saved.
- \value WebEngineDownloadItem.CompleteHtmlSaveFormat
- The page is saved as a complete HTML page, for example a directory
- containing the single HTML page and the resources.
- \value WebEngineDownloadItem.MimeHtmlSaveFormat
- The page is saved as a complete web page in the MIME HTML format.
-*/
-
-QQuickWebEngineDownloadItem::SavePageFormat QQuickWebEngineDownloadItem::savePageFormat() const
-{
- Q_D(const QQuickWebEngineDownloadItem);
- return d->savePageFormat;
-}
-
-void QQuickWebEngineDownloadItem::setSavePageFormat(QQuickWebEngineDownloadItem::SavePageFormat format)
-{
- Q_D(QQuickWebEngineDownloadItem);
- if (d->savePageFormat != format) {
- d->savePageFormat = format;
- Q_EMIT savePageFormatChanged();
- }
-}
-
QQuickWebEngineDownloadItem::QQuickWebEngineDownloadItem(QQuickWebEngineDownloadItemPrivate *p, QObject *parent)
: QObject(parent)
, d_ptr(p)
diff --git a/src/webengine/api/qquickwebenginedownloaditem_p.h b/src/webengine/api/qquickwebenginedownloaditem_p.h
index 0b01fe6fc..ec835eeb6 100644
--- a/src/webengine/api/qquickwebenginedownloaditem_p.h
+++ b/src/webengine/api/qquickwebenginedownloaditem_p.h
@@ -74,17 +74,8 @@ public:
};
Q_ENUM(DownloadState)
- enum SavePageFormat {
- UnknownSaveFormat = -1,
- SingleHtmlSaveFormat,
- CompleteHtmlSaveFormat,
- MimeHtmlSaveFormat
- };
- Q_ENUM(SavePageFormat)
-
Q_PROPERTY(quint32 id READ id CONSTANT FINAL)
Q_PROPERTY(DownloadState state READ state NOTIFY stateChanged)
- Q_PROPERTY(SavePageFormat savePageFormat READ savePageFormat WRITE setSavePageFormat NOTIFY savePageFormatChanged REVISION 2 FINAL)
Q_PROPERTY(qint64 totalBytes READ totalBytes NOTIFY totalBytesChanged)
Q_PROPERTY(qint64 receivedBytes READ receivedBytes NOTIFY receivedBytesChanged)
Q_PROPERTY(QString mimeType READ mimeType NOTIFY mimeTypeChanged REVISION 1)
@@ -100,12 +91,9 @@ public:
QString mimeType() const;
QString path() const;
void setPath(QString path);
- SavePageFormat savePageFormat() const;
- void setSavePageFormat(SavePageFormat format);
Q_SIGNALS:
void stateChanged();
- Q_REVISION(2) void savePageFormatChanged();
void receivedBytesChanged();
void totalBytesChanged();
Q_REVISION(1) void mimeTypeChanged();
diff --git a/src/webengine/api/qquickwebenginedownloaditem_p_p.h b/src/webengine/api/qquickwebenginedownloaditem_p_p.h
index bdae54ca4..2b3703d13 100644
--- a/src/webengine/api/qquickwebenginedownloaditem_p_p.h
+++ b/src/webengine/api/qquickwebenginedownloaditem_p_p.h
@@ -72,7 +72,6 @@ public:
quint32 downloadId;
QQuickWebEngineDownloadItem::DownloadState downloadState;
- QQuickWebEngineDownloadItem::SavePageFormat savePageFormat;
qint64 totalBytes;
qint64 receivedBytes;
QString mimeType;
diff --git a/src/webengine/api/qquickwebenginefaviconprovider.cpp b/src/webengine/api/qquickwebenginefaviconprovider.cpp
deleted file mode 100644
index b5ad6960a..000000000
--- a/src/webengine/api/qquickwebenginefaviconprovider.cpp
+++ /dev/null
@@ -1,187 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qquickwebenginefaviconprovider_p_p.h"
-
-#include "favicon_manager.h"
-#include "qquickwebengineview_p.h"
-#include "qquickwebengineview_p_p.h"
-#include "web_contents_adapter.h"
-
-#include <QtGui/QIcon>
-#include <QtGui/QPixmap>
-
-QT_BEGIN_NAMESPACE
-
-using QtWebEngineCore::FaviconInfo;
-using QtWebEngineCore::FaviconManager;
-
-static inline unsigned area(const QSize &size)
-{
- return size.width() * size.height();
-}
-
-QString QQuickWebEngineFaviconProvider::identifier()
-{
- return QStringLiteral("favicon");
-}
-
-QUrl QQuickWebEngineFaviconProvider::faviconProviderUrl(const QUrl &url)
-{
- if (url.isEmpty())
- return url;
-
- QUrl providerUrl;
- providerUrl.setScheme(QStringLiteral("image"));
- providerUrl.setHost(identifier());
- providerUrl.setPath(QStringLiteral("/%1").arg(url.toString()));
-
- return providerUrl;
-}
-
-QQuickWebEngineFaviconProvider::QQuickWebEngineFaviconProvider()
- : QQuickImageProvider(QQuickImageProvider::Pixmap)
- , m_latestView(0)
-{
-}
-
-QQuickWebEngineFaviconProvider::~QQuickWebEngineFaviconProvider()
-{
- qDeleteAll(m_iconUrlMap);
-}
-
-QUrl QQuickWebEngineFaviconProvider::attach(QQuickWebEngineView *view, const QUrl &iconUrl)
-{
- if (iconUrl.isEmpty())
- return QUrl();
-
- m_latestView = view;
-
- if (!m_iconUrlMap.contains(view))
- m_iconUrlMap.insert(view, new QList<QUrl>());
-
- QList<QUrl> *iconUrls = m_iconUrlMap[view];
- if (!iconUrls->contains(iconUrl))
- iconUrls->append(iconUrl);
-
- return faviconProviderUrl(iconUrl);
-}
-
-void QQuickWebEngineFaviconProvider::detach(QQuickWebEngineView *view)
-{
- QList<QUrl> *iconUrls = m_iconUrlMap.take(view);
- delete iconUrls;
-}
-
-QPixmap QQuickWebEngineFaviconProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
-{
- Q_UNUSED(size);
- Q_UNUSED(requestedSize);
-
- QUrl iconUrl(id);
- QQuickWebEngineView *view = viewForIconUrl(iconUrl);
-
- if (!view || iconUrl.isEmpty())
- return QPixmap();
-
- FaviconManager *faviconManager = view->d_ptr->adapter->faviconManager();
-
- Q_ASSERT(faviconManager);
- const FaviconInfo &faviconInfo = faviconManager->getFaviconInfo(iconUrl);
- const QIcon &icon = faviconManager->getIcon(faviconInfo.candidate ? QUrl() : iconUrl);
-
- Q_ASSERT(!icon.isNull());
- const QSize &bestSize = faviconInfo.size;
-
- // If source size is not specified, use the best quality
- if (!requestedSize.isValid()) {
- if (size)
- *size = bestSize;
-
- return icon.pixmap(bestSize).copy();
- }
-
- const QSize &fitSize = findFitSize(icon.availableSizes(), requestedSize, bestSize);
- const QPixmap &iconPixmap = icon.pixmap(fitSize);
-
- if (size)
- *size = iconPixmap.size();
-
- return iconPixmap.scaled(requestedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation).copy();
-}
-
-QQuickWebEngineView *QQuickWebEngineFaviconProvider::viewForIconUrl(const QUrl &iconUrl) const
-{
- // The most common use case is that the requested iconUrl belongs to the
- // latest WebEngineView which was raised an iconChanged signal.
- if (m_latestView) {
- QList<QUrl> *iconUrls = m_iconUrlMap[m_latestView];
- if (iconUrls && iconUrls->contains(iconUrl))
- return m_latestView;
- }
-
- for (auto it = m_iconUrlMap.cbegin(), end = m_iconUrlMap.cend(); it != end; ++it) {
- if (it.value()->contains(iconUrl))
- return it.key();
- }
-
- return 0;
-}
-
-QSize QQuickWebEngineFaviconProvider::findFitSize(const QList<QSize> &availableSizes,
- const QSize &requestedSize,
- const QSize &bestSize) const
-{
- Q_ASSERT(availableSizes.count());
- if (availableSizes.count() == 1 || area(requestedSize) >= area(bestSize))
- return bestSize;
-
- QSize fitSize = bestSize;
- for (const QSize &size : availableSizes) {
- if (area(size) == area(requestedSize))
- return size;
-
- if (area(requestedSize) < area(size) && area(size) < area(fitSize))
- fitSize = size;
- }
-
- return fitSize;
-}
-
-QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginefaviconprovider_p_p.h b/src/webengine/api/qquickwebenginefaviconprovider_p_p.h
deleted file mode 100644
index 52f3fb7a9..000000000
--- a/src/webengine/api/qquickwebenginefaviconprovider_p_p.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
-#define QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qtwebengineglobal_p.h>
-#include <QtQuick/QQuickImageProvider>
-
-#include <QtCore/QMap>
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineView;
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineFaviconProvider : public QQuickImageProvider {
-public:
- static QString identifier();
- static QUrl faviconProviderUrl(const QUrl &);
-
- QQuickWebEngineFaviconProvider();
- ~QQuickWebEngineFaviconProvider();
-
- QUrl attach(QQuickWebEngineView *, const QUrl &);
- void detach(QQuickWebEngineView *);
-
-
- virtual QPixmap requestPixmap(const QString &, QSize *, const QSize &);
-
-private:
- QQuickWebEngineView *viewForIconUrl(const QUrl &) const;
- QSize findFitSize(const QList<QSize> &, const QSize &, const QSize &) const;
-
- QMap<QQuickWebEngineView *, QList<QUrl> *> m_iconUrlMap;
- QQuickWebEngineView *m_latestView;
-};
-
-QT_END_NAMESPACE
-
-#endif // QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
diff --git a/src/webengine/api/qquickwebenginehistory.cpp b/src/webengine/api/qquickwebenginehistory.cpp
index 970bfb22d..75e969b14 100644
--- a/src/webengine/api/qquickwebenginehistory.cpp
+++ b/src/webengine/api/qquickwebenginehistory.cpp
@@ -40,7 +40,6 @@
#include "qquickwebenginehistory_p.h"
#include "qquickwebenginehistory_p_p.h"
-#include "qquickwebenginefaviconprovider_p_p.h"
#include "qquickwebengineloadrequest_p.h"
#include "qquickwebengineview_p_p.h"
#include "web_contents_adapter.h"
@@ -135,9 +134,8 @@ int QQuickWebEngineForwardHistoryListModelPrivate::offsetForIndex(int index) con
\brief A data model that represents the history of a web engine page.
- The WebEngineHistoryListModel type exposes the \e title, \e url, \e icon, and \e offset roles.
- The \e title, \e url and \e icon specify the title, URL, and favicon of the visited page.
- The \e offset specifies
+ The WebEngineHistoryListModel type exposes the \e title, \e url, and \e offset roles. The
+ \e title and \e url specify the title and URL of the visited page. The \e offset specifies
the position of the page in respect to the current page (0). A positive number indicates that
the page was visited after the current page, whereas a negative number indicates that the page
was visited before the current page.
@@ -169,7 +167,6 @@ QHash<int, QByteArray> QQuickWebEngineHistoryListModel::roleNames() const
roles[QQuickWebEngineHistory::UrlRole] = "url";
roles[QQuickWebEngineHistory::TitleRole] = "title";
roles[QQuickWebEngineHistory::OffsetRole] = "offset";
- roles[QQuickWebEngineHistory::IconUrlRole] = "icon";
return roles;
}
@@ -187,7 +184,7 @@ QVariant QQuickWebEngineHistoryListModel::data(const QModelIndex &index, int rol
if (!index.isValid())
return QVariant();
- if (role < QQuickWebEngineHistory::UrlRole || role > QQuickWebEngineHistory::IconUrlRole)
+ if (role < QQuickWebEngineHistory::UrlRole || role > QQuickWebEngineHistory::OffsetRole)
return QVariant();
if (role == QQuickWebEngineHistory::UrlRole)
@@ -199,11 +196,6 @@ QVariant QQuickWebEngineHistoryListModel::data(const QModelIndex &index, int rol
if (role == QQuickWebEngineHistory::OffsetRole)
return d->offsetForIndex(index.row());
- if (role == QQuickWebEngineHistory::IconUrlRole) {
- QUrl iconUrl = QUrl(d->adapter()->getNavigationEntryIconUrl(d->index(index.row())));
- return QQuickWebEngineFaviconProvider::faviconProviderUrl(iconUrl);
- }
-
return QVariant();
}
@@ -263,8 +255,7 @@ QQuickWebEngineHistoryPrivate::~QQuickWebEngineHistoryPrivate()
format of the list items. The appearance of each item of the list in the delegate can be defined
separately (it is not web engine specific).
- The model roles \e title, \e url, and \e icon specify the title, URL, and favicon of the
- visited page. The \e offset
+ The model roles \e title and \e url specify the title and URL of the visited page. The \e offset
role specifies the position of the page in respect to the current page (0). A positive number
indicates that the page was visited after the current page, whereas a negative number indicates
that the page was visited before the current page.
diff --git a/src/webengine/api/qquickwebenginehistory_p.h b/src/webengine/api/qquickwebenginehistory_p.h
index 22340e483..4dedf17da 100644
--- a/src/webengine/api/qquickwebenginehistory_p.h
+++ b/src/webengine/api/qquickwebenginehistory_p.h
@@ -101,7 +101,6 @@ public:
UrlRole = Qt::UserRole + 1,
TitleRole = Qt::UserRole + 2,
OffsetRole = Qt::UserRole + 3,
- IconUrlRole = Qt::UserRole + 4,
};
QQuickWebEngineHistoryListModel *items() const;
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index d660f639d..417cfb7a5 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -48,18 +48,12 @@
#include <QQmlEngine>
#include "browser_context_adapter.h"
-#include <qtwebenginecoreglobal.h>
#include "web_engine_settings.h"
using QtWebEngineCore::BrowserContextAdapter;
QT_BEGIN_NAMESPACE
-ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::UnknownSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::UnknownSavePageFormat)
-ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::SingleHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::SingleHtmlSaveFormat)
-ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::CompleteHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::CompleteHtmlSaveFormat)
-ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::MimeHtmlSaveFormat)
-
/*!
\class QQuickWebEngineProfile
\brief The QQuickWebEngineProfile class provides a web engine profile shared by multiple pages.
@@ -95,7 +89,6 @@ ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineC
\value MemoryHttpCache Use an in-memory cache. This is the only setting possible if
\c off-the-record is set or no cache path is available.
\value DiskHttpCache Use a disk cache. This is the default.
- \value NoCache Disable both in-memory and disk caching. (Added in Qt 5.7)
*/
/*!
@@ -178,8 +171,6 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
itemPrivate->totalBytes = info.totalBytes;
itemPrivate->mimeType = info.mimeType;
itemPrivate->downloadPath = info.path;
- itemPrivate->savePageFormat = static_cast<QQuickWebEngineDownloadItem::SavePageFormat>(
- info.savePageFormat);
QQuickWebEngineDownloadItem *download = new QQuickWebEngineDownloadItem(itemPrivate, q);
@@ -190,16 +181,8 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
QQuickWebEngineDownloadItem::DownloadState state = download->state();
info.path = download->path();
- info.savePageFormat = itemPrivate->savePageFormat;
info.accepted = state != QQuickWebEngineDownloadItem::DownloadCancelled
&& state != QQuickWebEngineDownloadItem::DownloadRequested;
-
- if (state == QQuickWebEngineDownloadItem::DownloadRequested) {
- // Delete unaccepted downloads.
- info.accepted = false;
- m_ongoingDownloads.remove(info.id);
- delete download;
- }
}
void QQuickWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info)
@@ -471,8 +454,6 @@ void QQuickWebEngineProfile::setHttpUserAgent(const QString &userAgent)
no persistentStoragePath is available.
\value WebEngineProfile.DiskHttpCache
Uses a disk cache. This is the default value.
- \value WebEngineProfile.NoCache
- Disables caching. (Added in 5.7)
*/
/*!
@@ -622,29 +603,6 @@ QWebEngineCookieStore *QQuickWebEngineProfile::cookieStore() const
}
/*!
- \qmlmethod void WebEngineProfile::clearHttpCache()
- \since QtWebEngine 1.3
-
- Removes the profile's cache entries.
-
- \sa WebEngineProfile::cachePath
-*/
-
-/*!
- \since 5.7
-
- Removes the profile's cache entries.
-
- \sa WebEngineProfile::clearHttpCache
-*/
-void QQuickWebEngineProfile::clearHttpCache()
-{
- Q_D(QQuickWebEngineProfile);
- d->browserContext()->clearHttpCache();
-}
-
-
-/*!
Registers a request interceptor singleton \a interceptor to intercept URL requests.
The profile does not take ownership of the pointer.
diff --git a/src/webengine/api/qquickwebengineprofile.h b/src/webengine/api/qquickwebengineprofile.h
index dc5aa7df8..053cb1fb9 100644
--- a/src/webengine/api/qquickwebengineprofile.h
+++ b/src/webengine/api/qquickwebengineprofile.h
@@ -78,8 +78,7 @@ public:
enum HttpCacheType {
MemoryHttpCache,
- DiskHttpCache,
- NoCache
+ DiskHttpCache
};
Q_ENUM(HttpCacheType)
@@ -127,8 +126,6 @@ public:
void removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *);
void removeAllUrlSchemeHandlers();
- Q_REVISION(2) Q_INVOKABLE void clearHttpCache();
-
static QQuickWebEngineProfile *defaultProfile();
Q_SIGNALS:
diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp
index b12e59576..d7b073e90 100644
--- a/src/webengine/api/qquickwebenginesettings.cpp
+++ b/src/webengine/api/qquickwebenginesettings.cpp
@@ -238,72 +238,6 @@ bool QQuickWebEngineSettings::fullScreenSupportEnabled() const
}
/*!
- \qmlproperty bool WebEngineSettings::screenCaptureEnabled
- \since QtWebEngine 1.3
-
- Tells the web engine whether screen capture is supported in this application or not.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::screenCaptureEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::ScreenCaptureEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::webGLEnabled
- \since QtWebEngine 1.3
-
- Enables support for HTML 5 WebGL.
-
- Enabled by default if available.
-*/
-bool QQuickWebEngineSettings::webGLEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::WebGLEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::accelerated2dCanvasEnabled
- \since QtWebEngine 1.3
-
- Specifies whether the HTML 5 2D canvas should be a OpenGL framebuffer.
- This makes many painting operations faster, but slows down pixel access.
-
- Enabled by default if available.
-*/
-bool QQuickWebEngineSettings::accelerated2dCanvasEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::Accelerated2dCanvasEnabled);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::autoLoadIconsForPage
- \since QtWebEngine 1.3
-
- Automatically downloads icons for web pages.
-
- Enabled by default.
-*/
-bool QQuickWebEngineSettings::autoLoadIconsForPage() const
-{
- return d_ptr->testAttribute(WebEngineSettings::AutoLoadIconsForPage);
-}
-
-/*!
- \qmlproperty bool WebEngineSettings::touchIconsEnabled
- \since QtWebEngine 1.3
-
- Enables support for touch icons and precomposed touch icons.
-
- Disabled by default.
-*/
-bool QQuickWebEngineSettings::touchIconsEnabled() const
-{
- return d_ptr->testAttribute(WebEngineSettings::TouchIconsEnabled);
-}
-
-/*!
\qmlproperty string WebEngineSettings::defaultTextEncoding
\since QtWebEngine 1.2
@@ -424,46 +358,6 @@ void QQuickWebEngineSettings::setFullScreenSupportEnabled(bool on)
Q_EMIT fullScreenSupportEnabledChanged();
}
-void QQuickWebEngineSettings::setScreenCaptureEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::ScreenCaptureEnabled);
- d_ptr->setAttribute(WebEngineSettings::ScreenCaptureEnabled, on);
- if (wasOn != on)
- Q_EMIT screenCaptureEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setWebGLEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::WebGLEnabled);
- d_ptr->setAttribute(WebEngineSettings::WebGLEnabled, on);
- if (wasOn != on)
- Q_EMIT webGLEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setAccelerated2dCanvasEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::Accelerated2dCanvasEnabled);
- d_ptr->setAttribute(WebEngineSettings::Accelerated2dCanvasEnabled, on);
- if (wasOn != on)
- Q_EMIT accelerated2dCanvasEnabledChanged();
-}
-
-void QQuickWebEngineSettings::setAutoLoadIconsForPage(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::AutoLoadIconsForPage);
- d_ptr->setAttribute(WebEngineSettings::AutoLoadIconsForPage, on);
- if (wasOn != on)
- Q_EMIT autoLoadIconsForPageChanged();
-}
-
-void QQuickWebEngineSettings::setTouchIconsEnabled(bool on)
-{
- bool wasOn = d_ptr->testAttribute(WebEngineSettings::TouchIconsEnabled);
- d_ptr->setAttribute(WebEngineSettings::TouchIconsEnabled, on);
- if (wasOn != on)
- Q_EMIT touchIconsEnabledChanged();
-}
-
void QQuickWebEngineSettings::setDefaultTextEncoding(QString encoding)
{
const QString oldDefaultTextEncoding = d_ptr->defaultTextEncoding();
diff --git a/src/webengine/api/qquickwebenginesettings_p.h b/src/webengine/api/qquickwebenginesettings_p.h
index 584027260..27779d35a 100644
--- a/src/webengine/api/qquickwebenginesettings_p.h
+++ b/src/webengine/api/qquickwebenginesettings_p.h
@@ -77,11 +77,6 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject {
Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled NOTIFY pluginsEnabledChanged)
Q_PROPERTY(bool fullScreenSupportEnabled READ fullScreenSupportEnabled WRITE setFullScreenSupportEnabled NOTIFY fullScreenSupportEnabledChanged REVISION 1)
Q_PROPERTY(QString defaultTextEncoding READ defaultTextEncoding WRITE setDefaultTextEncoding NOTIFY defaultTextEncodingChanged)
- Q_PROPERTY(bool screenCaptureEnabled READ screenCaptureEnabled WRITE setScreenCaptureEnabled NOTIFY screenCaptureEnabledChanged REVISION 2)
- Q_PROPERTY(bool webGLEnabled READ webGLEnabled WRITE setWebGLEnabled NOTIFY webGLEnabledChanged REVISION 2)
- Q_PROPERTY(bool accelerated2dCanvasEnabled READ accelerated2dCanvasEnabled WRITE setAccelerated2dCanvasEnabled NOTIFY accelerated2dCanvasEnabledChanged REVISION 2)
- Q_PROPERTY(bool autoLoadIconsForPage READ autoLoadIconsForPage WRITE setAutoLoadIconsForPage NOTIFY autoLoadIconsForPageChanged REVISION 2)
- Q_PROPERTY(bool touchIconsEnabled READ touchIconsEnabled WRITE setTouchIconsEnabled NOTIFY touchIconsEnabledChanged REVISION 2)
public:
~QQuickWebEngineSettings();
@@ -100,11 +95,6 @@ public:
bool pluginsEnabled() const;
bool fullScreenSupportEnabled() const;
QString defaultTextEncoding() const;
- bool screenCaptureEnabled() const;
- bool webGLEnabled() const;
- bool accelerated2dCanvasEnabled() const;
- bool autoLoadIconsForPage() const;
- bool touchIconsEnabled() const;
void setAutoLoadImages(bool on);
void setJavascriptEnabled(bool on);
@@ -120,11 +110,6 @@ public:
void setPluginsEnabled(bool on);
void setFullScreenSupportEnabled(bool on);
void setDefaultTextEncoding(QString encoding);
- void setScreenCaptureEnabled(bool on);
- void setWebGLEnabled(bool on);
- void setAccelerated2dCanvasEnabled(bool on);
- void setAutoLoadIconsForPage(bool on);
- void setTouchIconsEnabled(bool on);
signals:
void autoLoadImagesChanged();
@@ -141,11 +126,6 @@ signals:
void pluginsEnabledChanged();
Q_REVISION(1) void fullScreenSupportEnabledChanged();
void defaultTextEncodingChanged();
- Q_REVISION(2) void screenCaptureEnabledChanged();
- Q_REVISION(2) void webGLEnabledChanged();
- Q_REVISION(2) void accelerated2dCanvasEnabledChanged();
- Q_REVISION(2) void autoLoadIconsForPageChanged();
- Q_REVISION(2) void touchIconsEnabledChanged();
private:
explicit QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings = 0);
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 31a258b0c..735100206 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -43,11 +43,11 @@
#include "authentication_dialog_controller.h"
#include "browser_context_adapter.h"
#include "certificate_error_controller.h"
+#include "color_chooser_controller.h"
#include "file_picker_controller.h"
#include "javascript_dialog_controller.h"
#include "qquickwebenginehistory_p.h"
#include "qquickwebenginecertificateerror_p.h"
-#include "qquickwebenginefaviconprovider_p_p.h"
#include "qquickwebengineloadrequest_p.h"
#include "qquickwebenginenavigationrequest_p.h"
#include "qquickwebenginenewviewrequest_p.h"
@@ -71,10 +71,7 @@
#include <QClipboard>
#include <QGuiApplication>
#include <QLoggingCategory>
-#include <QMarginsF>
#include <QMimeData>
-#include <QPageLayout>
-#include <QPageSize>
#include <QQmlComponent>
#include <QQmlContext>
#include <QQmlEngine>
@@ -134,14 +131,12 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
, m_testSupport(0)
#endif
, contextMenuExtraItems(0)
- , faviconProvider(0)
, loadProgress(0)
, m_fullscreenMode(false)
, isLoading(false)
, m_activeFocusOnPress(true)
, devicePixelRatio(QGuiApplication::primaryScreen()->devicePixelRatio())
, m_webChannel(0)
- , m_webChannelWorld(0)
, m_dpiScale(1.0)
, m_backgroundColor(Qt::white)
, m_defaultZoomFactor(1.0)
@@ -228,8 +223,7 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
if (!menu)
return false;
- contextMenuData.update(data);
- Q_EMIT q->experimental()->contextMenuDataChanged();
+ contextMenuData = data;
// Populate our menu
MenuItemHandler *item = 0;
@@ -256,12 +250,9 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::Copy); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Copy"));
- item = new MenuItemHandler(menu);
- QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::Unselect); });
- ui()->addMenuItem(item, QQuickWebEngineView::tr("Unselect"));
}
- if (!contextMenuData.linkText().isEmpty() && contextMenuData.linkUrl().isValid()) {
+ if (!contextMenuData.linkText.isEmpty() && contextMenuData.linkUrl.isValid()) {
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::CopyLinkToClipboard); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Copy Link URL"));
@@ -269,9 +260,9 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::DownloadLinkToDisk); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Save Link"));
}
- if (contextMenuData.mediaUrl().isValid()) {
- switch (contextMenuData.mediaType()) {
- case QQuickWebEngineContextMenuData::MediaTypeImage:
+ if (contextMenuData.mediaUrl.isValid()) {
+ switch (contextMenuData.mediaType) {
+ case WebEngineContextMenuData::MediaTypeImage:
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::CopyImageUrlToClipboard); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Copy Image URL"));
@@ -282,11 +273,11 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::DownloadImageToDisk); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Save Image"));
break;
- case QQuickWebEngineContextMenuData::MediaTypeCanvas:
+ case WebEngineContextMenuData::MediaTypeCanvas:
Q_UNREACHABLE(); // mediaUrl is invalid for canvases
break;
- case QQuickWebEngineContextMenuData::MediaTypeAudio:
- case QQuickWebEngineContextMenuData::MediaTypeVideo:
+ case WebEngineContextMenuData::MediaTypeAudio:
+ case WebEngineContextMenuData::MediaTypeVideo:
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::CopyMediaUrlToClipboard); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Copy Media URL"));
@@ -313,7 +304,7 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
default:
break;
}
- } else if (contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeCanvas) {
+ } else if (contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeCanvas) {
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::CopyImageToClipboard); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Copy Image"));
@@ -381,7 +372,7 @@ void QQuickWebEngineViewPrivate::runGeolocationPermissionRequest(const QUrl &url
void QQuickWebEngineViewPrivate::showColorDialog(QSharedPointer<ColorChooserController> controller)
{
- ui()->showColorDialog(controller);
+ controller->reject();
}
void QQuickWebEngineViewPrivate::runFileChooser(FilePickerController* controller)
@@ -415,20 +406,10 @@ void QQuickWebEngineViewPrivate::urlChanged(const QUrl &url)
void QQuickWebEngineViewPrivate::iconChanged(const QUrl &url)
{
Q_Q(QQuickWebEngineView);
-
- if (iconUrl == QQuickWebEngineFaviconProvider::faviconProviderUrl(url))
+ if (iconUrl == url)
return;
- if (!faviconProvider) {
- QQmlEngine *engine = qmlEngine(q);
- Q_ASSERT(engine);
- faviconProvider = static_cast<QQuickWebEngineFaviconProvider *>(
- engine->imageProvider(QQuickWebEngineFaviconProvider::identifier()));
- Q_ASSERT(faviconProvider);
- }
-
- iconUrl = faviconProvider->attach(q, url);
- m_history->reset();
+ iconUrl = url;
Q_EMIT q->iconChanged();
}
@@ -445,10 +426,8 @@ void QQuickWebEngineViewPrivate::didUpdateTargetURL(const QUrl &hoveredUrl)
Q_EMIT q->linkHovered(hoveredUrl);
}
-void QQuickWebEngineViewPrivate::recentlyAudibleChanged(bool recentlyAudible)
+void QQuickWebEngineViewPrivate::recentlyAudibleChanged(bool /*recentlyAudible*/)
{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->recentlyAudibleChanged(recentlyAudible);
}
QRectF QQuickWebEngineViewPrivate::viewportRect() const
@@ -806,7 +785,7 @@ void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContent
// associate the webChannel with the new adapter
if (m_webChannel)
- adapter->setWebChannel(m_webChannel, m_webChannelWorld);
+ adapter->setWebChannel(m_webChannel, QQuickWebEngineScript::MainWorld);
// set initial background color if non-default
if (m_backgroundColor != Qt::white)
@@ -849,9 +828,6 @@ QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent)
QQuickWebEngineView::~QQuickWebEngineView()
{
- Q_D(QQuickWebEngineView);
- if (d->faviconProvider)
- d->faviconProvider->detach(this);
}
void QQuickWebEngineViewPrivate::ensureContentsAdapter()
@@ -863,7 +839,7 @@ void QQuickWebEngineViewPrivate::ensureContentsAdapter()
if (m_backgroundColor != Qt::white)
adapter->backgroundColorChanged();
if (m_webChannel)
- adapter->setWebChannel(m_webChannel, m_webChannelWorld);
+ adapter->setWebChannel(m_webChannel, QQuickWebEngineScript::MainWorld);
if (explicitUrl.isValid())
adapter->load(explicitUrl);
// push down the page's user scripts
@@ -1064,12 +1040,9 @@ void QQuickWebEngineViewPrivate::didFindText(quint64 requestId, int matchCount)
callback.call(args);
}
-void QQuickWebEngineViewPrivate::didPrintPage(quint64 requestId, const QByteArray &result)
+void QQuickWebEngineViewPrivate::didPrintPage(quint64 /*requestId*/, const QByteArray &/*result*/)
{
- QJSValue callback = m_callbacks.take(requestId);
- QJSValueList args;
- args.append(QJSValue(result.data()));
- callback.call(args);
+ Q_UNREACHABLE();
}
void QQuickWebEngineViewPrivate::showValidationMessage(const QRect &anchor, const QString &mainText, const QString &subText)
@@ -1092,16 +1065,12 @@ void QQuickWebEngineViewPrivate::moveValidationMessage(const QRect &anchor)
ui()->moveMessageBubble(anchor);
}
-void QQuickWebEngineViewPrivate::updateScrollPosition(const QPointF &position)
+void QQuickWebEngineViewPrivate::updateScrollPosition(const QPointF &)
{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->scrollPositionChanged(position);
}
-void QQuickWebEngineViewPrivate::updateContentsSize(const QSizeF &size)
+void QQuickWebEngineViewPrivate::updateContentsSize(const QSizeF &)
{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->contentsSizeChanged(size);
}
void QQuickWebEngineViewPrivate::renderProcessTerminated(
@@ -1172,18 +1141,6 @@ void QQuickWebEngineView::runJavaScript(const QString &script, const QJSValue &c
d->adapter->runJavaScript(script, QQuickWebEngineScript::MainWorld);
}
-void QQuickWebEngineView::runJavaScript(const QString &script, quint32 worldId, const QJSValue &callback)
-{
- Q_D(QQuickWebEngineView);
- if (!d->adapter)
- return;
- if (!callback.isUndefined()) {
- quint64 requestId = d_ptr->adapter->runJavaScriptCallbackResult(script, worldId);
- d->m_callbacks.insert(requestId, callback);
- } else
- d->adapter->runJavaScript(script, worldId);
-}
-
QQuickWebEngineViewExperimental *QQuickWebEngineView::experimental() const
{
Q_D(const QQuickWebEngineView);
@@ -1215,65 +1172,6 @@ void QQuickWebEngineView::setBackgroundColor(const QColor &color)
emit backgroundColorChanged();
}
-/*!
- \property QQuickWebEngineView::audioMuted
- \brief the state of whether the current page audio is muted.
- \since 5.7
-
- The default value is false.
-*/
-bool QQuickWebEngineView::isAudioMuted() const
-{
- const Q_D(QQuickWebEngineView);
- if (d->adapter)
- return d->adapter->isAudioMuted();
- return false;
-}
-
-void QQuickWebEngineView::setAudioMuted(bool muted)
-{
- Q_D(QQuickWebEngineView);
- bool _isAudioMuted = isAudioMuted();
- if (d->adapter) {
- d->adapter->setAudioMuted(muted);
- if (_isAudioMuted != muted) {
- Q_EMIT audioMutedChanged(muted);
- }
- }
-}
-
-bool QQuickWebEngineView::recentlyAudible() const
-{
- const Q_D(QQuickWebEngineView);
- if (d->adapter)
- return d->adapter->recentlyAudible();
- return false;
-}
-
-void QQuickWebEngineView::printToPdf(const QString& filePath, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
-{
- Q_D(const QQuickWebEngineView);
- QPageSize layoutSize(static_cast<QPageSize::PageSizeId>(pageSizeId));
- QPageLayout::Orientation layoutOrientation = static_cast<QPageLayout::Orientation>(orientation);
- QPageLayout pageLayout(layoutSize, layoutOrientation, QMarginsF(0.0, 0.0, 0.0, 0.0));
-
- d->adapter->printToPDF(pageLayout, filePath);
-}
-
-void QQuickWebEngineView::printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
-{
- Q_D(QQuickWebEngineView);
- QPageSize layoutSize(static_cast<QPageSize::PageSizeId>(pageSizeId));
- QPageLayout::Orientation layoutOrientation = static_cast<QPageLayout::Orientation>(orientation);
- QPageLayout pageLayout(layoutSize, layoutOrientation, QMarginsF(0.0, 0.0, 0.0, 0.0));
-
- if (callback.isUndefined())
- return;
-
- quint64 requestId = d->adapter->printToPDFCallbackResult(pageLayout);
- d->m_callbacks.insert(requestId, callback);
-}
-
bool QQuickWebEngineView::isFullScreen() const
{
Q_D(const QQuickWebEngineView);
@@ -1324,7 +1222,7 @@ QQmlWebChannel *QQuickWebEngineView::webChannel()
if (!d->m_webChannel) {
d->m_webChannel = new QQmlWebChannel(this);
if (d->adapter)
- d->adapter->setWebChannel(d->m_webChannel, d->m_webChannelWorld);
+ d->adapter->setWebChannel(d->m_webChannel, QQuickWebEngineScript::MainWorld);
}
return d->m_webChannel;
@@ -1337,27 +1235,10 @@ void QQuickWebEngineView::setWebChannel(QQmlWebChannel *webChannel)
return;
d->m_webChannel = webChannel;
if (d->adapter)
- d->adapter->setWebChannel(webChannel, d->m_webChannelWorld);
+ d->adapter->setWebChannel(webChannel, QQuickWebEngineScript::MainWorld);
Q_EMIT webChannelChanged();
}
-uint QQuickWebEngineView::webChannelWorld() const
-{
- Q_D(const QQuickWebEngineView);
- return d->m_webChannelWorld;
-}
-
-void QQuickWebEngineView::setWebChannelWorld(uint webChannelWorld)
-{
- Q_D(QQuickWebEngineView);
- if (d->m_webChannelWorld == webChannelWorld)
- return;
- d->m_webChannelWorld = webChannelWorld;
- if (d->adapter)
- d->adapter->setWebChannel(d->m_webChannel, d->m_webChannelWorld);
- Q_EMIT webChannelWorldChanged(webChannelWorld);
-}
-
void QQuickWebEngineView::grantFeaturePermission(const QUrl &securityOrigin, QQuickWebEngineView::Feature feature, bool granted)
{
if (!d_ptr->adapter)
@@ -1510,122 +1391,119 @@ void QQuickWebEngineView::triggerWebAction(WebAction action)
case PasteAndMatchStyle:
d->adapter->pasteAndMatchStyle();
break;
- case Unselect:
- d->adapter->unselect();
- break;
case OpenLinkInThisWindow:
- if (d->contextMenuData.linkUrl().isValid())
- setUrl(d->contextMenuData.linkUrl());
+ if (d->contextMenuData.linkUrl.isValid())
+ setUrl(d->contextMenuData.linkUrl);
break;
case OpenLinkInNewWindow:
- if (d->contextMenuData.linkUrl().isValid()) {
+ if (d->contextMenuData.linkUrl.isValid()) {
QQuickWebEngineNewViewRequest request;
- request.m_requestedUrl = d->contextMenuData.linkUrl();
+ request.m_requestedUrl = d->contextMenuData.linkUrl;
request.m_isUserInitiated = true;
request.m_destination = NewViewInWindow;
Q_EMIT newViewRequested(&request);
}
break;
case OpenLinkInNewTab:
- if (d->contextMenuData.linkUrl().isValid()) {
+ if (d->contextMenuData.linkUrl.isValid()) {
QQuickWebEngineNewViewRequest request;
- request.m_requestedUrl = d->contextMenuData.linkUrl();
+ request.m_requestedUrl = d->contextMenuData.linkUrl;
request.m_isUserInitiated = true;
request.m_destination = NewViewInBackgroundTab;
Q_EMIT newViewRequested(&request);
}
break;
case CopyLinkToClipboard:
- if (d->contextMenuData.linkUrl().isValid()) {
- QString urlString = d->contextMenuData.linkUrl().toString(QUrl::FullyEncoded);
- QString title = d->contextMenuData.linkText().toHtmlEscaped();
+ if (d->contextMenuData.linkUrl.isValid()) {
+ QString urlString = d->contextMenuData.linkUrl.toString(QUrl::FullyEncoded);
+ QString title = d->contextMenuData.linkText.toHtmlEscaped();
QMimeData *data = new QMimeData();
data->setText(urlString);
QString html = QStringLiteral("<a href=\"") + urlString + QStringLiteral("\">") + title + QStringLiteral("</a>");
data->setHtml(html);
- data->setUrls(QList<QUrl>() << d->contextMenuData.linkUrl());
+ data->setUrls(QList<QUrl>() << d->contextMenuData.linkUrl);
qApp->clipboard()->setMimeData(data);
}
break;
case DownloadLinkToDisk:
- if (d->contextMenuData.linkUrl().isValid())
- d->adapter->download(d->contextMenuData.linkUrl(), d->contextMenuData.d->suggestedFileName);
+ if (d->contextMenuData.linkUrl.isValid())
+ d->adapter->download(d->contextMenuData.linkUrl, d->contextMenuData.suggestedFileName);
break;
case CopyImageToClipboard:
- if (d->contextMenuData.d->hasImageContent &&
- (d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeImage ||
- d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeCanvas))
+ if (d->contextMenuData.hasImageContent &&
+ (d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeImage ||
+ d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeCanvas))
{
- d->adapter->copyImageAt(d->contextMenuData.position());
+ d->adapter->copyImageAt(d->contextMenuData.pos);
}
break;
case CopyImageUrlToClipboard:
- if (d->contextMenuData.mediaUrl().isValid() && d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeImage) {
- QString urlString = d->contextMenuData.mediaUrl().toString(QUrl::FullyEncoded);
- QString title = d->contextMenuData.linkText();
+ if (d->contextMenuData.mediaUrl.isValid() && d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeImage) {
+ QString urlString = d->contextMenuData.mediaUrl.toString(QUrl::FullyEncoded);
+ QString title = d->contextMenuData.linkText;
if (!title.isEmpty())
title = QStringLiteral(" alt=\"%1\"").arg(title.toHtmlEscaped());
QMimeData *data = new QMimeData();
data->setText(urlString);
QString html = QStringLiteral("<img src=\"") + urlString + QStringLiteral("\"") + title + QStringLiteral("></img>");
data->setHtml(html);
- data->setUrls(QList<QUrl>() << d->contextMenuData.mediaUrl());
+ data->setUrls(QList<QUrl>() << d->contextMenuData.mediaUrl);
qApp->clipboard()->setMimeData(data);
}
break;
case DownloadImageToDisk:
case DownloadMediaToDisk:
- if (d->contextMenuData.mediaUrl().isValid())
- d->adapter->download(d->contextMenuData.mediaUrl(), d->contextMenuData.d->suggestedFileName);
+ if (d->contextMenuData.mediaUrl.isValid())
+ d->adapter->download(d->contextMenuData.mediaUrl, d->contextMenuData.suggestedFileName);
break;
case CopyMediaUrlToClipboard:
- if (d->contextMenuData.mediaUrl().isValid() &&
- (d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeAudio ||
- d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeVideo))
+ if (d->contextMenuData.mediaUrl.isValid() &&
+ (d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
+ d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
{
- QString urlString = d->contextMenuData.mediaUrl().toString(QUrl::FullyEncoded);
+ QString urlString = d->contextMenuData.mediaUrl.toString(QUrl::FullyEncoded);
QMimeData *data = new QMimeData();
data->setText(urlString);
- if (d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeAudio)
+ if (d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeAudio)
data->setHtml(QStringLiteral("<audio src=\"") + urlString + QStringLiteral("\"></audio>"));
else
data->setHtml(QStringLiteral("<video src=\"") + urlString + QStringLiteral("\"></video>"));
- data->setUrls(QList<QUrl>() << d->contextMenuData.mediaUrl());
+ data->setUrls(QList<QUrl>() << d->contextMenuData.mediaUrl);
qApp->clipboard()->setMimeData(data);
}
break;
case ToggleMediaControls:
- if (d->contextMenuData.mediaUrl().isValid() && d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaCanToggleControls) {
- bool enable = !(d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaControls);
- d->adapter->executeMediaPlayerActionAt(d->contextMenuData.position(), WebContentsAdapter::MediaPlayerControls, enable);
+ if (d->contextMenuData.mediaUrl.isValid() && d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaCanToggleControls) {
+ bool enable = !(d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaControls);
+ d->adapter->executeMediaPlayerActionAt(d->contextMenuData.pos, WebContentsAdapter::MediaPlayerControls, enable);
}
break;
case ToggleMediaLoop:
- if (d->contextMenuData.mediaUrl().isValid() &&
- (d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeAudio ||
- d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeVideo))
+ if (d->contextMenuData.mediaUrl.isValid() &&
+ (d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
+ d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
{
- bool enable = !(d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaLoop);
- d->adapter->executeMediaPlayerActionAt(d->contextMenuData.position(), WebContentsAdapter::MediaPlayerLoop, enable);
+ bool enable = !(d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaLoop);
+ d->adapter->executeMediaPlayerActionAt(d->contextMenuData.pos, WebContentsAdapter::MediaPlayerLoop, enable);
}
break;
case ToggleMediaPlayPause:
- if (d->contextMenuData.mediaUrl().isValid() &&
- (d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeAudio ||
- d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeVideo))
+ if (d->contextMenuData.mediaUrl.isValid() &&
+ (d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
+ d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
{
- bool enable = (d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaPaused);
- d->adapter->executeMediaPlayerActionAt(d->contextMenuData.position(), WebContentsAdapter::MediaPlayerPlay, enable);
+ bool enable = (d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaPaused);
+ d->adapter->executeMediaPlayerActionAt(d->contextMenuData.pos, WebContentsAdapter::MediaPlayerPlay, enable);
}
break;
case ToggleMediaMute:
- if (d->contextMenuData.mediaUrl().isValid() && d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaHasAudio) {
- bool enable = !(d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaMuted);
- d->adapter->executeMediaPlayerActionAt(d->contextMenuData.position(), WebContentsAdapter::MediaPlayerMute, enable);
+ if (d->contextMenuData.mediaUrl.isValid() && d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaHasAudio) {
+ bool enable = !(d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaMuted);
+ d->adapter->executeMediaPlayerActionAt(d->contextMenuData.pos, WebContentsAdapter::MediaPlayerMute, enable);
}
break;
case InspectElement:
- d->adapter->inspectElementAt(d->contextMenuData.position());
+ d->adapter->inspectElementAt(d->contextMenuData.pos);
break;
case ExitFullScreen:
d->adapter->exitFullScreen();
@@ -1633,32 +1511,11 @@ void QQuickWebEngineView::triggerWebAction(WebAction action)
case RequestClose:
d->adapter->requestClose();
break;
- case SavePage:
- d->adapter->save();
- break;
default:
Q_UNREACHABLE();
}
}
-const QQuickWebEngineContextMenuData *QQuickWebEngineViewExperimental::contextMenuData() const
-{
- Q_D(const QQuickWebEngineView);
- return &d->contextMenuData;
-}
-
-QSizeF QQuickWebEngineView::contentsSize() const
-{
- Q_D(const QQuickWebEngineView);
- return d->adapter->lastContentsSize();
-}
-
-QPointF QQuickWebEngineView::scrollPosition() const
-{
- Q_D(const QQuickWebEngineView);
- return d->adapter->lastScrollOffset();
-}
-
void QQuickWebEngineViewPrivate::userScripts_append(QQmlListProperty<QQuickWebEngineScript> *p, QQuickWebEngineScript *script)
{
Q_ASSERT(p && p->data);
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index b9555d2d9..eef6a0cf5 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -60,8 +60,6 @@ QT_BEGIN_NAMESPACE
class QQmlWebChannel;
class QQuickWebEngineCertificateError;
-class QQuickWebEngineContextMenuData;
-class QQuickWebEngineFaviconProvider;
class QQuickWebEngineHistory;
class QQuickWebEngineLoadRequest;
class QQuickWebEngineNavigationRequest;
@@ -94,7 +92,7 @@ private:
const bool m_toggleOn;
};
-#define LATEST_WEBENGINEVIEW_REVISION 3
+#define LATEST_WEBENGINEVIEW_REVISION 2
class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
Q_OBJECT
@@ -114,11 +112,6 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
Q_PROPERTY(QQmlListProperty<QQuickWebEngineScript> userScripts READ userScripts FINAL REVISION 1)
Q_PROPERTY(bool activeFocusOnPress READ activeFocusOnPress WRITE setActiveFocusOnPress NOTIFY activeFocusOnPressChanged REVISION 2)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged REVISION 2)
- Q_PROPERTY(QSizeF contentsSize READ contentsSize NOTIFY contentsSizeChanged FINAL REVISION 3)
- Q_PROPERTY(QPointF scrollPosition READ scrollPosition NOTIFY scrollPositionChanged FINAL REVISION 3)
- Q_PROPERTY(bool audioMuted READ isAudioMuted WRITE setAudioMuted NOTIFY audioMutedChanged FINAL REVISION 3)
- Q_PROPERTY(bool recentlyAudible READ recentlyAudible NOTIFY recentlyAudibleChanged FINAL REVISION 3)
- Q_PROPERTY(uint webChannelWorld READ webChannelWorld WRITE setWebChannelWorld NOTIFY webChannelWorldChanged REVISION 3)
#ifdef ENABLE_QML_TESTSUPPORT_API
Q_PROPERTY(QQuickWebEngineTestSupport *testSupport READ testSupport WRITE setTestSupport FINAL)
@@ -143,8 +136,6 @@ public:
void setZoomFactor(qreal arg);
QColor backgroundColor() const;
void setBackgroundColor(const QColor &color);
- QSizeF contentsSize() const;
- QPointF scrollPosition() const;
QQuickWebEngineViewExperimental *experimental() const;
@@ -241,8 +232,7 @@ public:
InspectElement,
ExitFullScreen,
RequestClose,
- Unselect,
- SavePage,
+
WebActionCount
};
Q_ENUM(WebAction)
@@ -270,166 +260,6 @@ public:
};
Q_DECLARE_FLAGS(FindFlags, FindFlag)
- // must match QPageSize::PageSizeId
- enum PrintedPageSizeId {
- // Existing Qt sizes
- A4,
- B5,
- Letter,
- Legal,
- Executive,
- A0,
- A1,
- A2,
- A3,
- A5,
- A6,
- A7,
- A8,
- A9,
- B0,
- B1,
- B10,
- B2,
- B3,
- B4,
- B6,
- B7,
- B8,
- B9,
- C5E,
- Comm10E,
- DLE,
- Folio,
- Ledger,
- Tabloid,
- Custom,
-
- // New values derived from PPD standard
- A10,
- A3Extra,
- A4Extra,
- A4Plus,
- A4Small,
- A5Extra,
- B5Extra,
-
- JisB0,
- JisB1,
- JisB2,
- JisB3,
- JisB4,
- JisB5,
- JisB6,
- JisB7,
- JisB8,
- JisB9,
- JisB10,
-
- // AnsiA = Letter,
- // AnsiB = Ledger,
- AnsiC,
- AnsiD,
- AnsiE,
- LegalExtra,
- LetterExtra,
- LetterPlus,
- LetterSmall,
- TabloidExtra,
-
- ArchA,
- ArchB,
- ArchC,
- ArchD,
- ArchE,
-
- Imperial7x9,
- Imperial8x10,
- Imperial9x11,
- Imperial9x12,
- Imperial10x11,
- Imperial10x13,
- Imperial10x14,
- Imperial12x11,
- Imperial15x11,
-
- ExecutiveStandard,
- Note,
- Quarto,
- Statement,
- SuperA,
- SuperB,
- Postcard,
- DoublePostcard,
- Prc16K,
- Prc32K,
- Prc32KBig,
-
- FanFoldUS,
- FanFoldGerman,
- FanFoldGermanLegal,
-
- EnvelopeB4,
- EnvelopeB5,
- EnvelopeB6,
- EnvelopeC0,
- EnvelopeC1,
- EnvelopeC2,
- EnvelopeC3,
- EnvelopeC4,
- // EnvelopeC5 = C5E,
- EnvelopeC6,
- EnvelopeC65,
- EnvelopeC7,
- // EnvelopeDL = DLE,
-
- Envelope9,
- // Envelope10 = Comm10E,
- Envelope11,
- Envelope12,
- Envelope14,
- EnvelopeMonarch,
- EnvelopePersonal,
-
- EnvelopeChou3,
- EnvelopeChou4,
- EnvelopeInvite,
- EnvelopeItalian,
- EnvelopeKaku2,
- EnvelopeKaku3,
- EnvelopePrc1,
- EnvelopePrc2,
- EnvelopePrc3,
- EnvelopePrc4,
- EnvelopePrc5,
- EnvelopePrc6,
- EnvelopePrc7,
- EnvelopePrc8,
- EnvelopePrc9,
- EnvelopePrc10,
- EnvelopeYou4,
-
- // Last item, with commonly used synynoms from QPagedPrintEngine / QPrinter
- LastPageSize = EnvelopeYou4,
- NPageSize = LastPageSize,
- NPaperSize = LastPageSize,
-
- // Convenience overloads for naming consistency
- AnsiA = Letter,
- AnsiB = Ledger,
- EnvelopeC5 = C5E,
- EnvelopeDL = DLE,
- Envelope10 = Comm10E
- };
- Q_ENUM(PrintedPageSizeId)
-
- // must match QPageLayout::Orientation
- enum PrintedPageOrientation {
- Portrait,
- Landscape
- };
- Q_ENUM(PrintedPageOrientation)
-
// QmlParserStatus
virtual void componentComplete() Q_DECL_OVERRIDE;
@@ -441,12 +271,6 @@ public:
QQmlWebChannel *webChannel();
void setWebChannel(QQmlWebChannel *);
QQuickWebEngineHistory *navigationHistory() const;
- uint webChannelWorld() const;
- void setWebChannelWorld(uint);
-
- bool isAudioMuted() const;
- void setAudioMuted(bool muted);
- bool recentlyAudible() const;
#ifdef ENABLE_QML_TESTSUPPORT_API
QQuickWebEngineTestSupport *testSupport() const;
@@ -457,7 +281,6 @@ public:
public Q_SLOTS:
void runJavaScript(const QString&, const QJSValue & = QJSValue());
- Q_REVISION(3) void runJavaScript(const QString&, quint32 worldId, const QJSValue & = QJSValue());
void loadHtml(const QString &html, const QUrl &baseUrl = QUrl());
void goBack();
void goForward();
@@ -470,8 +293,6 @@ public Q_SLOTS:
Q_REVISION(1) void grantFeaturePermission(const QUrl &securityOrigin, Feature, bool granted);
Q_REVISION(2) void setActiveFocusOnPress(bool arg);
Q_REVISION(2) void triggerWebAction(WebAction action);
- Q_REVISION(3) void printToPdf(const QString &filePath, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
- Q_REVISION(3) void printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
private Q_SLOTS:
void lazyInitialize();
@@ -496,11 +317,6 @@ Q_SIGNALS:
Q_REVISION(2) void backgroundColorChanged();
Q_REVISION(2) void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode);
Q_REVISION(2) void windowCloseRequested();
- Q_REVISION(3) void contentsSizeChanged(const QSizeF& size);
- Q_REVISION(3) void scrollPositionChanged(const QPointF& position);
- Q_REVISION(3) void audioMutedChanged(bool muted);
- Q_REVISION(3) void recentlyAudibleChanged(bool recentlyAudible);
- Q_REVISION(3) void webChannelWorldChanged(uint);
protected:
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE;
@@ -517,7 +333,6 @@ private:
friend class QQuickWebEngineViewExperimental;
friend class QQuickWebEngineViewExperimentalExtension;
friend class QQuickWebEngineNewViewRequest;
- friend class QQuickWebEngineFaviconProvider;
#ifndef QT_NO_ACCESSIBILITY
friend class QQuickWebEngineViewAccessible;
#endif // QT_NO_ACCESSIBILITY
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index 769e41a44..c762c4d28 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -52,7 +52,6 @@
//
#include "qquickwebengineview_p.h"
-#include "qquickwebenginecontextmenudata_p.h"
#include "web_contents_adapter_client.h"
#include <QScopedPointer>
@@ -71,7 +70,6 @@ class QQuickWebEngineView;
class QQmlComponent;
class QQmlContext;
class QQuickWebEngineSettings;
-class QQuickWebEngineFaviconProvider;
QQuickWebEngineView::WebAction editorActionForKeyEvent(QKeyEvent* event);
@@ -101,17 +99,13 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewExperimental : public QObjec
Q_OBJECT
Q_PROPERTY(QQuickWebEngineViewport *viewport READ viewport)
Q_PROPERTY(QQmlComponent *extraContextMenuEntriesComponent READ extraContextMenuEntriesComponent WRITE setExtraContextMenuEntriesComponent NOTIFY extraContextMenuEntriesComponentChanged)
- Q_PROPERTY(const QQuickWebEngineContextMenuData *contextMenuData READ contextMenuData NOTIFY contextMenuDataChanged)
QQuickWebEngineViewport *viewport() const;
void setExtraContextMenuEntriesComponent(QQmlComponent *);
QQmlComponent *extraContextMenuEntriesComponent() const;
- const QQuickWebEngineContextMenuData *contextMenuData() const;
-
Q_SIGNALS:
void extraContextMenuEntriesComponentChanged();
- void contextMenuDataChanged();
private:
QQuickWebEngineViewExperimental(QQuickWebEngineViewPrivate* viewPrivate);
@@ -217,10 +211,9 @@ public:
QQuickWebEngineTestSupport *m_testSupport;
#endif
QQmlComponent *contextMenuExtraItems;
- QQuickWebEngineContextMenuData contextMenuData;
+ QtWebEngineCore::WebEngineContextMenuData contextMenuData;
QUrl explicitUrl;
QUrl iconUrl;
- QQuickWebEngineFaviconProvider *faviconProvider;
int loadProgress;
bool m_fullscreenMode;
bool isLoading;
@@ -229,7 +222,6 @@ public:
QMap<quint64, QJSValue> m_callbacks;
QList<QSharedPointer<CertificateErrorController> > m_certificateErrorControllers;
QQmlWebChannel *m_webChannel;
- uint m_webChannelWorld;
private:
QScopedPointer<QtWebEngineCore::UIDelegatesManager> m_uIDelegatesManager;
diff --git a/src/webengine/doc/qtwebengine.qdocconf b/src/webengine/doc/qtwebengine.qdocconf
index 6fd93dc20..1f7b6adb3 100644
--- a/src/webengine/doc/qtwebengine.qdocconf
+++ b/src/webengine/doc/qtwebengine.qdocconf
@@ -42,7 +42,6 @@ depends += qtcore \
qtgui \
qtlocation \
qtnetwork \
- qtprintsupport \
qtpositioning \
qtqml \
qtquick \
diff --git a/src/webengine/doc/src/qtwebengine-features.qdoc b/src/webengine/doc/src/qtwebengine-features.qdoc
index 62a09bb91..92770a661 100644
--- a/src/webengine/doc/src/qtwebengine-features.qdoc
+++ b/src/webengine/doc/src/qtwebengine-features.qdoc
@@ -41,7 +41,6 @@
\li \l{HTML5 DRM}
\li \l{HTML5 Geolocation}
\li \l{Pepper Plugin API}
- \li \l{Print to PDF}
\li \l{WebRTC}
\endlist
@@ -92,7 +91,7 @@
Dragging files into the browser is not actually part of HTML5, but it is
supported. It can be tested by opening \l{HTML5 Demos - File API}.
- Support for this feature was added in Qt 5.7.0.
+ Support for this feature was added in Qt 5.6.3.
\section1 Fullscreen
@@ -123,7 +122,7 @@
Example}{Demo Browser} or \l{WebEngine Quick Nano Browser}{Nano Browser}
from \l{castLabs}, \l{Swank Motion Pictures, Inc.}, or \l{Shaka Player}.
- Support for this feature was added in Qt 5.7.0.
+ Support for this feature was added in Qt 5.6.3.
\section1 HTML5 Geolocation
@@ -212,17 +211,6 @@
feature, the \c https://helpx.adobe.com/flash-player.html page can be opened
in the browser.
- \section1 Print to PDF
-
- Qt WebEngine supports printing a web page to a PDF file. For more
- information, see QWebEnginePage::printToPdf() and
- \l{WebEngineView::printToPdf}{WebEngineView.printToPdf}.
-
- This feature can be tested in \l{WebEngine Demo Browser Example}
- {Demo Browser} by selecting \uicontrol File > \uicontrol {Print to PDF}.
-
- Support for this feature was added in Qt 5.7.0.
-
\section1 WebRTC
WebRTC provides browsers with Real-Time Communications (RTC) capabilities
diff --git a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc
index 8549e7664..53a03b1be 100644
--- a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc
+++ b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc
@@ -24,7 +24,7 @@
*/
/*!
- \qmlmodule QtWebEngine 1.3
+ \qmlmodule QtWebEngine 1.2
\title Qt WebEngine QML Types
\brief Provides QML types for rendering web content within a QML application
\ingroup qtwebengine-modules
@@ -34,7 +34,7 @@
your .qml file:
\badcode
- import QtWebEngine 1.3
+ import QtWebEngine 1.2
\endcode
To link against the module, add the following QT variable to your qmake .pro
diff --git a/src/webengine/doc/src/webengineview.qdoc b/src/webengine/doc/src/webengineview.qdoc
index b72e405a8..a675a813c 100644
--- a/src/webengine/doc/src/webengineview.qdoc
+++ b/src/webengine/doc/src/webengineview.qdoc
@@ -206,11 +206,10 @@
\qmlproperty url WebEngineView::icon
\readonly
- An internal URL for accessing the currently displayed web site icon,
- also known as favicon or shortcut icon. The icon is already downloaded
- and stored by the Qt WebEngine's favicon manager.
- This read-only URL corresponds to the image used within a mobile browser
- application to represent a bookmarked page on the device's home screen.
+ The location of the currently displayed web site icon,
+ also known as favicon or shortcut icon. This read-only URL corresponds to
+ the image used within a mobile browser application to represent a
+ bookmarked page on the device's home screen.
The following snippet uses the \c{icon} property to build an \c{Image}
component:
@@ -218,17 +217,10 @@
\qml
Image {
id: appIcon
- sourceSize: Qt.size(32, 32)
- source: webView.icon != "" ? webView.icon : "fallbackFavicon.png";
+ source: webView.icon != "" ? webView.icon : "fallbackFavIcon.png";
// ...
}
\endqml
-
- Specifying the \c{sourceSize} property of the \c{Image} element informs
- the Qt WebEngine's favicon provider about the requested size. The
- favicon provider tries to find the best fit among the web page candidate
- icons. If \c{sourceSize} property is not specified, the provider provides
- the icon with the largest resolution.
*/
/*!
@@ -342,28 +334,6 @@
*/
/*!
- \qmlproperty size WebEngineView::contentsSize
- \since QtWebEngine 1.3
-
- Size of the page contents.
-*/
-
-/*!
- \qmlproperty point WebEngineView::scrollPosition
- \since QtWebEngine 1.3
-
- Scroll position of the page contents.
-*/
-
-/*!
- \qmlproperty int WebEngineView::webChannelWorld
- \since QtWebEngine 1.3
-
- JavaScript world that the web channel instance used by this view is
- installed in.
-*/
-
-/*!
\qmlmethod void WebEngineView::loadHtml(string html, url baseUrl)
Loads the specified \a html as the content of the web view.
@@ -800,8 +770,6 @@
(Added in Qt 5.6)
\value WebEngineView.ExitFullScreen
Exit the fullscreen mode. (Added in Qt 5.6)
- \value WebEngineView.SavePage
- Save the current web page to disk. (Added in Qt 5.7)
\omitvalue WebActionCount
*/
@@ -825,165 +793,6 @@
*/
/*!
- \qmlproperty enumeration WebEngineView::PrintedPageSizeId
- \since QtWebEngine 1.3
-
- This enum type lists the available page sizes as defined in the Postscript
- PPD standard.
-
- The enumeration values are mapped from and must match QPageSize::PageSizeId. They are also
- duplicated in QPagedPaintDevice and QPrinter.
-
- The defined sizes are:
-
- \value WebEngineView.A0 841 x 1189 mm
- \value WebEngineView.A1 594 x 841 mm
- \value WebEngineView.A2 420 x 594 mm
- \value WebEngineView.A3 297 x 420 mm
- \value WebEngineView.A4 210 x 297 mm, 8.26 x 11.69 inches
- \value WebEngineView.A5 148 x 210 mm
- \value WebEngineView.A6 105 x 148 mm
- \value WebEngineView.A7 74 x 105 mm
- \value WebEngineView.A8 52 x 74 mm
- \value WebEngineView.A9 37 x 52 mm
- \value WebEngineView.B0 1000 x 1414 mm
- \value WebEngineView.B1 707 x 1000 mm
- \value WebEngineView.B2 500 x 707 mm
- \value WebEngineView.B3 353 x 500 mm
- \value WebEngineView.B4 250 x 353 mm
- \value WebEngineView.B5 176 x 250 mm, 6.93 x 9.84 inches
- \value WebEngineView.B6 125 x 176 mm
- \value WebEngineView.B7 88 x 125 mm
- \value WebEngineView.B8 62 x 88 mm
- \value WebEngineView.B9 44 x 62 mm
- \value WebEngineView.B10 31 x 44 mm
- \value WebEngineView.C5E 163 x 229 mm
- \value WebEngineView.Comm10E 105 x 241 mm, U.S. Common 10 Envelope
- \value WebEngineView.DLE 110 x 220 mm
- \value WebEngineView.Executive 7.5 x 10 inches, 190.5 x 254 mm
- \value WebEngineView.Folio 210 x 330 mm
- \value WebEngineView.Ledger 431.8 x 279.4 mm
- \value WebEngineView.Legal 8.5 x 14 inches, 215.9 x 355.6 mm
- \value WebEngineView.Letter 8.5 x 11 inches, 215.9 x 279.4 mm
- \value WebEngineView.Tabloid 279.4 x 431.8 mm
- \value WebEngineView.Custom Unknown, or a user defined size.
- \value WebEngineView.A10
- \value WebEngineView.A3Extra
- \value WebEngineView.A4Extra
- \value WebEngineView.A4Plus
- \value WebEngineView.A4Small
- \value WebEngineView.A5Extra
- \value WebEngineView.B5Extra
- \value WebEngineView.JisB0
- \value WebEngineView.JisB1
- \value WebEngineView.JisB2
- \value WebEngineView.JisB3
- \value WebEngineView.JisB4
- \value WebEngineView.JisB5
- \value WebEngineView.JisB6
- \value WebEngineView.JisB7
- \value WebEngineView.JisB8
- \value WebEngineView.JisB9
- \value WebEngineView.JisB10
- \value WebEngineView.AnsiA = \c Letter
- \value WebEngineView.AnsiB = \c Ledger
- \value WebEngineView.AnsiC
- \value WebEngineView.AnsiD
- \value WebEngineView.AnsiE
- \value WebEngineView.LegalExtra
- \value WebEngineView.LetterExtra
- \value WebEngineView.LetterPlus
- \value WebEngineView.LetterSmall
- \value WebEngineView.TabloidExtra
- \value WebEngineView.ArchA
- \value WebEngineView.ArchB
- \value WebEngineView.ArchC
- \value WebEngineView.ArchD
- \value WebEngineView.ArchE
- \value WebEngineView.Imperial7x9
- \value WebEngineView.Imperial8x10
- \value WebEngineView.Imperial9x11
- \value WebEngineView.Imperial9x12
- \value WebEngineView.Imperial10x11
- \value WebEngineView.Imperial10x13
- \value WebEngineView.Imperial10x14
- \value WebEngineView.Imperial12x11
- \value WebEngineView.Imperial15x11
- \value WebEngineView.ExecutiveStandard
- \value WebEngineView.Note
- \value WebEngineView.Quarto
- \value WebEngineView.Statement
- \value WebEngineView.SuperA
- \value WebEngineView.SuperB
- \value WebEngineView.Postcard
- \value WebEngineView.DoublePostcard
- \value WebEngineView.Prc16K
- \value WebEngineView.Prc32K
- \value WebEngineView.Prc32KBig
- \value WebEngineView.FanFoldUS
- \value WebEngineView.FanFoldGerman
- \value WebEngineView.FanFoldGermanLegal
- \value WebEngineView.EnvelopeB4
- \value WebEngineView.EnvelopeB5
- \value WebEngineView.EnvelopeB6
- \value WebEngineView.EnvelopeC0
- \value WebEngineView.EnvelopeC1
- \value WebEngineView.EnvelopeC2
- \value WebEngineView.EnvelopeC3
- \value WebEngineView.EnvelopeC4
- \value WebEngineView.EnvelopeC5 = \c C5E
- \value WebEngineView.EnvelopeC6
- \value WebEngineView.EnvelopeC65
- \value WebEngineView.EnvelopeC7
- \value WebEngineView.EnvelopeDL = \c DLE
- \value WebEngineView.Envelope9
- \value WebEngineView.Envelope10 = \c Comm10E
- \value WebEngineView.Envelope11
- \value WebEngineView.Envelope12
- \value WebEngineView.Envelope14
- \value WebEngineView.EnvelopeMonarch
- \value WebEngineView.EnvelopePersonal
- \value WebEngineView.EnvelopeChou3
- \value WebEngineView.EnvelopeChou4
- \value WebEngineView.EnvelopeInvite
- \value WebEngineView.EnvelopeItalian
- \value WebEngineView.EnvelopeKaku2
- \value WebEngineView.EnvelopeKaku3
- \value WebEngineView.EnvelopePrc1
- \value WebEngineView.EnvelopePrc2
- \value WebEngineView.EnvelopePrc3
- \value WebEngineView.EnvelopePrc4
- \value WebEngineView.EnvelopePrc5
- \value WebEngineView.EnvelopePrc6
- \value WebEngineView.EnvelopePrc7
- \value WebEngineView.EnvelopePrc8
- \value WebEngineView.EnvelopePrc9
- \value WebEngineView.EnvelopePrc10
- \value WebEngineView.EnvelopeYou4
- \value WebEngineView.LastPageSize = \c EnvelopeYou4
- \omitvalue NPageSize
- \omitvalue NPaperSize
-
- \sa WebEngineView::printToPdf()
-*/
-
-/*!
- \qmlproperty enumeration WebEngineView::PrintedPageOrientation
- \since QtWebEngine 1.3
-
- Describes the orientation of a PDF document that gets created from the WebEngineView's contents.
- The enumeration values are mapped from and must match QPageLayout::Orientation.
-
- \value WebEngineView.Portrait
- The document will be created using portrait orientation.
-
- \value WebEngineView.Landscape
- The document will be created using landscape orientation.
-
- \sa WebEngineView::printToPdf()
-*/
-
-/*!
\qmlproperty bool WebEngineView::activeFocusOnPress
\since QtWebEngine 1.2
@@ -1048,94 +857,3 @@
\sa toggleOn
*/
-
-/*!
- \qmlproperty bool WebEngineView::audioMuted
- \brief The state of whether the current page audio is muted.
- \since QtWebEngine 1.3
- \sa recentlyAudible
-*/
-
-/*!
- \qmlsignal WebEngineView::audioMutedChanged(bool muted)
- \since QtWebEngine 1.3
-
- This signal is emitted when the page's audio is (un)muted using audioMuted property.
- \note Not to be confused with a specific HTML5 audio / video element being muted.
-
- \sa audioMuted, recentlyAudibleChanged
-*/
-
-/*!
- \qmlproperty bool WebEngineView::recentlyAudible
- \brief Returns the current page's audible state (audio was recently played, or not).
- \since QtWebEngine 1.3
- \readonly
- \sa audioMuted, recentlyAudibleChanged
-*/
-
-/*!
- \qmlsignal WebEngineView::recentlyAudibleChanged(bool recentlyAudible)
- \since QtWebEngine 1.3
-
- This signal is emitted when the page's audible state is changed, due to audio
- being played or stopped.
-
- \note The signal is also emitted when the audioMuted property changes.
- Also if the audio is paused, this signal is emitted with an approximate \b{two-second
- delay}, from the moment the audio is paused.
-
- This signal is also emitted for Flash plugin audio.
-
- If a web page contains two videos that are started in sequence, this signal
- gets emitted only once, for the first video to generate sound. After both
- videos are stopped, the signal is emitted upon the last sound generated.
- This means that the signal is emitted both when any kind of sound is
- generated and when everything is completely silent within a web page,
- regardless of the number of audio streams.
-
- Spurious signal emissions might also happen. For example, when sound is
- stopped, this signal gets emitted first with a value of \c true, and then
- with a value of \c false. Further, when audio starts playing, the signal is
- emitted twice with a value of \c true.
-
- \sa recentlyAudible
-*/
-
-/*!
- \qmlmethod void WebEngineView::printToPdf(const QString &filePath, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
- \since QtWebEngine 1.3
-
- Prints the WebEngineView's current content to a PDF document and stores it under \a filePath. The document's size will be determined
- by the value of \a pageSizeId and its orientation will be determined using \a orientation.
-*/
-
-/*!
- \qmlmethod void WebEngineView::printToPdf(variant resultCallback, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
- \since QtWebEngine 1.3
-
- Prints the WebEngineView's current content to a PDF document and returns it in a byte array. The document's size will be determined
- by the value of \a pageSizeId and its orientation will be determined using \a orientation.
-
- The \a resultCallback must take a string parameter. This string will contain the document's data upon successful printing and an empty
- string otherwise.
-*/
-
-/*!
- \qmlmethod void WebEngineView::replaceMisspelledWord(const QString &replacement)
- \since QtWebEngine 1.3
-
- Replace the current misspelled word with \a replacement.
-*/
-
-/*!
- \qmlsignal void WebEngineView::wasRecentlyAudibleChanged(bool wasRecentlyAudible)
- \since QtWebEngine 1.3
-
- This signal is emitted when the page's audible state is changed, due to audio
- being played or stopped.
-
- \note The signal is also emitted when calling the setAudioMuted method.
- Also if the audio is paused, this signal is emitted with an approximate \b{2 second
- delay}, from the moment the audio is paused.
-*/
diff --git a/src/webengine/plugin/experimental/plugin.cpp b/src/webengine/plugin/experimental/plugin.cpp
index c45bcee43..35666017a 100644
--- a/src/webengine/plugin/experimental/plugin.cpp
+++ b/src/webengine/plugin/experimental/plugin.cpp
@@ -41,7 +41,6 @@
#include "qquickwebengineview_p.h"
#include "qquickwebengineview_p_p.h"
-#include "qquickwebenginecontextmenudata_p.h"
QT_BEGIN_NAMESPACE
@@ -70,8 +69,6 @@ public:
tr("Cannot create a separate instance of WebEngineViewExperimental"));
qmlRegisterUncreatableType<QQuickWebEngineViewport>(uri, 1, 0, "WebEngineViewport",
tr("Cannot create a separate instance of WebEngineViewport"));
- qmlRegisterUncreatableType<const QQuickWebEngineContextMenuData>(uri, 1, 0, "WebEngineContextMenuData",
- tr("Cannot create a separate instance of WebEngineContextMenuData"));
// Use the latest revision of QQuickWebEngineView when importing QtWebEngine.experimental 1.0
qmlRegisterRevision<QQuickWebEngineView, LATEST_WEBENGINEVIEW_REVISION>(uri, 1, 0);
diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp
index 4809c0708..f1f266b5c 100644
--- a/src/webengine/plugin/plugin.cpp
+++ b/src/webengine/plugin/plugin.cpp
@@ -43,7 +43,6 @@
#include "qquickwebenginecertificateerror_p.h"
#include "qquickwebenginedownloaditem_p.h"
#include "qquickwebenginehistory_p.h"
-#include "qquickwebenginefaviconprovider_p_p.h"
#include "qquickwebengineloadrequest_p.h"
#include "qquickwebenginenavigationrequest_p.h"
#include "qquickwebenginenewviewrequest_p.h"
@@ -64,12 +63,6 @@ class QtWebEnginePlugin : public QQmlExtensionPlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0")
public:
- virtual void initializeEngine(QQmlEngine *engine, const char *uri) Q_DECL_OVERRIDE
- {
- Q_UNUSED(uri);
- engine->addImageProvider(QQuickWebEngineFaviconProvider::identifier(), new QQuickWebEngineFaviconProvider);
- }
-
virtual void registerTypes(const char *uri) Q_DECL_OVERRIDE
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebEngine"));
@@ -80,22 +73,17 @@ public:
qmlRegisterType<QQuickWebEngineView, 1>(uri, 1, 1, "WebEngineView");
qmlRegisterType<QQuickWebEngineView, 2>(uri, 1, 2, "WebEngineView");
- qmlRegisterType<QQuickWebEngineView, 3>(uri, 1, 3, "WebEngineView");
qmlRegisterType<QQuickWebEngineProfile>(uri, 1, 1, "WebEngineProfile");
qmlRegisterType<QQuickWebEngineProfile, 1>(uri, 1, 2, "WebEngineProfile");
- qmlRegisterType<QQuickWebEngineProfile, 2>(uri, 1, 3, "WebEngineProfile");
qmlRegisterType<QQuickWebEngineScript>(uri, 1, 1, "WebEngineScript");
qmlRegisterUncreatableType<QQuickWebEngineCertificateError>(uri, 1, 1, "WebEngineCertificateError", tr("Cannot create separate instance of WebEngineCertificateError"));
qmlRegisterUncreatableType<QQuickWebEngineDownloadItem>(uri, 1, 1, "WebEngineDownloadItem",
tr("Cannot create a separate instance of WebEngineDownloadItem"));
qmlRegisterUncreatableType<QQuickWebEngineDownloadItem, 1>(uri, 1, 2, "WebEngineDownloadItem",
tr("Cannot create a separate instance of WebEngineDownloadItem"));
- qmlRegisterUncreatableType<QQuickWebEngineDownloadItem, 2>(uri, 1, 3, "WebEngineDownloadItem",
- tr("Cannot create a separate instance of WebEngineDownloadItem"));
qmlRegisterUncreatableType<QQuickWebEngineNewViewRequest>(uri, 1, 1, "WebEngineNewViewRequest", tr("Cannot create separate instance of WebEngineNewViewRequest"));
qmlRegisterUncreatableType<QQuickWebEngineSettings>(uri, 1, 1, "WebEngineSettings", tr("Cannot create a separate instance of WebEngineSettings"));
qmlRegisterUncreatableType<QQuickWebEngineSettings, 1>(uri, 1, 2, "WebEngineSettings", tr("Cannot create a separate instance of WebEngineSettings"));
- qmlRegisterUncreatableType<QQuickWebEngineSettings, 2>(uri, 1, 3, "WebEngineSettings", tr("Cannot create a separate instance of WebEngineSettings"));
qmlRegisterSingletonType<QQuickWebEngineSingleton>(uri, 1, 1, "WebEngine", webEngineSingletonProvider);
qmlRegisterUncreatableType<QQuickWebEngineHistory>(uri, 1, 1, "NavigationHistory",
tr("Cannot create a separate instance of NavigationHistory"));
diff --git a/src/webengine/plugin/plugin.pro b/src/webengine/plugin/plugin.pro
index 2fbadfc97..b6acc760f 100644
--- a/src/webengine/plugin/plugin.pro
+++ b/src/webengine/plugin/plugin.pro
@@ -1,7 +1,7 @@
CXX_MODULE = qml
TARGET = qtwebengineplugin
TARGETPATH = QtWebEngine
-IMPORT_VERSION = 1.3
+IMPORT_VERSION = 1.2
QT += webengine qml quick
QT_PRIVATE += webengine-private
diff --git a/src/webengine/plugin/plugins.qmltypes b/src/webengine/plugin/plugins.qmltypes
index 23ba77235..4fce34a21 100644
--- a/src/webengine/plugin/plugins.qmltypes
+++ b/src/webengine/plugin/plugins.qmltypes
@@ -4,24 +4,429 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -defaultplatform QtWebEngine 1.3'
+// 'qmlplugindump -nonrelocatable QtWebEngine 1.2'
Module {
- dependencies: [
- "Qt.labs.folderlistmodel 2.1",
- "Qt.labs.settings 1.0",
- "QtGraphicalEffects 1.0",
- "QtQml.Models 2.2",
- "QtQuick 2.6",
- "QtQuick.Controls 1.5",
- "QtQuick.Controls.Styles 1.4",
- "QtQuick.Dialogs 1.2",
- "QtQuick.Extras 1.4",
- "QtQuick.Extras.Private.CppUtils 1.1",
- "QtQuick.Layouts 1.1",
- "QtQuick.PrivateWidgets 1.1",
- "QtQuick.Window 2.2"
- ]
+ dependencies: []
+ Component {
+ name: "QAbstractItemModel"
+ prototype: "QObject"
+ Enum {
+ name: "LayoutChangeHint"
+ values: {
+ "NoLayoutChangeHint": 0,
+ "VerticalSortHint": 1,
+ "HorizontalSortHint": 2
+ }
+ }
+ Signal {
+ name: "dataChanged"
+ Parameter { name: "topLeft"; type: "QModelIndex" }
+ Parameter { name: "bottomRight"; type: "QModelIndex" }
+ Parameter { name: "roles"; type: "QVector<int>" }
+ }
+ Signal {
+ name: "dataChanged"
+ Parameter { name: "topLeft"; type: "QModelIndex" }
+ Parameter { name: "bottomRight"; type: "QModelIndex" }
+ }
+ Signal {
+ name: "headerDataChanged"
+ Parameter { name: "orientation"; type: "Qt::Orientation" }
+ Parameter { name: "first"; type: "int" }
+ Parameter { name: "last"; type: "int" }
+ }
+ Signal {
+ name: "layoutChanged"
+ Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" }
+ Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" }
+ }
+ Signal {
+ name: "layoutChanged"
+ Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" }
+ }
+ Signal { name: "layoutChanged" }
+ Signal {
+ name: "layoutAboutToBeChanged"
+ Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" }
+ Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" }
+ }
+ Signal {
+ name: "layoutAboutToBeChanged"
+ Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" }
+ }
+ Signal { name: "layoutAboutToBeChanged" }
+ Signal {
+ name: "rowsAboutToBeInserted"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ Parameter { name: "first"; type: "int" }
+ Parameter { name: "last"; type: "int" }
+ }
+ Signal {
+ name: "rowsInserted"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ Parameter { name: "first"; type: "int" }
+ Parameter { name: "last"; type: "int" }
+ }
+ Signal {
+ name: "rowsAboutToBeRemoved"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ Parameter { name: "first"; type: "int" }
+ Parameter { name: "last"; type: "int" }
+ }
+ Signal {
+ name: "rowsRemoved"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ Parameter { name: "first"; type: "int" }
+ Parameter { name: "last"; type: "int" }
+ }
+ Signal {
+ name: "columnsAboutToBeInserted"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ Parameter { name: "first"; type: "int" }
+ Parameter { name: "last"; type: "int" }
+ }
+ Signal {
+ name: "columnsInserted"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ Parameter { name: "first"; type: "int" }
+ Parameter { name: "last"; type: "int" }
+ }
+ Signal {
+ name: "columnsAboutToBeRemoved"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ Parameter { name: "first"; type: "int" }
+ Parameter { name: "last"; type: "int" }
+ }
+ Signal {
+ name: "columnsRemoved"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ Parameter { name: "first"; type: "int" }
+ Parameter { name: "last"; type: "int" }
+ }
+ Signal { name: "modelAboutToBeReset" }
+ Signal { name: "modelReset" }
+ Signal {
+ name: "rowsAboutToBeMoved"
+ Parameter { name: "sourceParent"; type: "QModelIndex" }
+ Parameter { name: "sourceStart"; type: "int" }
+ Parameter { name: "sourceEnd"; type: "int" }
+ Parameter { name: "destinationParent"; type: "QModelIndex" }
+ Parameter { name: "destinationRow"; type: "int" }
+ }
+ Signal {
+ name: "rowsMoved"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ Parameter { name: "start"; type: "int" }
+ Parameter { name: "end"; type: "int" }
+ Parameter { name: "destination"; type: "QModelIndex" }
+ Parameter { name: "row"; type: "int" }
+ }
+ Signal {
+ name: "columnsAboutToBeMoved"
+ Parameter { name: "sourceParent"; type: "QModelIndex" }
+ Parameter { name: "sourceStart"; type: "int" }
+ Parameter { name: "sourceEnd"; type: "int" }
+ Parameter { name: "destinationParent"; type: "QModelIndex" }
+ Parameter { name: "destinationColumn"; type: "int" }
+ }
+ Signal {
+ name: "columnsMoved"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ Parameter { name: "start"; type: "int" }
+ Parameter { name: "end"; type: "int" }
+ Parameter { name: "destination"; type: "QModelIndex" }
+ Parameter { name: "column"; type: "int" }
+ }
+ Method { name: "submit"; type: "bool" }
+ Method { name: "revert" }
+ Method {
+ name: "hasIndex"
+ type: "bool"
+ Parameter { name: "row"; type: "int" }
+ Parameter { name: "column"; type: "int" }
+ Parameter { name: "parent"; type: "QModelIndex" }
+ }
+ Method {
+ name: "hasIndex"
+ type: "bool"
+ Parameter { name: "row"; type: "int" }
+ Parameter { name: "column"; type: "int" }
+ }
+ Method {
+ name: "index"
+ type: "QModelIndex"
+ Parameter { name: "row"; type: "int" }
+ Parameter { name: "column"; type: "int" }
+ Parameter { name: "parent"; type: "QModelIndex" }
+ }
+ Method {
+ name: "index"
+ type: "QModelIndex"
+ Parameter { name: "row"; type: "int" }
+ Parameter { name: "column"; type: "int" }
+ }
+ Method {
+ name: "parent"
+ type: "QModelIndex"
+ Parameter { name: "child"; type: "QModelIndex" }
+ }
+ Method {
+ name: "sibling"
+ type: "QModelIndex"
+ Parameter { name: "row"; type: "int" }
+ Parameter { name: "column"; type: "int" }
+ Parameter { name: "idx"; type: "QModelIndex" }
+ }
+ Method {
+ name: "rowCount"
+ type: "int"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ }
+ Method { name: "rowCount"; type: "int" }
+ Method {
+ name: "columnCount"
+ type: "int"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ }
+ Method { name: "columnCount"; type: "int" }
+ Method {
+ name: "hasChildren"
+ type: "bool"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ }
+ Method { name: "hasChildren"; type: "bool" }
+ Method {
+ name: "data"
+ type: "QVariant"
+ Parameter { name: "index"; type: "QModelIndex" }
+ Parameter { name: "role"; type: "int" }
+ }
+ Method {
+ name: "data"
+ type: "QVariant"
+ Parameter { name: "index"; type: "QModelIndex" }
+ }
+ Method {
+ name: "setData"
+ type: "bool"
+ Parameter { name: "index"; type: "QModelIndex" }
+ Parameter { name: "value"; type: "QVariant" }
+ Parameter { name: "role"; type: "int" }
+ }
+ Method {
+ name: "setData"
+ type: "bool"
+ Parameter { name: "index"; type: "QModelIndex" }
+ Parameter { name: "value"; type: "QVariant" }
+ }
+ Method {
+ name: "headerData"
+ type: "QVariant"
+ Parameter { name: "section"; type: "int" }
+ Parameter { name: "orientation"; type: "Qt::Orientation" }
+ Parameter { name: "role"; type: "int" }
+ }
+ Method {
+ name: "headerData"
+ type: "QVariant"
+ Parameter { name: "section"; type: "int" }
+ Parameter { name: "orientation"; type: "Qt::Orientation" }
+ }
+ Method {
+ name: "fetchMore"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ }
+ Method {
+ name: "canFetchMore"
+ type: "bool"
+ Parameter { name: "parent"; type: "QModelIndex" }
+ }
+ Method {
+ name: "flags"
+ type: "Qt::ItemFlags"
+ Parameter { name: "index"; type: "QModelIndex" }
+ }
+ Method {
+ name: "match"
+ type: "QModelIndexList"
+ Parameter { name: "start"; type: "QModelIndex" }
+ Parameter { name: "role"; type: "int" }
+ Parameter { name: "value"; type: "QVariant" }
+ Parameter { name: "hits"; type: "int" }
+ Parameter { name: "flags"; type: "Qt::MatchFlags" }
+ }
+ Method {
+ name: "match"
+ type: "QModelIndexList"
+ Parameter { name: "start"; type: "QModelIndex" }
+ Parameter { name: "role"; type: "int" }
+ Parameter { name: "value"; type: "QVariant" }
+ Parameter { name: "hits"; type: "int" }
+ }
+ Method {
+ name: "match"
+ type: "QModelIndexList"
+ Parameter { name: "start"; type: "QModelIndex" }
+ Parameter { name: "role"; type: "int" }
+ Parameter { name: "value"; type: "QVariant" }
+ }
+ }
+ Component { name: "QAbstractListModel"; prototype: "QAbstractItemModel" }
+ Component {
+ name: "QQuickItem"
+ defaultProperty: "data"
+ prototype: "QObject"
+ Enum {
+ name: "TransformOrigin"
+ values: {
+ "TopLeft": 0,
+ "Top": 1,
+ "TopRight": 2,
+ "Left": 3,
+ "Center": 4,
+ "Right": 5,
+ "BottomLeft": 6,
+ "Bottom": 7,
+ "BottomRight": 8
+ }
+ }
+ Property { name: "parent"; type: "QQuickItem"; isPointer: true }
+ Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true }
+ Property { name: "x"; type: "double" }
+ Property { name: "y"; type: "double" }
+ Property { name: "z"; type: "double" }
+ Property { name: "width"; type: "double" }
+ Property { name: "height"; type: "double" }
+ Property { name: "opacity"; type: "double" }
+ Property { name: "enabled"; type: "bool" }
+ Property { name: "visible"; type: "bool" }
+ Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true }
+ Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true }
+ Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true }
+ Property { name: "state"; type: "string" }
+ Property { name: "childrenRect"; type: "QRectF"; isReadonly: true }
+ Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true }
+ Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true }
+ Property { name: "baselineOffset"; type: "double" }
+ Property { name: "clip"; type: "bool" }
+ Property { name: "focus"; type: "bool" }
+ Property { name: "activeFocus"; type: "bool"; isReadonly: true }
+ Property { name: "activeFocusOnTab"; revision: 1; type: "bool" }
+ Property { name: "rotation"; type: "double" }
+ Property { name: "scale"; type: "double" }
+ Property { name: "transformOrigin"; type: "TransformOrigin" }
+ Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true }
+ Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true }
+ Property { name: "smooth"; type: "bool" }
+ Property { name: "antialiasing"; type: "bool" }
+ Property { name: "implicitWidth"; type: "double" }
+ Property { name: "implicitHeight"; type: "double" }
+ Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true }
+ Signal {
+ name: "childrenRectChanged"
+ Parameter { type: "QRectF" }
+ }
+ Signal {
+ name: "baselineOffsetChanged"
+ Parameter { type: "double" }
+ }
+ Signal {
+ name: "stateChanged"
+ Parameter { type: "string" }
+ }
+ Signal {
+ name: "focusChanged"
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "activeFocusChanged"
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "activeFocusOnTabChanged"
+ revision: 1
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "parentChanged"
+ Parameter { type: "QQuickItem"; isPointer: true }
+ }
+ Signal {
+ name: "transformOriginChanged"
+ Parameter { type: "TransformOrigin" }
+ }
+ Signal {
+ name: "smoothChanged"
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "antialiasingChanged"
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "clipChanged"
+ Parameter { type: "bool" }
+ }
+ Signal {
+ name: "windowChanged"
+ revision: 1
+ Parameter { name: "window"; type: "QQuickWindow"; isPointer: true }
+ }
+ Method { name: "update" }
+ Method {
+ name: "grabToImage"
+ revision: 2
+ type: "bool"
+ Parameter { name: "callback"; type: "QJSValue" }
+ Parameter { name: "targetSize"; type: "QSize" }
+ }
+ Method {
+ name: "grabToImage"
+ revision: 2
+ type: "bool"
+ Parameter { name: "callback"; type: "QJSValue" }
+ }
+ Method {
+ name: "contains"
+ type: "bool"
+ Parameter { name: "point"; type: "QPointF" }
+ }
+ Method {
+ name: "mapFromItem"
+ Parameter { type: "QQmlV4Function"; isPointer: true }
+ }
+ Method {
+ name: "mapToItem"
+ Parameter { type: "QQmlV4Function"; isPointer: true }
+ }
+ Method { name: "forceActiveFocus" }
+ Method {
+ name: "forceActiveFocus"
+ Parameter { name: "reason"; type: "Qt::FocusReason" }
+ }
+ Method {
+ name: "nextItemInFocusChain"
+ revision: 1
+ type: "QQuickItem*"
+ Parameter { name: "forward"; type: "bool" }
+ }
+ Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" }
+ Method {
+ name: "childAt"
+ type: "QQuickItem*"
+ Parameter { name: "x"; type: "double" }
+ Parameter { name: "y"; type: "double" }
+ }
+ }
Component {
name: "QQuickWebEngineCertificateError"
prototype: "QObject"
@@ -57,13 +462,9 @@ Module {
Component {
name: "QQuickWebEngineDownloadItem"
prototype: "QObject"
- exports: [
- "QtWebEngine/WebEngineDownloadItem 1.1",
- "QtWebEngine/WebEngineDownloadItem 1.2",
- "QtWebEngine/WebEngineDownloadItem 1.3"
- ]
+ exports: ["QtWebEngine/WebEngineDownloadItem 1.1"]
isCreatable: false
- exportMetaObjectRevisions: [0, 1, 2]
+ exportMetaObjectRevisions: [0]
Enum {
name: "DownloadState"
values: {
@@ -74,24 +475,11 @@ Module {
"DownloadInterrupted": 4
}
}
- Enum {
- name: "SavePageFormat"
- values: {
- "UnknownSaveFormat": -1,
- "SingleHtmlSaveFormat": 0,
- "CompleteHtmlSaveFormat": 1,
- "MimeHtmlSaveFormat": 2
- }
- }
Property { name: "id"; type: "uint"; isReadonly: true }
Property { name: "state"; type: "DownloadState"; isReadonly: true }
- Property { name: "savePageFormat"; revision: 2; type: "SavePageFormat" }
Property { name: "totalBytes"; type: "qlonglong"; isReadonly: true }
Property { name: "receivedBytes"; type: "qlonglong"; isReadonly: true }
- Property { name: "mimeType"; revision: 1; type: "string"; isReadonly: true }
Property { name: "path"; type: "string" }
- Signal { name: "savePageFormatChanged"; revision: 2 }
- Signal { name: "mimeTypeChanged"; revision: 1 }
Method { name: "accept" }
Method { name: "cancel" }
}
@@ -187,16 +575,14 @@ Module {
prototype: "QObject"
exports: [
"QtWebEngine/WebEngineProfile 1.1",
- "QtWebEngine/WebEngineProfile 1.2",
- "QtWebEngine/WebEngineProfile 1.3"
+ "QtWebEngine/WebEngineProfile 1.2"
]
- exportMetaObjectRevisions: [0, 1, 2]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "HttpCacheType"
values: {
"MemoryHttpCache": 0,
- "DiskHttpCache": 1,
- "NoCache": 2
+ "DiskHttpCache": 1
}
}
Enum {
@@ -213,7 +599,7 @@ Module {
Property { name: "cachePath"; type: "string" }
Property { name: "httpUserAgent"; type: "string" }
Property { name: "httpCacheType"; type: "HttpCacheType" }
- Property { name: "httpAcceptLanguage"; revision: 1; type: "string" }
+ Property { name: "httpAcceptLanguage"; type: "string" }
Property { name: "persistentCookiesPolicy"; type: "PersistentCookiesPolicy" }
Property { name: "httpCacheMaximumSize"; type: "int" }
Signal { name: "httpAcceptLanguageChanged"; revision: 1 }
@@ -225,7 +611,7 @@ Module {
name: "downloadFinished"
Parameter { name: "download"; type: "QQuickWebEngineDownloadItem"; isPointer: true }
}
- Method { name: "clearHttpCache"; revision: 2 }
+ Method { name: "cookieStore"; revision: 1; type: "QWebEngineCookieStore*" }
}
Component {
name: "QQuickWebEngineScript"
@@ -309,11 +695,10 @@ Module {
prototype: "QObject"
exports: [
"QtWebEngine/WebEngineSettings 1.1",
- "QtWebEngine/WebEngineSettings 1.2",
- "QtWebEngine/WebEngineSettings 1.3"
+ "QtWebEngine/WebEngineSettings 1.2"
]
isCreatable: false
- exportMetaObjectRevisions: [0, 1, 2]
+ exportMetaObjectRevisions: [0, 1]
Property { name: "autoLoadImages"; type: "bool" }
Property { name: "javascriptEnabled"; type: "bool" }
Property { name: "javascriptCanOpenWindows"; type: "bool" }
@@ -328,17 +713,7 @@ Module {
Property { name: "pluginsEnabled"; type: "bool" }
Property { name: "fullScreenSupportEnabled"; revision: 1; type: "bool" }
Property { name: "defaultTextEncoding"; type: "string" }
- Property { name: "screenCaptureEnabled"; revision: 2; type: "bool" }
- Property { name: "webGLEnabled"; revision: 2; type: "bool" }
- Property { name: "accelerated2dCanvasEnabled"; revision: 2; type: "bool" }
- Property { name: "autoLoadIconsForPage"; revision: 2; type: "bool" }
- Property { name: "touchIconsEnabled"; revision: 2; type: "bool" }
Signal { name: "fullScreenSupportEnabledChanged"; revision: 1 }
- Signal { name: "screenCaptureEnabledChanged"; revision: 2 }
- Signal { name: "webGLEnabledChanged"; revision: 2 }
- Signal { name: "accelerated2dCanvasEnabledChanged"; revision: 2 }
- Signal { name: "autoLoadIconsForPageChanged"; revision: 2 }
- Signal { name: "touchIconsEnabledChanged"; revision: 2 }
}
Component {
name: "QQuickWebEngineSingleton"
@@ -363,10 +738,9 @@ Module {
exports: [
"QtWebEngine/WebEngineView 1.0",
"QtWebEngine/WebEngineView 1.1",
- "QtWebEngine/WebEngineView 1.2",
- "QtWebEngine/WebEngineView 1.3"
+ "QtWebEngine/WebEngineView 1.2"
]
- exportMetaObjectRevisions: [0, 1, 2, 3]
+ exportMetaObjectRevisions: [0, 1, 2]
Enum {
name: "NavigationRequestAction"
values: {
@@ -457,9 +831,7 @@ Module {
"InspectElement": 26,
"ExitFullScreen": 27,
"RequestClose": 28,
- "Unselect": 29,
- "SavePage": 30,
- "WebActionCount": 31
+ "WebActionCount": 29
}
}
Enum {
@@ -486,145 +858,6 @@ Module {
"FindCaseSensitively": 2
}
}
- Enum {
- name: "PrintedPageSizeId"
- values: {
- "A4": 0,
- "B5": 1,
- "Letter": 2,
- "Legal": 3,
- "Executive": 4,
- "A0": 5,
- "A1": 6,
- "A2": 7,
- "A3": 8,
- "A5": 9,
- "A6": 10,
- "A7": 11,
- "A8": 12,
- "A9": 13,
- "B0": 14,
- "B1": 15,
- "B10": 16,
- "B2": 17,
- "B3": 18,
- "B4": 19,
- "B6": 20,
- "B7": 21,
- "B8": 22,
- "B9": 23,
- "C5E": 24,
- "Comm10E": 25,
- "DLE": 26,
- "Folio": 27,
- "Ledger": 28,
- "Tabloid": 29,
- "Custom": 30,
- "A10": 31,
- "A3Extra": 32,
- "A4Extra": 33,
- "A4Plus": 34,
- "A4Small": 35,
- "A5Extra": 36,
- "B5Extra": 37,
- "JisB0": 38,
- "JisB1": 39,
- "JisB2": 40,
- "JisB3": 41,
- "JisB4": 42,
- "JisB5": 43,
- "JisB6": 44,
- "JisB7": 45,
- "JisB8": 46,
- "JisB9": 47,
- "JisB10": 48,
- "AnsiC": 49,
- "AnsiD": 50,
- "AnsiE": 51,
- "LegalExtra": 52,
- "LetterExtra": 53,
- "LetterPlus": 54,
- "LetterSmall": 55,
- "TabloidExtra": 56,
- "ArchA": 57,
- "ArchB": 58,
- "ArchC": 59,
- "ArchD": 60,
- "ArchE": 61,
- "Imperial7x9": 62,
- "Imperial8x10": 63,
- "Imperial9x11": 64,
- "Imperial9x12": 65,
- "Imperial10x11": 66,
- "Imperial10x13": 67,
- "Imperial10x14": 68,
- "Imperial12x11": 69,
- "Imperial15x11": 70,
- "ExecutiveStandard": 71,
- "Note": 72,
- "Quarto": 73,
- "Statement": 74,
- "SuperA": 75,
- "SuperB": 76,
- "Postcard": 77,
- "DoublePostcard": 78,
- "Prc16K": 79,
- "Prc32K": 80,
- "Prc32KBig": 81,
- "FanFoldUS": 82,
- "FanFoldGerman": 83,
- "FanFoldGermanLegal": 84,
- "EnvelopeB4": 85,
- "EnvelopeB5": 86,
- "EnvelopeB6": 87,
- "EnvelopeC0": 88,
- "EnvelopeC1": 89,
- "EnvelopeC2": 90,
- "EnvelopeC3": 91,
- "EnvelopeC4": 92,
- "EnvelopeC6": 93,
- "EnvelopeC65": 94,
- "EnvelopeC7": 95,
- "Envelope9": 96,
- "Envelope11": 97,
- "Envelope12": 98,
- "Envelope14": 99,
- "EnvelopeMonarch": 100,
- "EnvelopePersonal": 101,
- "EnvelopeChou3": 102,
- "EnvelopeChou4": 103,
- "EnvelopeInvite": 104,
- "EnvelopeItalian": 105,
- "EnvelopeKaku2": 106,
- "EnvelopeKaku3": 107,
- "EnvelopePrc1": 108,
- "EnvelopePrc2": 109,
- "EnvelopePrc3": 110,
- "EnvelopePrc4": 111,
- "EnvelopePrc5": 112,
- "EnvelopePrc6": 113,
- "EnvelopePrc7": 114,
- "EnvelopePrc8": 115,
- "EnvelopePrc9": 116,
- "EnvelopePrc10": 117,
- "EnvelopeYou4": 118,
- "LastPageSize": 118,
- "NPageSize": 118,
- "NPaperSize": 118,
- "AnsiA": 2,
- "AnsiB": 28,
- "EnvelopeC5": 24,
- "EnvelopeDL": 26,
- "Envelope10": 25
- }
- }
- Enum {
- name: "PrintedPageOrientation"
- values: {
- "Portrait": 0,
- "Landscape": 1
- }
- }
Property { name: "url"; type: "QUrl" }
Property { name: "icon"; type: "QUrl"; isReadonly: true }
Property { name: "loading"; type: "bool"; isReadonly: true }
@@ -659,11 +892,6 @@ Module {
}
Property { name: "activeFocusOnPress"; revision: 2; type: "bool" }
Property { name: "backgroundColor"; revision: 2; type: "QColor" }
- Property { name: "contentsSize"; revision: 3; type: "QSizeF"; isReadonly: true }
- Property { name: "scrollPosition"; revision: 3; type: "QPointF"; isReadonly: true }
- Property { name: "audioMuted"; revision: 3; type: "bool" }
- Property { name: "recentlyAudible"; revision: 3; type: "bool"; isReadonly: true }
- Property { name: "webChannelWorld"; revision: 3; type: "uint" }
Signal {
name: "loadingChanged"
Parameter { name: "loadRequest"; type: "QQuickWebEngineLoadRequest"; isPointer: true }
@@ -725,31 +953,6 @@ Module {
Parameter { name: "exitCode"; type: "int" }
}
Signal { name: "windowCloseRequested"; revision: 2 }
- Signal {
- name: "contentsSizeChanged"
- revision: 3
- Parameter { name: "size"; type: "QSizeF" }
- }
- Signal {
- name: "scrollPositionChanged"
- revision: 3
- Parameter { name: "position"; type: "QPointF" }
- }
- Signal {
- name: "audioMutedChanged"
- revision: 3
- Parameter { name: "muted"; type: "bool" }
- }
- Signal {
- name: "recentlyAudibleChanged"
- revision: 3
- Parameter { name: "recentlyAudible"; type: "bool" }
- }
- Signal {
- name: "webChannelWorldChanged"
- revision: 3
- Parameter { type: "uint" }
- }
Method {
name: "runJavaScript"
Parameter { type: "string" }
@@ -760,19 +963,6 @@ Module {
Parameter { type: "string" }
}
Method {
- name: "runJavaScript"
- revision: 3
- Parameter { type: "string" }
- Parameter { name: "worldId"; type: "uint" }
- Parameter { type: "QJSValue" }
- }
- Method {
- name: "runJavaScript"
- revision: 3
- Parameter { type: "string" }
- Parameter { name: "worldId"; type: "uint" }
- }
- Method {
name: "loadHtml"
Parameter { name: "html"; type: "string" }
Parameter { name: "baseUrl"; type: "QUrl" }
@@ -827,41 +1017,5 @@ Module {
revision: 2
Parameter { name: "action"; type: "WebAction" }
}
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "filePath"; type: "string" }
- Parameter { name: "pageSizeId"; type: "PrintedPageSizeId" }
- Parameter { name: "orientation"; type: "PrintedPageOrientation" }
- }
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "filePath"; type: "string" }
- Parameter { name: "pageSizeId"; type: "PrintedPageSizeId" }
- }
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "filePath"; type: "string" }
- }
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "callback"; type: "QJSValue" }
- Parameter { name: "pageSizeId"; type: "PrintedPageSizeId" }
- Parameter { name: "orientation"; type: "PrintedPageOrientation" }
- }
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "callback"; type: "QJSValue" }
- Parameter { name: "pageSizeId"; type: "PrintedPageSizeId" }
- }
- Method {
- name: "printToPdf"
- revision: 3
- Parameter { name: "callback"; type: "QJSValue" }
- }
}
}
diff --git a/src/webengine/ui/ColorDialog.qml b/src/webengine/ui/ColorDialog.qml
deleted file mode 100644
index 04af954b9..000000000
--- a/src/webengine/ui/ColorDialog.qml
+++ /dev/null
@@ -1,50 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick.Dialogs 1.2
-
-ColorDialog {
- id: colorDialog
-
- signal selectedColor(var color)
-
- onAccepted: {
- selectedColor(colorDialog.currentColor)
- }
-}
diff --git a/src/webengine/ui/ui.pro b/src/webengine/ui/ui.pro
index 249d7dcfd..28ea691b2 100644
--- a/src/webengine/ui/ui.pro
+++ b/src/webengine/ui/ui.pro
@@ -5,7 +5,6 @@ QML_FILES += \
AuthenticationDialog.qml \
# JS Dialogs
AlertDialog.qml \
- ColorDialog.qml \
ConfirmDialog.qml \
FilePicker.qml \
PromptDialog.qml \
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp
index 6ff12b53f..c870a12de 100644
--- a/src/webengine/ui_delegates_manager.cpp
+++ b/src/webengine/ui_delegates_manager.cpp
@@ -328,43 +328,6 @@ void UIDelegatesManager::showDialog(QSharedPointer<JavaScriptDialogController> d
QMetaObject::invokeMethod(dialog, "open");
}
-void UIDelegatesManager::showColorDialog(QSharedPointer<ColorChooserController> controller)
-{
- if (!ensureComponentLoaded(ColorDialog)) {
- // Let the controller know it couldn't be loaded
- qWarning("Failed to load dialog, rejecting.");
- controller->reject();
- return;
- }
-
- QQmlContext *context = qmlContext(m_view);
- QObject *colorDialog = colorDialogComponent->beginCreate(context);
- if (QQuickItem* item = qobject_cast<QQuickItem*>(colorDialog))
- item->setParentItem(m_view);
- colorDialog->setParent(m_view);
-
- if (controller->initialColor().isValid())
- colorDialog->setProperty("color", controller->initialColor());
-
- QQmlProperty selectedColorSignal(colorDialog, QStringLiteral("onSelectedColor"));
- CHECK_QML_SIGNAL_PROPERTY(selectedColorSignal, colorDialogComponent->url());
- QQmlProperty rejectedSignal(colorDialog, QStringLiteral("onRejected"));
- CHECK_QML_SIGNAL_PROPERTY(rejectedSignal, colorDialogComponent->url());
-
- static int acceptIndex = controller->metaObject()->indexOfSlot("accept(QVariant)");
- QObject::connect(colorDialog, selectedColorSignal.method(), controller.data(), controller->metaObject()->method(acceptIndex));
- static int rejectIndex = controller->metaObject()->indexOfSlot("reject()");
- QObject::connect(colorDialog, rejectedSignal.method(), controller.data(), controller->metaObject()->method(rejectIndex));
-
- // delete later
- static int deleteLaterIndex = colorDialog->metaObject()->indexOfSlot("deleteLater()");
- QObject::connect(colorDialog, selectedColorSignal.method(), colorDialog, colorDialog->metaObject()->method(deleteLaterIndex));
- QObject::connect(colorDialog, rejectedSignal.method(), colorDialog, colorDialog->metaObject()->method(deleteLaterIndex));
-
- colorDialogComponent->completeCreate();
- QMetaObject::invokeMethod(colorDialog, "open");
-}
-
void UIDelegatesManager::showDialog(QSharedPointer<AuthenticationDialogController> dialogController)
{
Q_ASSERT(!dialogController.isNull());
diff --git a/src/webengine/ui_delegates_manager.h b/src/webengine/ui_delegates_manager.h
index b63aa91f1..78647768b 100644
--- a/src/webengine/ui_delegates_manager.h
+++ b/src/webengine/ui_delegates_manager.h
@@ -54,7 +54,6 @@
F(MenuItem, menuItem) SEPARATOR \
F(MenuSeparator, menuSeparator) SEPARATOR \
F(AlertDialog, alertDialog) SEPARATOR \
- F(ColorDialog, colorDialog) SEPARATOR \
F(ConfirmDialog, confirmDialog) SEPARATOR \
F(PromptDialog, promptDialog) SEPARATOR \
F(FilePicker, filePicker) SEPARATOR \
@@ -108,7 +107,6 @@ public:
void addMenuSeparator(QObject *menu);
QObject *addMenu(QObject *parentMenu, const QString &title, const QPoint &pos = QPoint());
QQmlContext *creationContextForComponent(QQmlComponent *);
- void showColorDialog(QSharedPointer<ColorChooserController>);
void showDialog(QSharedPointer<JavaScriptDialogController>);
void showDialog(QSharedPointer<AuthenticationDialogController>);
void showFilePicker(FilePickerController *controller);
diff --git a/src/webengine/webengine.pro b/src/webengine/webengine.pro
index 236881958..8f802d5c4 100644
--- a/src/webengine/webengine.pro
+++ b/src/webengine/webengine.pro
@@ -12,10 +12,8 @@ INCLUDEPATH += $$PWD api ../core ../core/api
SOURCES = \
api/qquickwebenginecertificateerror.cpp \
- api/qquickwebenginecontextmenudata.cpp \
api/qquickwebenginedownloaditem.cpp \
api/qquickwebenginehistory.cpp \
- api/qquickwebenginefaviconprovider.cpp \
api/qquickwebengineloadrequest.cpp \
api/qquickwebenginenavigationrequest.cpp \
api/qquickwebenginenewviewrequest.cpp \
@@ -33,11 +31,9 @@ HEADERS = \
api/qtwebengineglobal.h \
api/qtwebengineglobal_p.h \
api/qquickwebenginecertificateerror_p.h \
- api/qquickwebenginecontextmenudata_p.h \
api/qquickwebenginedownloaditem_p.h \
api/qquickwebenginedownloaditem_p_p.h \
api/qquickwebenginehistory_p.h \
- api/qquickwebenginefaviconprovider_p_p.h \
api/qquickwebengineloadrequest_p.h \
api/qquickwebenginenavigationrequest_p.h \
api/qquickwebenginenewviewrequest_p.h \
@@ -59,8 +55,4 @@ isQMLTestSupportApiEnabled() {
DEFINES += ENABLE_QML_TESTSUPPORT_API
}
-!contains(WEBENGINE_CONFIG, no_spellcheck) {
- DEFINES += ENABLE_SPELLCHECK
-}
-
load(qt_module)
diff --git a/src/webenginewidgets/api/qwebenginecertificateerror.cpp b/src/webenginewidgets/api/qwebenginecertificateerror.cpp
index 289bb7ec0..d6bffdac6 100644
--- a/src/webenginewidgets/api/qwebenginecertificateerror.cpp
+++ b/src/webenginewidgets/api/qwebenginecertificateerror.cpp
@@ -103,7 +103,6 @@ QWebEngineCertificateError::~QWebEngineCertificateError()
\value CertificateNonUniqueName The host name specified in the certificate is not unique.
\value CertificateWeakKey The certificate contains a weak key.
\value CertificateNameConstraintViolation The certificate claimed DNS names that are in violation of name constraints.
- \value CertificateValidityTooLong The certificate has a validity period that is too long. (Added in Qt 5.7)
*/
/*!
diff --git a/src/webenginewidgets/api/qwebenginecertificateerror.h b/src/webenginewidgets/api/qwebenginecertificateerror.h
index 7cb6341bc..0aa76d040 100644
--- a/src/webenginewidgets/api/qwebenginecertificateerror.h
+++ b/src/webenginewidgets/api/qwebenginecertificateerror.h
@@ -69,7 +69,7 @@ public:
CertificateNonUniqueName = -210,
CertificateWeakKey = -211,
CertificateNameConstraintViolation = -212,
- CertificateValidityTooLong = -213,
+// CertificateValidityTooLong = -213,
};
Error error() const;
diff --git a/src/webenginewidgets/api/qwebenginecontextmenudata.cpp b/src/webenginewidgets/api/qwebenginecontextmenudata.cpp
deleted file mode 100644
index 4d72071e5..000000000
--- a/src/webenginewidgets/api/qwebenginecontextmenudata.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwebenginecontextmenudata.h"
-
-#include "web_contents_adapter_client.h"
-
-QT_BEGIN_NAMESPACE
-
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeNone, QWebEngineContextMenuData::MediaTypeNone)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeImage, QWebEngineContextMenuData::MediaTypeImage)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeAudio, QWebEngineContextMenuData::MediaTypeAudio)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeVideo, QWebEngineContextMenuData::MediaTypeVideo)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeCanvas, QWebEngineContextMenuData::MediaTypeCanvas)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeFile, QWebEngineContextMenuData::MediaTypeFile)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypePlugin, QWebEngineContextMenuData::MediaTypePlugin)
-
-/*!
- \class QWebEngineContextMenuData
- \since 5.7
- \brief The QWebEngineContextMenuData class provides context data for populating or extending a context menu with actions.
-
- \inmodule QtWebEngineWidgets
-
- QWebEngineContextMenuData is returned by QWebEnginePage::contextMenuData() after a context menu event,
- and contains information about where the context menu event took place. This is also in the context
- in which any context specific QWebEnginePage::WebAction will be performed.
-*/
-
-/*!
- \enum QWebEngineContextMenuData::MediaType
-
- This enum describes the media type of the context if any.
-
- \value MediaTypeNone The context is not a media type.
- \value MediaTypeImage The context is an image element.
- \value MediaTypeVideo The context is a video element.
- \value MediaTypeAudio The context is an audio element.
- \value MediaTypeCanvas The context is a canvas element.
- \value MediaTypeFile The context is a file.
- \value MediaTypePlugin The context is a plugin element.
-*/
-
-/*!
- Constructs null context menu data.
-*/
-QWebEngineContextMenuData::QWebEngineContextMenuData() : d(nullptr)
-{
-}
-
-/*!
- Constructs context menu data from \a other.
-*/
-QWebEngineContextMenuData::QWebEngineContextMenuData(const QWebEngineContextMenuData &other)
-{
- d = new QtWebEngineCore::WebEngineContextMenuData(*other.d);
-}
-
-/*!
- Assigns the \a other context menu data to this.
-*/
-QWebEngineContextMenuData &QWebEngineContextMenuData::operator=(const QWebEngineContextMenuData &other)
-{
- delete d;
- d = new QtWebEngineCore::WebEngineContextMenuData(*other.d);
- return *this;
-}
-
-/*!
- Destroys the context menu data.
-*/
-QWebEngineContextMenuData::~QWebEngineContextMenuData()
-{
- delete d;
-}
-
-/*!
- Returns \c true if the context data is valid; otherwise returns \c false.
-*/
-bool QWebEngineContextMenuData::isValid() const
-{
- return d;
-}
-
-/*!
- Resets the context data, making it invalid.
- \internal
-
- \sa isValid()
-*/
-void QWebEngineContextMenuData::reset()
-{
- delete d;
- d = nullptr;
-}
-
-/*!
- Returns the position of the context, usually the mouse position where the context menu event was triggered.
-*/
-QPoint QWebEngineContextMenuData::position() const
-{
- return d ? d->pos : QPoint();
-}
-
-/*!
- Returns the text of a link if the context is a link.
-*/
-QString QWebEngineContextMenuData::linkText() const
-{
- return d ? d->linkText : QString();
-}
-
-/*!
- Returns the URL of a link if the context is a link.
-*/
-QUrl QWebEngineContextMenuData::linkUrl() const
-{
- return d ? d->linkUrl : QUrl();
-}
-
-/*!
- Returns the selected text of the context.
-*/
-QString QWebEngineContextMenuData::selectedText() const
-{
- return d ? d->selectedText : QString();
-}
-
-/*!
- If the context is a media element, returns the URL of that media.
-*/
-QUrl QWebEngineContextMenuData::mediaUrl() const
-{
- return d ? d->mediaUrl : QUrl();
-}
-
-/*!
- Returns the type of the media element or \c MediaTypeNone if the context is not a media element.
-*/
-QWebEngineContextMenuData::MediaType QWebEngineContextMenuData::mediaType() const
-{
- return d ? static_cast<QWebEngineContextMenuData::MediaType>(d->mediaType) : MediaTypeNone;
-}
-
-/*!
- Returns \c true if the content is editable by the user; otherwise returns \c false.
-*/
-bool QWebEngineContextMenuData::isContentEditable() const
-{
- return d ? d->isEditable : false;
-}
-
-/*!
- \internal
-*/
-QWebEngineContextMenuData &QWebEngineContextMenuData::operator=(const QWebEngineContextDataPrivate &priv)
-{
- delete d;
- d = new QtWebEngineCore::WebEngineContextMenuData(priv);
- return *this;
-}
-
-QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebenginecontextmenudata.h b/src/webenginewidgets/api/qwebenginecontextmenudata.h
deleted file mode 100644
index 8e85fee16..000000000
--- a/src/webenginewidgets/api/qwebenginecontextmenudata.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINECONTEXTDATA_H
-#define QWEBENGINECONTEXTDATA_H
-
-#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
-#include <QtCore/qpoint.h>
-#include <QtCore/qstring.h>
-#include <QtCore/qurl.h>
-
-namespace QtWebEngineCore {
-class WebEngineContextMenuData;
-}
-
-QT_BEGIN_NAMESPACE
-
-class QWEBENGINEWIDGETS_EXPORT QWebEngineContextMenuData {
-public:
- QWebEngineContextMenuData();
- QWebEngineContextMenuData(const QWebEngineContextMenuData &other);
- QWebEngineContextMenuData &operator=(const QWebEngineContextMenuData &other);
- ~QWebEngineContextMenuData();
-
- enum MediaType {
- MediaTypeNone,
- MediaTypeImage,
- MediaTypeVideo,
- MediaTypeAudio,
- MediaTypeCanvas,
- MediaTypeFile,
- MediaTypePlugin
- };
- bool isValid() const;
-
- QPoint position() const;
- QString selectedText() const;
- QString linkText() const;
- QUrl linkUrl() const;
- QUrl mediaUrl() const;
- MediaType mediaType() const;
- bool isContentEditable() const;
-
-private:
- void reset();
- typedef QtWebEngineCore::WebEngineContextMenuData QWebEngineContextDataPrivate;
- QWebEngineContextMenuData &operator=(const QWebEngineContextDataPrivate &priv);
- const QWebEngineContextDataPrivate *d;
-
- friend class QWebEnginePagePrivate;
- friend class QWebEnginePage;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINECONTEXTDATA_H
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.cpp b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
index bfb0dd0e8..a455f011f 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem.cpp
+++ b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
@@ -79,7 +79,6 @@ QWebEngineDownloadItemPrivate::QWebEngineDownloadItemPrivate(QWebEngineProfilePr
, downloadFinished(false)
, downloadId(-1)
, downloadState(QWebEngineDownloadItem::DownloadCancelled)
- , savePageFormat(QWebEngineDownloadItem::MimeHtmlSaveFormat)
, downloadUrl(url)
, totalBytes(-1)
, receivedBytes(0)
@@ -204,20 +203,6 @@ quint32 QWebEngineDownloadItem::id() const
*/
/*!
- \enum QWebEngineDownloadItem::SavePageFormat
- \since 5.7
-
- This enum describes the format that is used to save a web page.
-
- \value UnknownSaveFormat This is not a request for downloading a complete web page.
- \value SingleHtmlSaveFormat The page is saved as a single HTML page. Resources such as images
- are not saved.
- \value CompleteHtmlSaveFormat The page is saved as a complete HTML page, for example a directory
- containing the single HTML page and the resources.
- \value MimeHtmlSaveFormat The page is saved as a complete web page in the MIME HTML format.
-*/
-
-/*!
Returns the download item's current state.
\sa QWebEngineDownloadItem::DownloadState
@@ -318,30 +303,6 @@ bool QWebEngineDownloadItem::isFinished() const
return d->downloadFinished;
}
-/*!
- Returns the format the web page will be saved in if this is a download request for a web page.
- \since 5.7
-
- \sa setSavePageFormat()
-*/
-QWebEngineDownloadItem::SavePageFormat QWebEngineDownloadItem::savePageFormat() const
-{
- Q_D(const QWebEngineDownloadItem);
- return d->savePageFormat;
-}
-
-/*!
- Sets the \a format the web page will be saved in if this is a download request for a web page.
- \since 5.7
-
- \sa savePageFormat()
-*/
-void QWebEngineDownloadItem::setSavePageFormat(QWebEngineDownloadItem::SavePageFormat format)
-{
- Q_D(QWebEngineDownloadItem);
- d->savePageFormat = format;
-}
-
QWebEngineDownloadItem::QWebEngineDownloadItem(QWebEngineDownloadItemPrivate *p, QObject *parent)
: QObject(parent)
, d_ptr(p)
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.h b/src/webenginewidgets/api/qwebenginedownloaditem.h
index 80b5c06c5..df5a53dfd 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem.h
+++ b/src/webenginewidgets/api/qwebenginedownloaditem.h
@@ -64,14 +64,6 @@ public:
};
Q_ENUM(DownloadState)
- enum SavePageFormat {
- UnknownSaveFormat = -1,
- SingleHtmlSaveFormat,
- CompleteHtmlSaveFormat,
- MimeHtmlSaveFormat
- };
- Q_ENUM(SavePageFormat)
-
quint32 id() const;
DownloadState state() const;
qint64 totalBytes() const;
@@ -81,8 +73,6 @@ public:
QString path() const;
void setPath(QString path);
bool isFinished() const;
- SavePageFormat savePageFormat() const;
- void setSavePageFormat(SavePageFormat format);
public Q_SLOTS:
void accept();
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem_p.h b/src/webenginewidgets/api/qwebenginedownloaditem_p.h
index ddb3b443a..df97ded52 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem_p.h
+++ b/src/webenginewidgets/api/qwebenginedownloaditem_p.h
@@ -71,7 +71,6 @@ public:
bool downloadFinished;
quint32 downloadId;
QWebEngineDownloadItem::DownloadState downloadState;
- QWebEngineDownloadItem::SavePageFormat savePageFormat;
QString downloadPath;
const QUrl downloadUrl;
QString mimeType;
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index e84c91bd7..effe5d2c6 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -44,7 +44,6 @@
#include "browser_context_adapter.h"
#include "certificate_error_controller.h"
#include "color_chooser_controller.h"
-#include "favicon_manager.h"
#include "file_picker_controller.h"
#include "javascript_dialog_controller.h"
#include "qwebenginefullscreenrequest.h"
@@ -68,7 +67,6 @@
#include <QApplication>
#include <QAuthenticator>
#include <QClipboard>
-#include <QColorDialog>
#include <QContextMenuEvent>
#include <QFileDialog>
#include <QKeyEvent>
@@ -94,9 +92,8 @@ static QWebEnginePage::WebWindowType toWindowType(WebContentsAdapterClient::Wind
{
switch (disposition) {
case WebContentsAdapterClient::NewForegroundTabDisposition:
- return QWebEnginePage::WebBrowserTab;
case WebContentsAdapterClient::NewBackgroundTabDisposition:
- return QWebEnginePage::WebBrowserBackgroundTab;
+ return QWebEnginePage::WebBrowserTab;
case WebContentsAdapterClient::NewPopupDisposition:
return QWebEnginePage::WebDialog;
case WebContentsAdapterClient::NewWindowDisposition:
@@ -139,7 +136,6 @@ QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile *_profile)
, m_backgroundColor(Qt::white)
, fullscreenMode(false)
, webChannel(nullptr)
- , webChannelWorldId(QWebEngineScript::MainWorld)
{
memset(actions, 0, sizeof(actions));
}
@@ -184,7 +180,6 @@ void QWebEnginePagePrivate::iconChanged(const QUrl &url)
return;
iconUrl = url;
Q_EMIT q->iconUrlChanged(iconUrl);
- Q_EMIT q->iconChanged(adapter->faviconManager()->getIcon());
}
void QWebEnginePagePrivate::loadProgressChanged(int progress)
@@ -205,10 +200,8 @@ void QWebEnginePagePrivate::selectionChanged()
Q_EMIT q->selectionChanged();
}
-void QWebEnginePagePrivate::recentlyAudibleChanged(bool recentlyAudible)
+void QWebEnginePagePrivate::recentlyAudibleChanged(bool /*recentlyAudible*/)
{
- Q_Q(QWebEnginePage);
- Q_EMIT q->recentlyAudibleChanged(recentlyAudible);
}
QRectF QWebEnginePagePrivate::viewportRect() const
@@ -342,8 +335,7 @@ void QWebEnginePagePrivate::adoptNewWindowImpl(QWebEnginePage *newPage,
// If the constructor of the QWebEnginePage descendant set a web channel,
// set it on the new adapter.
- newWebContents->setWebChannel(newPage->d_func()->webChannel
- , newPage->d_func()->webChannelWorldId);
+ newWebContents->setWebChannel(newPage->d_func()->webChannel, QWebEngineScript::MainWorld);
// Page has finished the adoption process.
newPage->d_func()->m_isBeingAdopted = false;
@@ -385,9 +377,9 @@ void QWebEnginePagePrivate::didFindText(quint64 requestId, int matchCount)
m_callbacks.invoke(requestId, matchCount > 0);
}
-void QWebEnginePagePrivate::didPrintPage(quint64 requestId, const QByteArray &result)
+void QWebEnginePagePrivate::didPrintPage(quint64 /*requestId*/, const QByteArray &/*result*/)
{
- m_callbacks.invoke(requestId, result);
+ Q_UNREACHABLE();
}
void QWebEnginePagePrivate::passOnFocus(bool reverse)
@@ -418,16 +410,7 @@ void QWebEnginePagePrivate::authenticationRequired(QSharedPointer<Authentication
void QWebEnginePagePrivate::showColorDialog(QSharedPointer<ColorChooserController> controller)
{
- QColorDialog *dialog = new QColorDialog(controller.data()->initialColor(), view);
-
- QColorDialog::connect(dialog, SIGNAL(colorSelected(QColor)), controller.data(), SLOT(accept(QColor)));
- QColorDialog::connect(dialog, SIGNAL(rejected()), controller.data(), SLOT(reject()));
-
- // Delete when done
- QColorDialog::connect(dialog, SIGNAL(colorSelected(QColor)), dialog, SLOT(deleteLater()));
- QColorDialog::connect(dialog, SIGNAL(rejected()), dialog, SLOT(deleteLater()));
-
- dialog->open();
+ controller->reject();
}
void QWebEnginePagePrivate::runMediaAccessPermissionRequest(const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags requestFlags)
@@ -525,21 +508,17 @@ void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input)
adapter = std::move(newWebContents);
adapter->initialize(this);
if (webChannel)
- adapter->setWebChannel(webChannel, webChannelWorldId);
+ adapter->setWebChannel(webChannel, QWebEngineScript::MainWorld);
scriptCollection.d->rebindToContents(adapter);
}
}
-void QWebEnginePagePrivate::updateScrollPosition(const QPointF &position)
+void QWebEnginePagePrivate::updateScrollPosition(const QPointF &/*position*/)
{
- Q_Q(QWebEnginePage);
- Q_EMIT q->scrollPositionChanged(position);
}
-void QWebEnginePagePrivate::updateContentsSize(const QSizeF &size)
+void QWebEnginePagePrivate::updateContentsSize(const QSizeF &/*size*/)
{
- Q_Q(QWebEnginePage);
- Q_EMIT q->contentsSizeChanged(size);
}
void QWebEnginePagePrivate::setFullScreenMode(bool fullscreen)
@@ -616,56 +595,12 @@ QWebEnginePage::QWebEnginePage(QObject* parent)
*/
/*!
- \property QWebEnginePage::scrollPosition
- \since 5.7
-
- \brief The scroll position of the page contents.
-*/
-
-/*!
- \property QWebEnginePage::contentsSize
- \since 5.7
-
- The size of the page contents.
-*/
-
-/*!
- \fn void QWebEnginePage::audioMutedChanged(bool muted)
- \since 5.7
-
- This signal is emitted when the page's \a muted state changes.
- \note Not to be confused with a specific HTML5 audio or video element being muted.
-*/
-
-/*!
- \fn void QWebEnginePage::recentlyAudibleChanged(bool recentlyAudible);
- \since 5.7
-
- This signal is emitted when the page's audible state, \a recentlyAudible, changes, because
- the audio is played or stopped.
-
- \note The signal is also emitted when calling the setAudioMuted() method.
- Also, if the audio is paused, this signal is emitted with an approximate \b{two-second
- delay}, from the moment the audio is paused.
-*/
-
-/*!
\fn void QWebEnginePage::iconUrlChanged(const QUrl &url)
This signal is emitted when the URL of the icon ("favicon") associated with the
page is changed. The new URL is specified by \a url.
- \sa iconUrl(), icon(), iconChanged()
-*/
-
-/*!
- \fn void QWebEnginePage::iconChanged(const QIcon &icon)
- \since 5.7
-
- This signal is emitted when the icon ("favicon") associated with the
- page is changed. The new icon is specified by \a icon.
-
- \sa icon(), iconUrl(), iconUrlChanged()
+ \sa iconUrl()
*/
/*!
@@ -718,45 +653,23 @@ QWebChannel *QWebEnginePage::webChannel() const
return d->webChannel;
}
-/*!
- * \overload
- *
- * Sets the web channel instance to be used by this page to \a channel and installs
- * it in the main JavaScript world.
- *
- * With this method the web channel can be accessed by web page content. If the content
- * is not under your control and might be hostile, this could be a security issue and
- * you should consider installing it in a private JavaScript world.
- *
- * \since 5.5
- * \sa QWebEngineScript::MainWorld
- */
-
-void QWebEnginePage::setWebChannel(QWebChannel *channel)
-{
- setWebChannel(channel, QWebEngineScript::MainWorld);
-}
/*!
* Sets the web channel instance to be used by this page to \a channel and connects it to
* web engine's transport using Chromium IPC messages. The transport is exposed in the JavaScript
- * world \a worldId as
+ * context of this page as
* \c qt.webChannelTransport, which should be used when using the \l{Qt WebChannel JavaScript API}.
*
* \note The page does not take ownership of the channel object.
- * \note Only one web channel can be installed per page, setting one even in another JavaScript
- * world uninstalls any already installed web channel.
*
- * \since 5.7
- * \sa QWebEngineScript::ScriptWorldId
+ * \since 5.5
*/
-void QWebEnginePage::setWebChannel(QWebChannel *channel, uint worldId)
+void QWebEnginePage::setWebChannel(QWebChannel *channel)
{
Q_D(QWebEnginePage);
- if (d->webChannel != channel || d->webChannelWorldId != worldId) {
+ if (d->webChannel != channel) {
d->webChannel = channel;
- d->webChannelWorldId = worldId;
- d->adapter->setWebChannel(channel, worldId);
+ d->adapter->setWebChannel(channel, QWebEngineScript::MainWorld);
}
}
@@ -787,44 +700,6 @@ void QWebEnginePage::setBackgroundColor(const QColor &color)
d->adapter->backgroundColorChanged();
}
-/*!
- \property QWebEnginePage::audioMuted
- \brief whether the current page audio is muted.
- \since 5.7
-
- The default value is \c false.
- \sa recentlyAudible
-*/
-bool QWebEnginePage::isAudioMuted() const {
- const Q_D(QWebEnginePage);
- return d->adapter->isAudioMuted();
-}
-
-void QWebEnginePage::setAudioMuted(bool muted) {
- Q_D(QWebEnginePage);
- bool _isAudioMuted = isAudioMuted();
- d->adapter->setAudioMuted(muted);
- if (_isAudioMuted != muted) {
- Q_EMIT audioMutedChanged(muted);
- }
-}
-
-
-/*!
- \property QWebEnginePage::recentlyAudible
- \brief the current page's \e {audible state}, that is, whether audio was recently played
- or not.
- \since 5.7
-
- The default value is \c false.
- \sa audioMuted
-*/
-bool QWebEnginePage::recentlyAudible() const
-{
- const Q_D(QWebEnginePage);
- return d->adapter->recentlyAudible();
-}
-
void QWebEnginePage::setView(QWidget *view)
{
QWebEngineViewPrivate::bind(qobject_cast<QWebEngineView*>(view), this);
@@ -921,9 +796,6 @@ QAction *QWebEnginePage::action(WebAction action) const
case OpenLinkInNewTab:
text = tr("Open Link in New Tab");
break;
- case OpenLinkInNewBackgroundTab:
- text = tr("Open Link in New Background Tab");
- break;
case CopyLinkToClipboard:
text = tr("Copy Link URL");
break;
@@ -966,12 +838,6 @@ QAction *QWebEnginePage::action(WebAction action) const
case RequestClose:
text = tr("Close Page");
break;
- case Unselect:
- text = tr("Unselect");
- break;
- case SavePage:
- text = tr("Save &Page");
- break;
case NoWebAction:
case WebActionCount:
Q_UNREACHABLE();
@@ -994,7 +860,7 @@ QAction *QWebEnginePage::action(WebAction action) const
void QWebEnginePage::triggerAction(WebAction action, bool)
{
Q_D(QWebEnginePage);
- const QtWebEngineCore::WebEngineContextMenuData &menuData = *d->contextData.d;
+ const QtWebEngineCore::WebEngineContextMenuData &menuData = d->m_menuData;
switch (action) {
case Back:
d->adapter->navigateToOffset(-1);
@@ -1032,9 +898,6 @@ void QWebEnginePage::triggerAction(WebAction action, bool)
case PasteAndMatchStyle:
d->adapter->pasteAndMatchStyle();
break;
- case Unselect:
- d->adapter->unselect();
- break;
case OpenLinkInThisWindow:
if (menuData.linkUrl.isValid())
setUrl(menuData.linkUrl);
@@ -1053,13 +916,6 @@ void QWebEnginePage::triggerAction(WebAction action, bool)
newPage->setUrl(menuData.linkUrl);
}
break;
- case OpenLinkInNewBackgroundTab:
- if (menuData.linkUrl.isValid()) {
- QWebEnginePage *newPage = createWindow(WebBrowserBackgroundTab);
- if (newPage)
- newPage->setUrl(menuData.linkUrl);
- }
- break;
case CopyLinkToClipboard:
if (menuData.linkUrl.isValid()) {
QString urlString = menuData.linkUrl.toString(QUrl::FullyEncoded);
@@ -1159,9 +1015,6 @@ void QWebEnginePage::triggerAction(WebAction action, bool)
case RequestClose:
d->adapter->requestClose();
break;
- case SavePage:
- d->adapter->save();
- break;
case NoWebAction:
break;
case WebActionCount:
@@ -1205,17 +1058,16 @@ bool QWebEnginePagePrivate::contextMenuRequested(const WebEngineContextMenuData
if (!view || !view->d_func()->m_pendingContextMenuEvent)
return false;
- contextData.reset();
+ m_menuData = WebEngineContextMenuData();
QContextMenuEvent event(QContextMenuEvent::Mouse, data.pos, view->mapToGlobal(data.pos));
switch (view->contextMenuPolicy()) {
case Qt::PreventContextMenu:
return false;
case Qt::DefaultContextMenu:
- contextData = data;
+ m_menuData = data;
view->contextMenuEvent(&event);
break;
case Qt::CustomContextMenu:
- contextData = data;
Q_EMIT view->customContextMenuRequested(data.pos);
break;
case Qt::ActionsContextMenu:
@@ -1354,12 +1206,9 @@ bool QWebEnginePagePrivate::isEnabled() const
QMenu *QWebEnginePage::createStandardContextMenu()
{
Q_D(QWebEnginePage);
- if (!d->contextData.d)
- return nullptr;
-
QMenu *menu = new QMenu(d->view);
QAction *action = 0;
- const WebEngineContextMenuData &contextMenuData = *d->contextData.d;
+ const WebEngineContextMenuData &contextMenuData = d->m_menuData;
if (!contextMenuData.linkText.isEmpty() && contextMenuData.linkUrl.isValid()) {
action = QWebEnginePage::action(OpenLinkInThisWindow);
@@ -1383,7 +1232,6 @@ QMenu *QWebEnginePage::createStandardContextMenu()
menu->addAction(action);
} else {
menu->addAction(QWebEnginePage::action(Copy));
- menu->addAction(QWebEnginePage::action(Unselect));
}
if (!contextMenuData.linkText.isEmpty() && contextMenuData.linkUrl.isValid()) {
@@ -1552,7 +1400,7 @@ QUrl QWebEnginePage::requestedUrl() const
By default, this property contains an empty URL.
- \sa iconUrlChanged(), icon(), iconChanged()
+ \sa iconUrlChanged()
*/
QUrl QWebEnginePage::iconUrl() const
{
@@ -1560,27 +1408,6 @@ QUrl QWebEnginePage::iconUrl() const
return d->iconUrl;
}
-/*!
- \property QWebEnginePage::icon
- \brief the icon associated with the page currently viewed
- \since 5.7
-
- By default, this property contains a null icon. If the web page specifies more than one icon,
- the \c{icon} property encapsulates the available candidate icons in a single,
- scalable \c{QIcon}.
-
- \sa iconChanged(), iconUrl(), iconUrlChanged()
-*/
-QIcon QWebEnginePage::icon() const
-{
- Q_D(const QWebEnginePage);
-
- if (d->iconUrl.isEmpty())
- return QIcon();
-
- return d->adapter->faviconManager()->getIcon();
-}
-
qreal QWebEnginePage::zoomFactor() const
{
Q_D(const QWebEnginePage);
@@ -1606,19 +1433,6 @@ void QWebEnginePage::runJavaScript(const QString& scriptSource, const QWebEngine
d->m_callbacks.registerCallback(requestId, resultCallback);
}
-void QWebEnginePage::runJavaScript(const QString &scriptSource, quint32 worldId)
-{
- Q_D(QWebEnginePage);
- d->adapter->runJavaScript(scriptSource, worldId);
-}
-
-void QWebEnginePage::runJavaScript(const QString& scriptSource, quint32 worldId, const QWebEngineCallback<const QVariant &> &resultCallback)
-{
- Q_D(QWebEnginePage);
- quint64 requestId = d->adapter->runJavaScriptCallbackResult(scriptSource, worldId);
- d->m_callbacks.registerCallback(requestId, resultCallback);
-}
-
/*!
Returns the collection of scripts that are injected into the page.
@@ -1735,64 +1549,6 @@ bool QWebEnginePage::acceptNavigationRequest(const QUrl &url, NavigationType typ
return true;
}
-QPointF QWebEnginePage::scrollPosition() const
-{
- Q_D(const QWebEnginePage);
- return d->adapter->lastScrollOffset();
-}
-
-QSizeF QWebEnginePage::contentsSize() const
-{
- Q_D(const QWebEnginePage);
- return d->adapter->lastContentsSize();
-}
-
-/*!
- Renders the current content of the page into a PDF document and saves it in the location specified in \a filePath.
- The page size and orientation of the produced PDF document are taken from the values specified in \a pageLayout.
-
- If a file already exists at the provided file path, it will be overwritten.
- \since 5.7
-*/
-void QWebEnginePage::printToPdf(const QString &filePath, const QPageLayout &pageLayout)
-{
- Q_D(const QWebEnginePage);
- d->adapter->printToPDF(pageLayout, filePath);
-}
-
-
-/*!
- \fn void QWebEnginePage::printToPdf(FunctorOrLambda resultCallback, const QPageLayout &pageLayout)
- Renders the current content of the page into a PDF document and returns a byte array containing the PDF data
- as parameter to \a resultCallback.
- The page size and orientation of the produced PDF document are taken from the values specified in \a pageLayout.
-
- The \a resultCallback must take a const reference to a QByteArray as parameter. If printing was successful, this byte array
- will contain the PDF data, otherwise, the byte array will be empty.
-
- \since 5.7
-*/
-void QWebEnginePage::printToPdf(const QWebEngineCallback<const QByteArray&> &resultCallback, const QPageLayout &pageLayout)
-{
- Q_D(QWebEnginePage);
- quint64 requestId = d->adapter->printToPDFCallbackResult(pageLayout);
- d->m_callbacks.registerCallback(requestId, resultCallback);
-}
-
-/*!
- \since 5.7
-
- Returns additional data about the current context menu. It is only guaranteed to be valid during the call to the QWebEngineView::contextMenuEvent()
- handler of the associated QWebEngineView.
-
- \sa createStandardContextMenu()
-*/
-const QWebEngineContextMenuData &QWebEnginePage::contextMenuData() const
-{
- Q_D(const QWebEnginePage);
- return d->contextData;
-}
-
QT_END_NAMESPACE
#include "moc_qwebenginepage.cpp"
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
index 2ac8e0f3e..462a4e5f2 100644
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ b/src/webenginewidgets/api/qwebenginepage.h
@@ -47,14 +47,12 @@
#include <QtCore/qobject.h>
#include <QtCore/qurl.h>
#include <QtCore/qvariant.h>
-#include <QtGui/qpagelayout.h>
#include <QtNetwork/qnetworkaccessmanager.h>
#include <QtWidgets/qwidget.h>
QT_BEGIN_NAMESPACE
class QMenu;
class QWebChannel;
-class QWebEngineContextMenuData;
class QWebEngineFullScreenRequest;
class QWebEngineHistory;
class QWebEnginePage;
@@ -73,13 +71,8 @@ class QWEBENGINEWIDGETS_EXPORT QWebEnginePage : public QObject {
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
Q_PROPERTY(QString title READ title)
Q_PROPERTY(QUrl url READ url WRITE setUrl)
- Q_PROPERTY(QUrl iconUrl READ iconUrl NOTIFY iconUrlChanged)
- Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
+ Q_PROPERTY(QUrl iconUrl READ iconUrl)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
- Q_PROPERTY(QSizeF contentsSize READ contentsSize NOTIFY contentsSizeChanged)
- Q_PROPERTY(QPointF scrollPosition READ scrollPosition NOTIFY scrollPositionChanged)
- Q_PROPERTY(bool audioMuted READ isAudioMuted WRITE setAudioMuted NOTIFY audioMutedChanged)
- Q_PROPERTY(bool recentlyAudible READ recentlyAudible NOTIFY recentlyAudibleChanged)
public:
enum WebAction {
@@ -120,9 +113,6 @@ public:
InspectElement,
ExitFullScreen,
RequestClose,
- Unselect,
- SavePage,
- OpenLinkInNewBackgroundTab,
WebActionCount
};
@@ -135,8 +125,7 @@ public:
enum WebWindowType {
WebBrowserWindow,
WebBrowserTab,
- WebDialog,
- WebBrowserBackgroundTab
+ WebDialog
};
enum PermissionPolicy {
@@ -235,45 +224,24 @@ public:
QUrl url() const;
QUrl requestedUrl() const;
QUrl iconUrl() const;
- QIcon icon() const;
qreal zoomFactor() const;
void setZoomFactor(qreal factor);
- QPointF scrollPosition() const;
- QSizeF contentsSize() const;
-
void runJavaScript(const QString& scriptSource);
- void runJavaScript(const QString& scriptSource, quint32 worldId);
#ifdef Q_QDOC
void runJavaScript(const QString& scriptSource, FunctorOrLambda resultCallback);
- void runJavaScript(const QString& scriptSource, quint32 worldId, FunctorOrLambda resultCallback);
#else
void runJavaScript(const QString& scriptSource, const QWebEngineCallback<const QVariant &> &resultCallback);
- void runJavaScript(const QString& scriptSource, quint32 worldId, const QWebEngineCallback<const QVariant &> &resultCallback);
#endif
QWebEngineScriptCollection &scripts();
QWebEngineSettings *settings() const;
QWebChannel *webChannel() const;
void setWebChannel(QWebChannel *);
- void setWebChannel(QWebChannel *, uint worldId);
QColor backgroundColor() const;
void setBackgroundColor(const QColor &color);
- bool isAudioMuted() const;
- void setAudioMuted(bool muted);
- bool recentlyAudible() const;
-
- void printToPdf(const QString &filePath, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()));
-#ifdef Q_QDOC
- void printToPdf(FunctorOrLambda resultCallback, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()));
-#else
- void printToPdf(const QWebEngineCallback<const QByteArray&> &resultCallback, const QPageLayout &layout = QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF()));
-#endif
-
- const QWebEngineContextMenuData &contextMenuData() const;
-
Q_SIGNALS:
void loadStarted();
void loadProgress(int progress);
@@ -297,12 +265,6 @@ Q_SIGNALS:
void titleChanged(const QString &title);
void urlChanged(const QUrl &url);
void iconUrlChanged(const QUrl &url);
- void iconChanged(const QIcon &icon);
-
- void scrollPositionChanged(const QPointF &position);
- void contentsSizeChanged(const QSizeF &size);
- void audioMutedChanged(bool muted);
- void recentlyAudibleChanged(bool recentlyAudible);
protected:
virtual QWebEnginePage *createWindow(WebWindowType type);
diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h
index 96640a63a..12d3c8f44 100644
--- a/src/webenginewidgets/api/qwebenginepage_p.h
+++ b/src/webenginewidgets/api/qwebenginepage_p.h
@@ -54,7 +54,6 @@
#include "qwebenginepage.h"
#include "qwebenginecallback_p.h"
-#include "qwebenginecontextmenudata.h"
#include "qwebenginescriptcollection.h"
#include "web_contents_adapter_client.h"
#include <QtCore/qcompilerdetection.h>
@@ -164,14 +163,13 @@ public:
QWebEngineSettings *settings;
QWebEngineView *view;
QUrl explicitUrl;
- QWebEngineContextMenuData contextData;
+ QtWebEngineCore::WebEngineContextMenuData m_menuData;
bool isLoading;
QWebEngineScriptCollection scriptCollection;
bool m_isBeingAdopted;
QColor m_backgroundColor;
bool fullscreenMode;
QWebChannel *webChannel;
- unsigned int webChannelWorldId;
QUrl iconUrl;
mutable QtWebEngineCore::CallbackDirectory m_callbacks;
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index 664323034..b20ffc6b1 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -54,11 +54,6 @@
QT_BEGIN_NAMESPACE
-ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::UnknownSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::UnknownSavePageFormat)
-ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::SingleHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::SingleHtmlSaveFormat)
-ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::CompleteHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::CompleteHtmlSaveFormat)
-ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::MimeHtmlSaveFormat)
-
using QtWebEngineCore::BrowserContextAdapter;
/*!
@@ -106,7 +101,6 @@ using QtWebEngineCore::BrowserContextAdapter;
\value MemoryHttpCache Use an in-memory cache. This is the only setting possible if
\c off-the-record is set or no cache path is available.
\value DiskHttpCache Use a disk cache. This is the default.
- \value NoCache Disable both in-memory and disk caching. (Added in Qt 5.7)
*/
/*!
@@ -183,7 +177,6 @@ void QWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
itemPrivate->downloadState = QWebEngineDownloadItem::DownloadRequested;
itemPrivate->downloadPath = info.path;
itemPrivate->mimeType = info.mimeType;
- itemPrivate->savePageFormat = static_cast<QWebEngineDownloadItem::SavePageFormat>(info.savePageFormat);
QWebEngineDownloadItem *download = new QWebEngineDownloadItem(itemPrivate, q);
@@ -194,8 +187,6 @@ void QWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
QWebEngineDownloadItem::DownloadState state = download->state();
info.path = download->path();
- info.savePageFormat = static_cast<QtWebEngineCore::BrowserContextAdapterClient::SavePageFormat>(
- download->savePageFormat());
info.accepted = state != QWebEngineDownloadItem::DownloadCancelled;
if (state == QWebEngineDownloadItem::DownloadRequested) {
@@ -658,15 +649,4 @@ void QWebEngineProfile::destroyedUrlSchemeHandler(QWebEngineUrlSchemeHandler *ob
removeUrlSchemeHandler(obj);
}
-/*!
- \since 5.7
-
- Removes the profile's cache entries.
-*/
-void QWebEngineProfile::clearHttpCache()
-{
- Q_D(QWebEngineProfile);
- d->browserContext()->clearHttpCache();
-}
-
QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebengineprofile.h b/src/webenginewidgets/api/qwebengineprofile.h
index d981fa5bb..7eaf8a481 100644
--- a/src/webenginewidgets/api/qwebengineprofile.h
+++ b/src/webenginewidgets/api/qwebengineprofile.h
@@ -69,8 +69,7 @@ public:
enum HttpCacheType {
MemoryHttpCache,
- DiskHttpCache,
- NoCache
+ DiskHttpCache
};
enum PersistentCookiesPolicy {
@@ -119,8 +118,6 @@ public:
void removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *);
void removeAllUrlSchemeHandlers();
- void clearHttpCache();
-
static QWebEngineProfile *defaultProfile();
Q_SIGNALS:
diff --git a/src/webenginewidgets/api/qwebenginesettings.cpp b/src/webenginewidgets/api/qwebenginesettings.cpp
index dfca16287..cd9382e46 100644
--- a/src/webenginewidgets/api/qwebenginesettings.cpp
+++ b/src/webenginewidgets/api/qwebenginesettings.cpp
@@ -79,16 +79,6 @@ static WebEngineSettings::Attribute toWebEngineAttribute(QWebEngineSettings::Web
return WebEngineSettings::PluginsEnabled;
case QWebEngineSettings::FullScreenSupportEnabled:
return WebEngineSettings::FullScreenSupportEnabled;
- case QWebEngineSettings::ScreenCaptureEnabled:
- return WebEngineSettings::ScreenCaptureEnabled;
- case QWebEngineSettings::WebGLEnabled:
- return WebEngineSettings::WebGLEnabled;
- case QWebEngineSettings::Accelerated2dCanvasEnabled:
- return WebEngineSettings::Accelerated2dCanvasEnabled;
- case QWebEngineSettings::AutoLoadIconsForPage:
- return WebEngineSettings::AutoLoadIconsForPage;
- case QWebEngineSettings::TouchIconsEnabled:
- return WebEngineSettings::TouchIconsEnabled;
default:
return WebEngineSettings::UnsupportedInCoreSettings;
}
@@ -128,7 +118,6 @@ ASSERT_ENUMS_MATCH(WebEngineSettings::SerifFont, QWebEngineSettings::SerifFont)
ASSERT_ENUMS_MATCH(WebEngineSettings::SansSerifFont, QWebEngineSettings::SansSerifFont)
ASSERT_ENUMS_MATCH(WebEngineSettings::CursiveFont, QWebEngineSettings::CursiveFont)
ASSERT_ENUMS_MATCH(WebEngineSettings::FantasyFont, QWebEngineSettings::FantasyFont)
-ASSERT_ENUMS_MATCH(WebEngineSettings::PictographFont, QWebEngineSettings::PictographFont)
void QWebEngineSettings::setFontFamily(QWebEngineSettings::FontFamily which, const QString &family)
{
diff --git a/src/webenginewidgets/api/qwebenginesettings.h b/src/webenginewidgets/api/qwebenginesettings.h
index 8eda50ee2..38c48256a 100644
--- a/src/webenginewidgets/api/qwebenginesettings.h
+++ b/src/webenginewidgets/api/qwebenginesettings.h
@@ -62,8 +62,7 @@ public:
SerifFont,
SansSerifFont,
CursiveFont,
- FantasyFont,
- PictographFont
+ FantasyFont
};
enum WebAttribute {
AutoLoadImages,
@@ -80,12 +79,7 @@ public:
ScrollAnimatorEnabled,
ErrorPageEnabled,
PluginsEnabled,
- FullScreenSupportEnabled,
- ScreenCaptureEnabled,
- WebGLEnabled,
- Accelerated2dCanvasEnabled,
- AutoLoadIconsForPage,
- TouchIconsEnabled
+ FullScreenSupportEnabled
};
enum FontSize {
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 8b4053e73..5913cc340 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -51,7 +51,6 @@
#include <QMenu>
#include <QContextMenuEvent>
#include <QStackedLayout>
-#include <QPageLayout>
QT_BEGIN_NAMESPACE
@@ -86,7 +85,6 @@ void QWebEngineViewPrivate::bind(QWebEngineView *view, QWebEnginePage *page)
QObject::connect(page, &QWebEnginePage::titleChanged, view, &QWebEngineView::titleChanged);
QObject::connect(page, &QWebEnginePage::urlChanged, view, &QWebEngineView::urlChanged);
QObject::connect(page, &QWebEnginePage::iconUrlChanged, view, &QWebEngineView::iconUrlChanged);
- QObject::connect(page, &QWebEnginePage::iconChanged, view, &QWebEngineView::iconChanged);
QObject::connect(page, &QWebEnginePage::loadStarted, view, &QWebEngineView::loadStarted);
QObject::connect(page, &QWebEnginePage::loadProgress, view, &QWebEngineView::loadProgress);
QObject::connect(page, &QWebEnginePage::loadFinished, view, &QWebEngineView::loadFinished);
@@ -123,16 +121,6 @@ QWebEngineViewPrivate::QWebEngineViewPrivate()
with which the process terminated.
*/
-/*!
- \fn void QWebEngineView::iconChanged(const QIcon &icon)
- \since 5.7
-
- This signal is emitted when the icon ("favicon") associated with the
- view is changed. The new icon is specified by \a icon.
-
- \sa icon(), iconUrl(), iconUrlChanged()
-*/
-
QWebEngineView::QWebEngineView(QWidget *parent)
: QWidget(parent)
, d_ptr(new QWebEngineViewPrivate)
@@ -210,20 +198,6 @@ QUrl QWebEngineView::iconUrl() const
return page()->iconUrl();
}
-/*!
- \property QWebEngineView::icon
- \brief the icon associated with the page currently viewed
- \since 5.7
-
- By default, this property contains a null icon.
-
- \sa iconChanged(), iconUrl(), iconUrlChanged()
-*/
-QIcon QWebEngineView::icon() const
-{
- return page()->icon();
-}
-
bool QWebEngineView::hasSelection() const
{
return page()->hasSelection();
diff --git a/src/webenginewidgets/api/qwebengineview.h b/src/webenginewidgets/api/qwebengineview.h
index cb66bb75f..3f2404e7d 100644
--- a/src/webenginewidgets/api/qwebengineview.h
+++ b/src/webenginewidgets/api/qwebengineview.h
@@ -59,7 +59,6 @@ class QWEBENGINEWIDGETS_EXPORT QWebEngineView : public QWidget {
Q_PROPERTY(QString title READ title)
Q_PROPERTY(QUrl url READ url WRITE setUrl)
Q_PROPERTY(QUrl iconUrl READ iconUrl NOTIFY iconUrlChanged)
- Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged)
Q_PROPERTY(QString selectedText READ selectedText)
Q_PROPERTY(bool hasSelection READ hasSelection)
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
@@ -81,7 +80,6 @@ public:
void setUrl(const QUrl &url);
QUrl url() const;
QUrl iconUrl() const;
- QIcon icon() const;
bool hasSelection() const;
QString selectedText() const;
@@ -118,7 +116,6 @@ Q_SIGNALS:
void selectionChanged();
void urlChanged(const QUrl&);
void iconUrlChanged(const QUrl&);
- void iconChanged(const QIcon&);
void renderProcessTerminated(QWebEnginePage::RenderProcessTerminationStatus terminationStatus,
int exitCode);
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index 539e809d4..8f6a19333 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -51,9 +51,8 @@
The title of an HTML page can be accessed with the title() property.
Additionally, a page may also specify an icon, which can be accessed
- using the icon() or its URL using the iconUrl() property.
- If the title or the icon changes, the corresponding titleChanged(), iconChanged()
- and iconUrlChanged() signals will be emitted.
+ using the iconUrl() property. If the title or the icon changes, the
+ corresponding titleChanged() and iconUrlChanged() signals will be emitted.
The zoomFactor() property enables zooming the contents of the web page by a
scale factor.
@@ -79,14 +78,6 @@
security origin, and can access each other's resources. Local resources are by default
restricted from accessing remote content, which means that \c file:// will not be able to
access \c http://domain.com/foo.html.
-
- Scripts can be executed on the web page by using runJavaScript(), either in the main
- JavaScript \e world, along with the rest of the JavaScript coming from the web contents, or in
- their own isolated world. While the DOM of the page can be accessed from any world, JavaScript
- variables of a function defined in one world are not accessible from a different one.
- QWebEngineScript::ScriptWorldId provides some predefined IDs for this purpose. Using the
- \c runJavaScript() version without the world ID is the same as running the script in the
- \c MainWorld.
*/
/*!
@@ -126,7 +117,6 @@
\value OpenLinkInThisWindow Open the current link in the current window. (Added in Qt 5.6)
\value OpenLinkInNewWindow Open the current link in a new window. (Added in Qt 5.6)
\value OpenLinkInNewTab Open the current link in a new tab. (Added in Qt 5.6)
- \value OpenLinkInNewBackgroundTab Open the current link in a new background tab. (Added in Qt 5.7)
\value CopyLinkToClipboard Copy the current link to the clipboard. (Added in Qt 5.6)
\value CopyImageToClipboard Copy the clicked image to the clipboard. (Added in Qt 5.6)
@@ -149,9 +139,6 @@
\value RequestClose Request to close the web page. If defined, the \c{window.onbeforeunload}
handler is run, and the user can confirm or reject to close the page. If the close
request is confirmed, \c windowCloseRequested is emitted. (Added in Qt 5.6)
- \value Unselect Clear the current selection. (Added in Qt 5.7)
- \value SavePage Save the current page to disk. MHTML is the default format that is used to store
- the web page on disk. (Added in Qt 5.7)
\omitvalue WebActionCount
@@ -168,8 +155,6 @@
A web browser tab.
\value WebDialog
A window without decoration.
- \value WebBrowserBackgroundTab
- A web browser tab without hiding the current visible WebEngineView. (Added in Qt 5.7)
*/
/*!
@@ -281,9 +266,6 @@
the user clicks on the web page with the right mouse button. It is
called from the default \l{QWidget::}{contextMenuEvent()} handler. The popup menu's
ownership is transferred to the caller.
-
- Returns \c nullptr if the context menu data is not initialized, for example when it
- is called when there is actually no context menu requested.
*/
/*!
@@ -576,6 +558,13 @@
*/
/*!
+ \property QWebEnginePage::iconUrl
+ \brief the URL of the icon associated with the page currently viewed.
+
+ \sa iconUrlChanged()
+*/
+
+/*!
\property QWebEnginePage::requestedUrl
\brief the URL that was originally requested to be loaded by the page
that is currently viewed
@@ -652,61 +641,31 @@
*/
/*!
- \fn void QWebEnginePage::runJavaScript(const QString& scriptSource, quint32 worldId, FunctorOrLambda resultCallback)
- \since 5.7
-
- Runs the JavaScript code contained in \a scriptSource in the world specified by \a worldId.
- The world ID values are the same as provided by QWebEngineScript::ScriptWorldId. Using the
- \e runJavaScript() versions without the world ID is the same as running the script in the
- \c MainWorld.
-
- When the script has been executed, \a resultCallback is called with the result of the last
- executed statement. \c resultCallback can be any of a function pointer, a functor or a lambda,
- and it is expected to take a QVariant parameter. For example:
-
- \code
- page.runJavaScript("document.title", [](const QVariant &v) { qDebug() << v.toString(); });
- \endcode
-
- \warning Do not execute lengthy routines in the callback function, because it might block the
- rendering of the web engine page.
-
- See scripts() for an alternative API to inject scripts.
-
- \sa QWebEngineScript::ScriptWorldId
-*/
-
-/*!
- \fn void QWebEnginePage::runJavaScript(const QString &scriptSource, quint32 worldId)
- \since 5.7
- \overload runJavaScript()
-
- This convenience function runs the JavaScript code contained in \a scriptSource in the world
- specified by \a worldId.
-*/
-
-/*!
\fn void QWebEnginePage::runJavaScript(const QString& scriptSource)
\overload runJavaScript()
- This convenience function runs the JavaScript code contained in \a scriptSource in the same
- world as other scripts that are part of the loaded site.
-
- \sa QWebEngineScript::MainWorld
+ This convenience function runs the JavaScript code contained in \a scriptSource.
*/
/*!
\fn void QWebEnginePage::runJavaScript(const QString& scriptSource, FunctorOrLambda resultCallback)
- \overload runJavaScript()
Runs the JavaScript code contained in \a scriptSource.
- The script will run in the same world as other scripts that are part of the loaded site.
+ The script will run in the same \e world as other scripts that are part of the loaded site.
+
+ When the script has been executed, \a resultCallback is called with the result of the last executed statement.
+ \a resultCallback can be any of a function pointer, a functor or a lambda, and it is expected to take a
+ QVariant parameter. For example:
- When the script has been executed, \a resultCallback is called with the result of the last
- executed statement.
+ \code
+ page.runJavaScript("document.title", [](const QVariant &v) { qDebug() << v.toString(); });
+ \endcode
- \sa QWebEngineScript::MainWorld
+ \warning Do not execute lengthy routines in the callback function, because it might block the
+ rendering of the web engine page.
+
+ See scripts() for an alternative API to inject scripts.
*/
/*!
@@ -757,3 +716,13 @@
\sa url()
*/
+
+/*!
+ \fn void QWebEnginePage::iconUrlChanged(const QUrl &url)
+
+ This signal is emitted when the icon ("favicon") associated with the page is
+ found or changed. The new URL is specified by \a url.
+
+
+ \sa iconUrl()
+*/
diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
index 07c4965d0..c19e3491e 100644
--- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
@@ -66,8 +66,6 @@
\value SansSerifFont
\value CursiveFont
\value FantasyFont
- \value PictographFont
- (added in Qt 5.7)
*/
/*!
@@ -135,18 +133,6 @@
See also \l{Pepper Plugin API}. (Added in Qt 5.6)
\value FullScreenSupportEnabled
Enables fullscreen support in an application. Disabled by default. (Added in Qt 5.6)
- \value ScreenCaptureEnabled
- Enables screen capture in an application. Disabled by default. (Added in Qt 5.7)
- \value WebGLEnabled
- Enables support for HTML 5 WebGL. Enabled by default if available. (Added in Qt 5.7)
- \value Accelerated2dCanvasEnabled
- Specifies whether the HTML5 2D canvas should be a OpenGL framebuffer.
- This makes many painting operations faster, but slows down pixel access. Enabled by default if available. (Added in Qt 5.7)
- \value AutoLoadIconsForPage
- Automatically downloads icons for web pages. Enabled by default. (Added in Qt 5.7)
- \value TouchIconsEnabled
- Enables support for touch icons and precomposed touch icons
- Disabled by default. (Added in Qt 5.7)
*/
/*!
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index 5a4c1b52b..b5355d9d9 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -59,11 +59,9 @@
The title of an HTML document can be accessed with the title() property.
Additionally, a web site may specify an icon, which can be accessed
- using the icon() or its URL using the iconUrl() property.
- If the title or the icon changes, the corresponding titleChanged(), iconChanged()
- and iconUrlChanged() signals will be emitted.
- The zoomFactor() property enables zooming the contents of the web page by a
- scale factor.
+ using the iconUrl() property. If the title or the icon changes, the corresponding
+ titleChanged() and iconUrlChanged() signals will be emitted. The
+ zoomFactor() property enables zooming the contents of the web page by a scale factor.
If you require a custom context menu, you can implement it by reimplementing
\l{QWidget::}{contextMenuEvent()} and populating your QMenu with the actions
@@ -195,7 +193,7 @@
By default, this property contains an empty URL.
- \sa iconUrlChanged(), icon(), iconChanged()
+ \sa iconUrlChanged()
*/
/*!
@@ -338,7 +336,7 @@
This signal is emitted when the URL of the icon ("favicon") associated with the
view is changed. The new URL is specified by \a url.
- \sa iconUrl(), icon(), iconChanged()
+ \sa iconUrl()
*/
/*!
diff --git a/src/webenginewidgets/webenginewidgets.pro b/src/webenginewidgets/webenginewidgets.pro
index 279ec79f8..dd1e570e9 100644
--- a/src/webenginewidgets/webenginewidgets.pro
+++ b/src/webenginewidgets/webenginewidgets.pro
@@ -11,7 +11,6 @@ INCLUDEPATH += $$PWD api ../core ../core/api ../webengine/api
SOURCES = \
api/qtwebenginewidgetsglobal.cpp \
api/qwebenginecertificateerror.cpp \
- api/qwebenginecontextmenudata.cpp \
api/qwebenginedownloaditem.cpp \
api/qwebenginefullscreenrequest.cpp \
api/qwebenginehistory.cpp \
@@ -26,7 +25,6 @@ SOURCES = \
HEADERS = \
api/qtwebenginewidgetsglobal.h \
api/qwebenginecertificateerror.h \
- api/qwebenginecontextmenudata.h \
api/qwebenginedownloaditem.h \
api/qwebenginedownloaditem_p.h \
api/qwebenginefullscreenrequest.h \
@@ -48,8 +46,4 @@ HEADERS = \
DEFINES += QT_UI_DELEGATES
}
-!contains(WEBENGINE_CONFIG, no_spellcheck) {
- DEFINES += ENABLE_SPELLCHECK
-}
-
load(qt_module)
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index 1937dca04..47d44cd7f 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -76,7 +76,6 @@ static QStringList hardcodedTypes = QStringList()
// Ignore the testSupport types without making a fuss.
<< "QQuickWebEngineTestSupport*"
<< "QQuickWebEngineErrorPage*"
- << "const QQuickWebEngineContextMenuData*"
<< "QWebEngineCookieStore*"
;
@@ -202,155 +201,6 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.grantFeaturePermission(QUrl,Feature,bool) --> void"
<< "QQuickWebEngineView.setActiveFocusOnPress(bool) --> void"
<< "QQuickWebEngineView.triggerWebAction(WebAction) --> void"
- << "QQuickWebEngineView.Unselect --> WebAction"
- << "QQuickWebEngineView.SavePage --> WebAction"
- << "QQuickWebEngineView.A4 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B5 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Letter --> PrintedPageSizeId"
- << "QQuickWebEngineView.Legal --> PrintedPageSizeId"
- << "QQuickWebEngineView.Executive --> PrintedPageSizeId"
- << "QQuickWebEngineView.A0 --> PrintedPageSizeId"
- << "QQuickWebEngineView.A1 --> PrintedPageSizeId"
- << "QQuickWebEngineView.A2 --> PrintedPageSizeId"
- << "QQuickWebEngineView.A3 --> PrintedPageSizeId"
- << "QQuickWebEngineView.A5 --> PrintedPageSizeId"
- << "QQuickWebEngineView.A6 --> PrintedPageSizeId"
- << "QQuickWebEngineView.A7 --> PrintedPageSizeId"
- << "QQuickWebEngineView.A8 --> PrintedPageSizeId"
- << "QQuickWebEngineView.A9 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B0 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B1 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B10 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B2 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B3 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B4 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B6 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B7 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B8 --> PrintedPageSizeId"
- << "QQuickWebEngineView.B9 --> PrintedPageSizeId"
- << "QQuickWebEngineView.C5E --> PrintedPageSizeId"
- << "QQuickWebEngineView.Comm10E --> PrintedPageSizeId"
- << "QQuickWebEngineView.DLE --> PrintedPageSizeId"
- << "QQuickWebEngineView.Folio --> PrintedPageSizeId"
- << "QQuickWebEngineView.Ledger --> PrintedPageSizeId"
- << "QQuickWebEngineView.Tabloid --> PrintedPageSizeId"
- << "QQuickWebEngineView.Custom --> PrintedPageSizeId"
- << "QQuickWebEngineView.A10 --> PrintedPageSizeId"
- << "QQuickWebEngineView.A3Extra --> PrintedPageSizeId"
- << "QQuickWebEngineView.A4Extra --> PrintedPageSizeId"
- << "QQuickWebEngineView.A4Plus --> PrintedPageSizeId"
- << "QQuickWebEngineView.A4Small --> PrintedPageSizeId"
- << "QQuickWebEngineView.A5Extra --> PrintedPageSizeId"
- << "QQuickWebEngineView.B5Extra --> PrintedPageSizeId"
- << "QQuickWebEngineView.JisB0 --> PrintedPageSizeId"
- << "QQuickWebEngineView.JisB1 --> PrintedPageSizeId"
- << "QQuickWebEngineView.JisB2 --> PrintedPageSizeId"
- << "QQuickWebEngineView.JisB3 --> PrintedPageSizeId"
- << "QQuickWebEngineView.JisB4 --> PrintedPageSizeId"
- << "QQuickWebEngineView.JisB5 --> PrintedPageSizeId"
- << "QQuickWebEngineView.JisB6 --> PrintedPageSizeId"
- << "QQuickWebEngineView.JisB7 --> PrintedPageSizeId"
- << "QQuickWebEngineView.JisB8 --> PrintedPageSizeId"
- << "QQuickWebEngineView.JisB9 --> PrintedPageSizeId"
- << "QQuickWebEngineView.JisB10 --> PrintedPageSizeId"
- << "QQuickWebEngineView.AnsiC --> PrintedPageSizeId"
- << "QQuickWebEngineView.AnsiD --> PrintedPageSizeId"
- << "QQuickWebEngineView.AnsiE --> PrintedPageSizeId"
- << "QQuickWebEngineView.LegalExtra --> PrintedPageSizeId"
- << "QQuickWebEngineView.LetterExtra --> PrintedPageSizeId"
- << "QQuickWebEngineView.LetterPlus --> PrintedPageSizeId"
- << "QQuickWebEngineView.LetterSmall --> PrintedPageSizeId"
- << "QQuickWebEngineView.TabloidExtra --> PrintedPageSizeId"
- << "QQuickWebEngineView.ArchA --> PrintedPageSizeId"
- << "QQuickWebEngineView.ArchB --> PrintedPageSizeId"
- << "QQuickWebEngineView.ArchC --> PrintedPageSizeId"
- << "QQuickWebEngineView.ArchD --> PrintedPageSizeId"
- << "QQuickWebEngineView.ArchE --> PrintedPageSizeId"
- << "QQuickWebEngineView.Imperial7x9 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Imperial8x10 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Imperial9x11 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Imperial9x12 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Imperial10x11 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Imperial10x13 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Imperial10x14 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Imperial12x11 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Imperial15x11 --> PrintedPageSizeId"
- << "QQuickWebEngineView.ExecutiveStandard --> PrintedPageSizeId"
- << "QQuickWebEngineView.Note --> PrintedPageSizeId"
- << "QQuickWebEngineView.Quarto --> PrintedPageSizeId"
- << "QQuickWebEngineView.Statement --> PrintedPageSizeId"
- << "QQuickWebEngineView.SuperA --> PrintedPageSizeId"
- << "QQuickWebEngineView.SuperB --> PrintedPageSizeId"
- << "QQuickWebEngineView.Postcard --> PrintedPageSizeId"
- << "QQuickWebEngineView.DoublePostcard --> PrintedPageSizeId"
- << "QQuickWebEngineView.Prc16K --> PrintedPageSizeId"
- << "QQuickWebEngineView.Prc32K --> PrintedPageSizeId"
- << "QQuickWebEngineView.Prc32KBig --> PrintedPageSizeId"
- << "QQuickWebEngineView.FanFoldUS --> PrintedPageSizeId"
- << "QQuickWebEngineView.FanFoldGerman --> PrintedPageSizeId"
- << "QQuickWebEngineView.FanFoldGermanLegal --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeB4 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeB5 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeB6 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeC0 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeC1 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeC2 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeC3 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeC4 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeC6 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeC65 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeC7 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Envelope9 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Envelope11 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Envelope12 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Envelope14 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeMonarch --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopePersonal --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeChou3 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeChou4 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeInvite --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeItalian --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeKaku2 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeKaku3 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopePrc1 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopePrc2 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopePrc3 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopePrc4 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopePrc5 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopePrc6 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopePrc7 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopePrc8 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopePrc9 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopePrc10 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeYou4 --> PrintedPageSizeId"
- << "QQuickWebEngineView.LastPageSize --> PrintedPageSizeId"
- << "QQuickWebEngineView.NPageSize --> PrintedPageSizeId"
- << "QQuickWebEngineView.NPaperSize --> PrintedPageSizeId"
- << "QQuickWebEngineView.AnsiA --> PrintedPageSizeId"
- << "QQuickWebEngineView.AnsiB --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeC5 --> PrintedPageSizeId"
- << "QQuickWebEngineView.EnvelopeDL --> PrintedPageSizeId"
- << "QQuickWebEngineView.Envelope10 --> PrintedPageSizeId"
- << "QQuickWebEngineView.Portrait --> PrintedPageOrientation"
- << "QQuickWebEngineView.Landscape --> PrintedPageOrientation"
- << "QQuickWebEngineView.contentsSize --> QSizeF"
- << "QQuickWebEngineView.scrollPosition --> QPointF"
- << "QQuickWebEngineView.audioMuted --> bool"
- << "QQuickWebEngineView.recentlyAudible --> bool"
- << "QQuickWebEngineView.webChannelWorld --> uint"
- << "QQuickWebEngineView.contentsSizeChanged(QSizeF) --> void"
- << "QQuickWebEngineView.scrollPositionChanged(QPointF) --> void"
- << "QQuickWebEngineView.audioMutedChanged(bool) --> void"
- << "QQuickWebEngineView.recentlyAudibleChanged(bool) --> void"
- << "QQuickWebEngineView.webChannelWorldChanged(uint) --> void"
- << "QQuickWebEngineView.runJavaScript(QString,uint,QJSValue) --> void"
- << "QQuickWebEngineView.runJavaScript(QString,uint) --> void"
- << "QQuickWebEngineView.printToPdf(QString,PrintedPageSizeId,PrintedPageOrientation) --> void"
- << "QQuickWebEngineView.printToPdf(QString,PrintedPageSizeId) --> void"
- << "QQuickWebEngineView.printToPdf(QString) --> void"
- << "QQuickWebEngineView.printToPdf(QJSValue,PrintedPageSizeId,PrintedPageOrientation) --> void"
- << "QQuickWebEngineView.printToPdf(QJSValue,PrintedPageSizeId) --> void"
- << "QQuickWebEngineView.printToPdf(QJSValue) --> void"
<< "QQuickWebEngineCertificateError.SslPinnedKeyNotInCertificateChain --> Error"
<< "QQuickWebEngineCertificateError.CertificateCommonNameInvalid --> Error"
<< "QQuickWebEngineCertificateError.CertificateDateInvalid --> Error"
@@ -364,7 +214,6 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineCertificateError.CertificateNonUniqueName --> Error"
<< "QQuickWebEngineCertificateError.CertificateWeakKey --> Error"
<< "QQuickWebEngineCertificateError.CertificateNameConstraintViolation --> Error"
- << "QQuickWebEngineCertificateError.CertificateValidityTooLong --> Error"
<< "QQuickWebEngineCertificateError.url --> QUrl"
<< "QQuickWebEngineCertificateError.error --> Error"
<< "QQuickWebEngineCertificateError.description --> QString"
@@ -390,12 +239,6 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineDownloadItem.pathChanged() --> void"
<< "QQuickWebEngineDownloadItem.accept() --> void"
<< "QQuickWebEngineDownloadItem.cancel() --> void"
- << "QQuickWebEngineDownloadItem.UnknownSaveFormat --> SavePageFormat"
- << "QQuickWebEngineDownloadItem.SingleHtmlSaveFormat --> SavePageFormat"
- << "QQuickWebEngineDownloadItem.CompleteHtmlSaveFormat --> SavePageFormat"
- << "QQuickWebEngineDownloadItem.MimeHtmlSaveFormat --> SavePageFormat"
- << "QQuickWebEngineDownloadItem.savePageFormat --> SavePageFormat"
- << "QQuickWebEngineDownloadItem.savePageFormatChanged() --> void"
<< "QQuickWebEngineHistory.items --> QQuickWebEngineHistoryListModel*"
<< "QQuickWebEngineHistory.backItems --> QQuickWebEngineHistoryListModel*"
<< "QQuickWebEngineHistory.forwardItems --> QQuickWebEngineHistoryListModel*"
@@ -437,7 +280,6 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineProfile.httpAcceptLanguageChanged() --> void"
<< "QQuickWebEngineProfile.downloadRequested(QQuickWebEngineDownloadItem*) --> void"
<< "QQuickWebEngineProfile.downloadFinished(QQuickWebEngineDownloadItem*) --> void"
- << "QQuickWebEngineProfile.NoCache --> HttpCacheType"
<< "QQuickWebEngineScript.Deferred --> InjectionPoint"
<< "QQuickWebEngineScript.DocumentReady --> InjectionPoint"
<< "QQuickWebEngineScript.DocumentCreation --> InjectionPoint"
@@ -491,16 +333,6 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineSettings.pluginsEnabledChanged() --> void"
<< "QQuickWebEngineSettings.fullScreenSupportEnabledChanged() --> void"
<< "QQuickWebEngineSettings.defaultTextEncodingChanged() --> void"
- << "QQuickWebEngineSettings.screenCaptureEnabled --> bool"
- << "QQuickWebEngineSettings.webGLEnabled --> bool"
- << "QQuickWebEngineSettings.accelerated2dCanvasEnabled --> bool"
- << "QQuickWebEngineSettings.autoLoadIconsForPage --> bool"
- << "QQuickWebEngineSettings.touchIconsEnabled --> bool"
- << "QQuickWebEngineSettings.screenCaptureEnabledChanged() --> void"
- << "QQuickWebEngineSettings.webGLEnabledChanged() --> void"
- << "QQuickWebEngineSettings.accelerated2dCanvasEnabledChanged() --> void"
- << "QQuickWebEngineSettings.autoLoadIconsForPageChanged() --> void"
- << "QQuickWebEngineSettings.touchIconsEnabledChanged() --> void"
<< "QQuickWebEngineFullScreenRequest.origin --> QUrl"
<< "QQuickWebEngineFullScreenRequest.toggleOn --> bool"
<< "QQuickWebEngineFullScreenRequest.accept() --> void"
diff --git a/tests/auto/quick/qmltests/data/TestWebEngineView.qml b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
index 0d2a34645..34fc5fb2f 100644
--- a/tests/auto/quick/qmltests/data/TestWebEngineView.qml
+++ b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
@@ -28,7 +28,7 @@
import QtQuick 2.0
import QtTest 1.0
-import QtWebEngine 1.3
+import QtWebEngine 1.2
WebEngineView {
property var loadStatus: null
diff --git a/tests/auto/quick/qmltests/data/favicon-candidates-gray.html b/tests/auto/quick/qmltests/data/favicon-candidates-gray.html
deleted file mode 100644
index 3cbc4a4c3..000000000
--- a/tests/auto/quick/qmltests/data/favicon-candidates-gray.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<html>
- <head>
- <title>Gray Candidate Favicons Test</title>
- <link rel="shortcut icon" href="icons/gray16.png" />
- <link rel="shortcut icon" href="icons/gray32.png" />
- <link rel="shortcut icon" href="icons/gray64.png" />
- <link rel="shortcut icon" href="icons/gray128.png" />
- <link rel="shortcut icon" href="icons/gray255.png" />
- </head>
- <body>
- <h1>Gray Candidate Favicons Test</h1>
- <table style="width:100%">
- <tr>
- <td align="center"><img src="icons/gray16.png" height="16" width="16" /></td>
- <td align="center"><img src="icons/gray32.png" height="32" width="32" /></td>
- <td align="center"><img src="icons/gray64.png" height="64" width="64" /></td>
- <td align="center"><img src="icons/gray128.png" height="128" width="128" /></td>
- <td align="center"><img src="icons/gray255.png" height="255" width="255" /></td>
- </tr>
- <tr>
- <td align="center">16x16</td>
- <td align="center">32x32</td>
- <td align="center">64x64</td>
- <td align="center">128x128</td>
- <td align="center">255x255</td>
- </tr>
- </table>
- </body>
-</html>
diff --git a/tests/auto/quick/qmltests/data/favicon-misc.html b/tests/auto/quick/qmltests/data/favicon-misc.html
deleted file mode 100644
index 9e788bdf4..000000000
--- a/tests/auto/quick/qmltests/data/favicon-misc.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="shortcut icon" href="icons/qt32.ico" />
- <link rel="apple-touch-icon" href="icons/qt144.png" />
- <link rel="shortcut icon" href="icons/unavailable.ico" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/quick/qmltests/data/favicon-multi-gray.html b/tests/auto/quick/qmltests/data/favicon-multi-gray.html
deleted file mode 100644
index 9b9b7432d..000000000
--- a/tests/auto/quick/qmltests/data/favicon-multi-gray.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<html>
- <head>
- <title>Gray Multi-sized Favicon Test</title>
- <link rel="shortcut icon" href="icons/grayicons.ico" />
- </head>
- <body>
- <h1>Gray Multi-sized Favicon Test</h1>
- <table style="width:100%">
- <tr>
- <td align="center"><img src="icons/gray16.png" height="16" width="16" /></td>
- <td align="center"><img src="icons/gray32.png" height="32" width="32" /></td>
- <td align="center"><img src="icons/gray64.png" height="64" width="64" /></td>
- <td align="center"><img src="icons/gray128.png" height="128" width="128" /></td>
- <td align="center"><img src="icons/gray255.png" height="255" width="255" /></td>
- </tr>
- <tr>
- <td align="center">16x16</td>
- <td align="center">32x32</td>
- <td align="center">64x64</td>
- <td align="center">128x128</td>
- <td align="center">255x255</td>
- </tr>
- </table>
- </body>
-</html>
diff --git a/tests/auto/quick/qmltests/data/favicon-multi.html b/tests/auto/quick/qmltests/data/favicon-multi.html
deleted file mode 100644
index cc5f3fd66..000000000
--- a/tests/auto/quick/qmltests/data/favicon-multi.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
- <head>
- <title>Multi-sized Favicon Test</title>
- <link rel="shortcut icon" sizes="16x16 32x23 64x64" href="icons/qtmulti.ico" />
- </head>
- <body>
- <h1>Multi-sized Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/quick/qmltests/data/favicon-shortcut.html b/tests/auto/quick/qmltests/data/favicon-shortcut.html
deleted file mode 100644
index 786cdb816..000000000
--- a/tests/auto/quick/qmltests/data/favicon-shortcut.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="shortcut icon" href="icons/qt32.ico" />
- <link rel="shortcut icon" href="icons/qt144.png" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/quick/qmltests/data/favicon-single.html b/tests/auto/quick/qmltests/data/favicon-single.html
deleted file mode 100644
index eb4675c75..000000000
--- a/tests/auto/quick/qmltests/data/favicon-single.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="shortcut icon" href="icons/qt32.ico" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/quick/qmltests/data/favicon-touch.html b/tests/auto/quick/qmltests/data/favicon-touch.html
deleted file mode 100644
index 271783434..000000000
--- a/tests/auto/quick/qmltests/data/favicon-touch.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="apple-touch-icon" href="icons/qt32.ico" />
- <link rel="apple-touch-icon" href="icons/qt144.png" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/quick/qmltests/data/favicon-unavailable.html b/tests/auto/quick/qmltests/data/favicon-unavailable.html
deleted file mode 100644
index c45664294..000000000
--- a/tests/auto/quick/qmltests/data/favicon-unavailable.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="shortcut icon" href="icons/unavailable.ico" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/quick/qmltests/data/test4.html b/tests/auto/quick/qmltests/data/test4.html
index 142b53668..8f75af606 100644
--- a/tests/auto/quick/qmltests/data/test4.html
+++ b/tests/auto/quick/qmltests/data/test4.html
@@ -12,17 +12,6 @@
<meta name="viewport" content="initial-scale=2.0"/>
</head>
<body>
- <button onclick="scrollWin()", id="scroll">Click me to scroll!</button><br><br>
-
- <script>
- window.onload = function() {
- document.getElementById("scroll").focus();
- }
-
- function scrollWin() {
- window.scrollTo(0, 600);
- }
- </script>
<div id="content">
bla00<br/>
bla01<br/>
diff --git a/tests/auto/quick/qmltests/data/tst_favIconLoad.qml b/tests/auto/quick/qmltests/data/tst_favIconLoad.qml
new file mode 100644
index 000000000..df5479eec
--- /dev/null
+++ b/tests/auto/quick/qmltests/data/tst_favIconLoad.qml
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtTest 1.0
+import QtWebEngine 1.2
+
+TestWebEngineView {
+ id: webEngineView
+ width: 200
+ height: 400
+
+ SignalSpy {
+ id: spy
+ target: webEngineView
+ signalName: "iconChanged"
+ }
+
+ // FIXME: This test is flaky if the loading of the icon image is asynchronous,
+ // because the iconChanged signal is emitted before the image has been downloaded.
+ // We can set this property to true after we have some kind of favicon downloading
+ // logic in the WebEngine.
+
+ Image {
+ id: favicon
+ asynchronous: false
+ source: webEngineView.icon
+ }
+
+ TestCase {
+ id: test
+ name: "WebEngineViewLoadFavIcon"
+ when: windowShown
+
+ function init() {
+ if (webEngineView.icon != '') {
+ // If this is not the first test, then load a blank page without favicon, restoring the initial state.
+ webEngineView.url = 'about:blank'
+ verify(webEngineView.waitForLoadSucceeded())
+ spy.wait()
+ }
+ spy.clear()
+ }
+
+ function test_favIconLoad() {
+ compare(spy.count, 0)
+ var url = Qt.resolvedUrl("favicon.html")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+ spy.wait()
+ compare(spy.count, 1)
+ compare(favicon.width, 48)
+ compare(favicon.height, 48)
+ }
+
+ function test_favIconLoadEncodedUrl() {
+ compare(spy.count, 0)
+ var url = Qt.resolvedUrl("favicon2.html?favicon=load should work with#whitespace!")
+ webEngineView.url = url
+ verify(webEngineView.waitForLoadSucceeded())
+ spy.wait()
+ compare(spy.count, 1)
+ compare(favicon.width, 16)
+ compare(favicon.height, 16)
+ }
+ }
+}
diff --git a/tests/auto/quick/qmltests/data/tst_favicon.qml b/tests/auto/quick/qmltests/data/tst_favicon.qml
deleted file mode 100644
index f8ad998ef..000000000
--- a/tests/auto/quick/qmltests/data/tst_favicon.qml
+++ /dev/null
@@ -1,328 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.3
-import QtWebEngine.testsupport 1.0
-
-TestWebEngineView {
- id: webEngineView
- width: 200
- height: 400
-
- testSupport: WebEngineTestSupport {
- property var errorPageLoadStatus: null
-
- function waitForErrorPageLoadSucceeded() {
- var success = _waitFor(function() { return testSupport.errorPageLoadStatus == WebEngineView.LoadSucceededStatus })
- testSupport.errorPageLoadStatus = null
- return success
- }
-
- errorPage.onLoadingChanged: {
- errorPageLoadStatus = loadRequest.status
- }
- }
-
- function removeFaviconProviderPrefix(url) {
- return url.toString().substring(16)
- }
-
- SignalSpy {
- id: iconChangedSpy
- target: webEngineView
- signalName: "iconChanged"
- }
-
- Image {
- id: favicon
- source: webEngineView.icon
- }
-
- TestCase {
- id: test
- name: "WebEngineFavicon"
- when: windowShown
-
-
- function init() {
- // It is worth to restore the initial state with loading a blank page before all test functions.
- webEngineView.url = 'about:blank'
- verify(webEngineView.waitForLoadSucceeded())
- iconChangedSpy.clear()
- }
-
- function test_faviconLoad() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("favicon.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
-
- compare(favicon.width, 48)
- compare(favicon.height, 48)
- }
-
- function test_faviconLoadEncodedUrl() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("favicon2.html?favicon=load should work with#whitespace!")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
-
- compare(favicon.width, 16)
- compare(favicon.height, 16)
- }
-
- function test_noFavicon() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("test1.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_aboutBlank() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("about:blank")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_unavailableFavicon() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("favicon-unavailable.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_errorPageEnabled() {
- WebEngine.settings.errorPageEnabled = true
-
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("invalid://url")
- webEngineView.url = url
- verify(webEngineView.testSupport.waitForErrorPageLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_errorPageDisabled() {
- WebEngine.settings.errorPageEnabled = false
-
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("invalid://url")
- webEngineView.url = url
- verify(webEngineView.waitForLoadFailed())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_bestFavicon() {
- compare(iconChangedSpy.count, 0)
- var url, iconUrl
-
- url = Qt.resolvedUrl("favicon-misc.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
-
- iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
- // Touch icon is ignored
- compare(iconUrl, Qt.resolvedUrl("icons/qt32.ico"))
- compare(favicon.width, 32)
- compare(favicon.height, 32)
-
- iconChangedSpy.clear()
-
- url = Qt.resolvedUrl("favicon-shortcut.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- verify(iconChangedSpy.count >= 1)
- iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
-
- // If the icon URL is empty we have to wait for
- // the second iconChanged signal that propagates the expected URL
- if (iconUrl == Qt.resolvedUrl("")) {
- tryCompare(iconChangedSpy, "count", 2)
- iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
- }
-
- compare(iconUrl, Qt.resolvedUrl("icons/qt144.png"))
- compare(favicon.width, 144)
- compare(favicon.height, 144)
- }
-
- function test_touchIcon() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("favicon-touch.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- compare(favicon.width, 0)
- compare(favicon.height, 0)
-
- WebEngine.settings.touchIconsEnabled = true
-
- url = Qt.resolvedUrl("favicon-touch.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
- compare(iconUrl, Qt.resolvedUrl("icons/qt144.png"))
- compare(iconChangedSpy.count, 1)
- compare(favicon.width, 144)
- compare(favicon.height, 144)
- }
-
- function test_multiIcon() {
- compare(iconChangedSpy.count, 0)
-
- var url = Qt.resolvedUrl("favicon-multi.html")
- webEngineView.url = url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
- compare(favicon.width, 64)
- compare(favicon.height, 64)
- }
-
- function test_faviconProvider_data() {
- return [
- { tag: "multi 8x8", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 8, value: 16 },
- { tag: "multi 16x16", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 16, value: 16 },
- { tag: "multi 17x17", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 17, value: 32 },
- { tag: "multi 31x31", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 31, value: 32 },
- { tag: "multi 32x32", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 32, value: 32 },
- { tag: "multi 33x33", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 33, value: 64 },
- { tag: "multi 64x64", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 64, value: 64 },
- { tag: "multi 128x128", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 128, value: 128 },
- { tag: "multi 255x255", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 255, value: 255 },
- { tag: "multi 256x256", url: Qt.resolvedUrl("favicon-multi-gray.html"), size: 256, value: 255 },
- { tag: "candidate 8x8", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 8, value: 16 },
- { tag: "candidate 16x16", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 16, value: 16 },
- { tag: "candidate 17x17", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 17, value: 32 },
- { tag: "candidate 31x31", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 31, value: 32 },
- { tag: "candidate 32x32", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 32, value: 32 },
- { tag: "candidate 33x33", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 33, value: 64 },
- { tag: "candidate 64x64", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 64, value: 64 },
- { tag: "candidate 128x128", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 128, value: 128 },
- { tag: "candidate 255x255", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 255, value: 255 },
- { tag: "candidate 256x256", url: Qt.resolvedUrl("favicon-candidates-gray.html"), size: 256, value: 255 },
- ];
- }
-
- function test_faviconProvider(row) {
- var faviconImage = Qt.createQmlObject("
- import QtQuick 2.5\n
- Image { sourceSize: Qt.size(width, height) }", test)
- var grabImage = Qt.createQmlObject("
- import QtQuick 2.5\n
- Image { }", test)
- var faviconCanvas = Qt.createQmlObject("
- import QtQuick 2.5\n
- Canvas { }", test)
-
- compare(iconChangedSpy.count, 0)
-
- webEngineView.url = row.url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
-
- faviconImage.width = row.size
- faviconImage.height = row.size
- faviconImage.source = webEngineView.icon
- verify(_waitFor(function() { return faviconImage.status == Image.Ready } ))
-
- faviconImage.grabToImage(function(result) {
- grabImage.source = result.url
- })
- verify(_waitFor(function() { return grabImage.status == Image.Ready } ))
-
- faviconCanvas.width = faviconImage.width
- faviconCanvas.height = faviconImage.height
- var ctx = faviconCanvas.getContext("2d")
- ctx.drawImage(grabImage, 0, 0, grabImage.width, grabImage.height)
-
- var center = Math.round(row.size/2)
- var imageData = ctx.getImageData(center, center, center, center)
- var pixel = imageData.data
-
- compare(pixel[0], row.value)
-
- faviconImage.destroy()
- grabImage.destroy()
- faviconCanvas.destroy()
- }
- }
-}
diff --git a/tests/auto/quick/qmltests/data/tst_faviconDownload.qml b/tests/auto/quick/qmltests/data/tst_faviconDownload.qml
deleted file mode 100644
index 406dfa3ea..000000000
--- a/tests/auto/quick/qmltests/data/tst_faviconDownload.qml
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.0
-import QtTest 1.0
-import QtWebEngine 1.3
-
-TestWebEngineView {
- id: webEngineView
- width: 200
- height: 400
-
- function removeFaviconProviderPrefix(url) {
- return url.toString().substring(16)
- }
-
- SignalSpy {
- id: iconChangedSpy
- target: webEngineView
- signalName: "iconChanged"
- }
-
- TestCase {
- id: test
- name: "WebEngineFaviconDownload"
-
- function init() {
- WebEngine.settings.autoLoadIconsForPage = true
- WebEngine.settings.touchIconsEnabled = false
-
- if (webEngineView.icon != '') {
- // If this is not the first test, then load a blank page without favicon, restoring the initial state.
- webEngineView.url = 'about:blank'
- verify(webEngineView.waitForLoadSucceeded())
- iconChangedSpy.wait()
- }
-
- iconChangedSpy.clear()
- }
-
- function cleanupTestCase() {
- WebEngine.settings.autoLoadIconsForPage = true
- WebEngine.settings.touchIconsEnabled = false
- }
-
- function test_downloadIconsDisabled_data() {
- return [
- { tag: "misc", url: Qt.resolvedUrl("favicon-misc.html") },
- { tag: "shortcut", url: Qt.resolvedUrl("favicon-shortcut.html") },
- { tag: "single", url: Qt.resolvedUrl("favicon-single.html") },
- { tag: "touch", url: Qt.resolvedUrl("favicon-touch.html") },
- { tag: "unavailable", url: Qt.resolvedUrl("favicon-unavailable.html") },
- ];
- }
-
- function test_downloadIconsDisabled(row) {
- WebEngine.settings.autoLoadIconsForPage = false
-
- compare(iconChangedSpy.count, 0)
-
- webEngineView.url = row.url
- verify(webEngineView.waitForLoadSucceeded())
-
- compare(iconChangedSpy.count, 0)
-
- var iconUrl = webEngineView.icon
- compare(iconUrl, Qt.resolvedUrl(""))
- }
-
- function test_downloadTouchIconsEnabled_data() {
- return [
- { tag: "misc", url: Qt.resolvedUrl("favicon-misc.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") },
- { tag: "shortcut", url: Qt.resolvedUrl("favicon-shortcut.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") },
- { tag: "single", url: Qt.resolvedUrl("favicon-single.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt32.ico") },
- { tag: "touch", url: Qt.resolvedUrl("favicon-touch.html"), expectedIconUrl: Qt.resolvedUrl("icons/qt144.png") },
- ];
- }
-
- function test_downloadTouchIconsEnabled(row) {
- WebEngine.settings.touchIconsEnabled = true
-
- compare(iconChangedSpy.count, 0)
-
- webEngineView.url = row.url
- verify(webEngineView.waitForLoadSucceeded())
-
- iconChangedSpy.wait()
- compare(iconChangedSpy.count, 1)
-
- var iconUrl = removeFaviconProviderPrefix(webEngineView.icon)
- compare(iconUrl, row.expectedIconUrl)
- }
- }
-}
-
diff --git a/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml b/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
index 86fb9281c..c50db7aa3 100644
--- a/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
+++ b/tests/auto/quick/qmltests/data/tst_keyboardModifierMapping.qml
@@ -52,25 +52,27 @@ TestWebEngineView {
onTriggered: parent.when = true
}
+ function getPressedModifiers() {
+ var pressedModifiers;
+ runJavaScript("getPressedModifiers()", function(result) {
+ pressedModifiers = result;
+ });
+ wait(200);
+ verify(function() { return pressedModifiers != undefined });
+ return pressedModifiers;
+ }
+
function test_keyboardModifierMapping() {
- skip("runJavaScript bug: QTBUG-51746")
webEngineView.url = Qt.resolvedUrl("keyboardModifierMapping.html")
waitForLoadSucceeded();
titleSpy.wait()
- var callbackCalled = false;
// Alt
keyPress(Qt.Key_Alt);
titleSpy.wait()
- runJavaScript("getPressedModifiers()", function(result) {
- compare(result, "alt:pressed ctrl:no meta:no");
- callbackCalled = true;
- });
- wait(100);
- verify(callbackCalled);
+ compare(getPressedModifiers(), "alt:pressed ctrl:no meta:no");
keyRelease(Qt.Key_Alt)
titleSpy.wait()
- callbackCalled = false;
// Ctrl
// On mac Qt automatically translates Meta to Ctrl and vice versa.
@@ -79,36 +81,18 @@ TestWebEngineView {
// For testing we assume that the flag Qt::AA_MacDontSwapCtrlAndMeta is NOT set.
keyPress(Qt.platform.os == "osx" ? Qt.Key_Meta : Qt.Key_Control);
titleSpy.wait()
- runJavaScript("getPressedModifiers()", function(result) {
- compare(result, "alt:released ctrl:pressed meta:no");
- callbackCalled = true;
- });
- wait(100);
- verify(callbackCalled);
+ compare(getPressedModifiers(), "alt:released ctrl:pressed meta:no");
keyRelease(Qt.platform.os == "osx" ? Qt.Key_Meta : Qt.Key_Control);
titleSpy.wait()
- callbackCalled = false;
// Meta (Command on Mac)
keyPress(Qt.platform.os == "osx" ? Qt.Key_Control : Qt.Key_Meta);
titleSpy.wait()
- runJavaScript("getPressedModifiers()", function(result) {
- compare(result, "alt:released ctrl:released meta:pressed");
- callbackCalled = true;
- });
- wait(100);
- verify(callbackCalled);
+ compare(getPressedModifiers(), "alt:released ctrl:released meta:pressed");
keyRelease(Qt.platform.os == "osx" ? Qt.Key_Control : Qt.Key_Meta);
titleSpy.wait()
- callbackCalled = false;
- runJavaScript("getPressedModifiers()", function(result) {
- compare(result, "alt:released ctrl:released meta:released");
- callbackCalled = true;
- });
- wait(100);
- verify(callbackCalled);
- callbackCalled = false;
+ compare(getPressedModifiers(), "alt:released ctrl:released meta:released");
}
}
}
diff --git a/tests/auto/quick/qmltests/data/tst_runJavaScript.qml b/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
index 2011d2a5c..beeebc049 100644
--- a/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
+++ b/tests/auto/quick/qmltests/data/tst_runJavaScript.qml
@@ -44,7 +44,6 @@ TestWebEngineView {
TestCase {
name: "WebEngineViewRunJavaScript"
function test_runJavaScript() {
- skip("runJavaScript bug: QTBUG-51746")
var testTitle = "Title to test runJavaScript";
runJavaScript("document.title = \"" + testTitle +"\"");
_waitFor(function() { spy.count > 0; });
diff --git a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml b/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
deleted file mode 100644
index 55b71189d..000000000
--- a/tests/auto/quick/qmltests/data/tst_scrollPosition.qml
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import QtQuick 2.2
-import QtTest 1.0
-import QtWebEngine 1.3
-
-TestWebEngineView {
- id: webEngineView
- width: 300
- height: 400
-
- property var testUrl: Qt.resolvedUrl("test4.html")
-
- SignalSpy {
- id: scrollPositionSpy
- target: webEngineView
- signalName: "onScrollPositionChanged"
- }
-
- TestCase {
- name: "ScrollPosition"
- when: windowShown
-
- function init() {
- webEngineView.url = Qt.resolvedUrl("about:blank");
- verify(webEngineView.waitForLoadSucceeded());
- }
-
- function test_scrollPosition() {
- webEngineView.url = testUrl;
- verify(webEngineView.waitForLoadSucceeded());
-
- keyPress(Qt.Key_Return); // Focus is on the scroll button.
-
- tryCompare(scrollPositionSpy, "count", 1);
- compare(webEngineView.scrollPosition.x, 0);
- compare(webEngineView.scrollPosition.y, 600);
- }
-
- function test_scrollPositionAfterReload() {
- webEngineView.url = testUrl;
- verify(webEngineView.waitForLoadSucceeded());
- tryCompare(webEngineView.scrollPosition, "y", 0);
-
- keyPress(Qt.Key_Return); // Focus is on the scroll button.
-
- // Wait for proper scroll position change otherwise we cannot expect
- // the new y position after reload.
- tryCompare(webEngineView.scrollPosition, "x", 0);
- tryCompare(webEngineView.scrollPosition, "y", 600);
-
- webEngineView.reload();
- verify(webEngineView.waitForLoadSucceeded());
-
- tryCompare(webEngineView.scrollPosition, "x", 0);
- tryCompare(webEngineView.scrollPosition, "y", 600);
- }
- }
-}
diff --git a/tests/auto/quick/qmltests/qmltests.pro b/tests/auto/quick/qmltests/qmltests.pro
index 0158a7268..db75586fc 100644
--- a/tests/auto/quick/qmltests/qmltests.pro
+++ b/tests/auto/quick/qmltests/qmltests.pro
@@ -16,14 +16,6 @@ OTHER_FILES += \
$$PWD/data/directoryupload.html \
$$PWD/data/favicon.html \
$$PWD/data/favicon2.html \
- $$PWD/data/favicon-candidates-gray.html \
- $$PWD/data/favicon-misc.html \
- $$PWD/data/favicon-multi.html \
- $$PWD/data/favicon-multi-gray.html \
- $$PWD/data/favicon-single.html \
- $$PWD/data/favicon-shortcut.html \
- $$PWD/data/favicon-touch.html \
- $$PWD/data/favicon-unavailable.html \
$$PWD/data/forms.html \
$$PWD/data/geolocation.html \
$$PWD/data/javascript.html \
@@ -42,8 +34,7 @@ OTHER_FILES += \
$$PWD/data/titleupdate.js \
$$PWD/data/tst_desktopBehaviorLoadHtml.qml \
$$PWD/data/tst_download.qml \
- $$PWD/data/tst_favicon.qml \
- $$PWD/data/tst_faviconDownload.qml \
+ $$PWD/data/tst_favIconLoad.qml \
$$PWD/data/tst_filePicker.qml \
$$PWD/data/tst_formValidation.qml \
$$PWD/data/tst_geopermission.qml \
@@ -59,7 +50,6 @@ OTHER_FILES += \
$$PWD/data/tst_navigationRequested.qml \
$$PWD/data/tst_properties.qml \
$$PWD/data/tst_runJavaScript.qml \
- $$PWD/data/tst_scrollPosition.qml \
$$PWD/data/tst_titleChanged.qml \
$$PWD/data/tst_unhandledKeyEventPropagation.qml \
$$PWD/data/tst_userScripts.qml \
@@ -67,16 +57,7 @@ OTHER_FILES += \
$$PWD/data/tst_settings.qml \
$$PWD/data/tst_keyboardModifierMapping.qml \
$$PWD/data/icons/favicon.png \
- $$PWD/data/icons/gray128.png \
- $$PWD/data/icons/gray16.png \
- $$PWD/data/icons/gray255.png \
- $$PWD/data/icons/gray32.png \
- $$PWD/data/icons/gray64.png \
- $$PWD/data/icons/grayicons.ico \
$$PWD/data/icons/small-favicon.png \
- $$PWD/data/icons/qt144.png \
- $$PWD/data/icons/qt32.ico \
- $$PWD/data/icons/qtmulti.ico \
$$PWD/mock-delegates/QtWebEngine/UIDelegates/AlertDialog.qml \
$$PWD/mock-delegates/QtWebEngine/UIDelegates/ConfirmDialog.qml \
$$PWD/mock-delegates/QtWebEngine/UIDelegates/FilePicker.qml \
diff --git a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
index b71b9dd08..419643b47 100644
--- a/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
+++ b/tests/auto/quick/qquickwebengineview/tst_qquickwebengineview.cpp
@@ -71,7 +71,6 @@ private Q_SLOTS:
void inputMethodHints();
void basicRenderingSanity();
void setZoomFactor();
- void printToPdf();
void stopSettingFocusWhenDisabled();
void stopSettingFocusWhenDisabled_data();
void inputEventForwardingDisabledWhenActiveFocusOnPressDisabled();
@@ -494,27 +493,6 @@ void tst_QQuickWebEngineView::setZoomFactor()
QVERIFY(qFuzzyCompare(view->zoomFactor(), 2.5));
}
-void tst_QQuickWebEngineView::printToPdf()
-{
- QTemporaryDir tempDir(QDir::tempPath() + "/tst_qwebengineview-XXXXXX");
- QVERIFY(tempDir.isValid());
- QQuickWebEngineView *view = webEngineView();
- view->setUrl(urlFromTestPath("html/basic_page.html"));
- QVERIFY(waitForLoadSucceeded(view));
-
- QString path = tempDir.path() + "/print_success.pdf";
- view->printToPdf(path, QQuickWebEngineView::A4, QQuickWebEngineView::Portrait);
- QTRY_VERIFY(QFile::exists(path));
-
-#if !defined(Q_OS_WIN)
- path = tempDir.path() + "/print_//fail.pdf";
-#else
- path = tempDir.path() + "/print_|fail.pdf";
-#endif // #if !defined(Q_OS_WIN)
- view->printToPdf(path, QQuickWebEngineView::A4, QQuickWebEngineView::Portrait);
- QTRY_VERIFY(!QFile::exists(path));
-}
-
void tst_QQuickWebEngineView::stopSettingFocusWhenDisabled()
{
QFETCH(bool, viewEnabled);
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/qwebenginefaviconmanager.pro b/tests/auto/widgets/qwebenginefaviconmanager/qwebenginefaviconmanager.pro
deleted file mode 100644
index e99c7f493..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/qwebenginefaviconmanager.pro
+++ /dev/null
@@ -1 +0,0 @@
-include(../tests.pri)
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-misc.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-misc.html
deleted file mode 100644
index 9e788bdf4..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-misc.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="shortcut icon" href="icons/qt32.ico" />
- <link rel="apple-touch-icon" href="icons/qt144.png" />
- <link rel="shortcut icon" href="icons/unavailable.ico" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-multi.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-multi.html
deleted file mode 100644
index cc5f3fd66..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-multi.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
- <head>
- <title>Multi-sized Favicon Test</title>
- <link rel="shortcut icon" sizes="16x16 32x23 64x64" href="icons/qtmulti.ico" />
- </head>
- <body>
- <h1>Multi-sized Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-shortcut.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-shortcut.html
deleted file mode 100644
index 786cdb816..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-shortcut.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="shortcut icon" href="icons/qt32.ico" />
- <link rel="shortcut icon" href="icons/qt144.png" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-single.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-single.html
deleted file mode 100644
index eb4675c75..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-single.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="shortcut icon" href="icons/qt32.ico" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-touch.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-touch.html
deleted file mode 100644
index 271783434..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-touch.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="apple-touch-icon" href="icons/qt32.ico" />
- <link rel="apple-touch-icon" href="icons/qt144.png" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-unavailable.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-unavailable.html
deleted file mode 100644
index c45664294..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/resources/favicon-unavailable.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
- <head>
- <title>Favicon Test</title>
- <link rel="shortcut icon" href="icons/unavailable.ico" />
- </head>
- <body>
- <h1>Favicon Test</h1>
- </body>
-</html>
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt144.png b/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt144.png
deleted file mode 100644
index 050b1e066..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt144.png
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt32.ico b/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt32.ico
deleted file mode 100644
index 2f6fcb5bc..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qt32.ico
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qtmulti.ico b/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qtmulti.ico
deleted file mode 100644
index 81e5a22e8..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/resources/icons/qtmulti.ico
+++ /dev/null
Binary files differ
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/resources/test1.html b/tests/auto/widgets/qwebenginefaviconmanager/resources/test1.html
deleted file mode 100644
index b323f966e..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/resources/test1.html
+++ /dev/null
@@ -1 +0,0 @@
-<html><body><p>Some text 1</p></body></html>
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp b/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp
deleted file mode 100644
index 38311cad2..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp
+++ /dev/null
@@ -1,478 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
-#include "../util.h"
-
-#include <qwebenginepage.h>
-#include <qwebenginesettings.h>
-#include <qwebengineview.h>
-
-
-class tst_QWebEngineFaviconManager : public QObject {
- Q_OBJECT
-
-public Q_SLOTS:
- void init();
- void initTestCase();
- void cleanupTestCase();
- void cleanup();
-
-private Q_SLOTS:
- void faviconLoad();
- void faviconLoadFromResources();
- void faviconLoadEncodedUrl();
- void noFavicon();
- void aboutBlank();
- void unavailableFavicon();
- void errorPageEnabled();
- void errorPageDisabled();
- void bestFavicon();
- void touchIcon();
- void multiIcon();
- void candidateIcon();
- void downloadIconsDisabled_data();
- void downloadIconsDisabled();
- void downloadTouchIconsEnabled_data();
- void downloadTouchIconsEnabled();
-
-private:
- QWebEngineView *m_view;
- QWebEnginePage *m_page;
-};
-
-
-void tst_QWebEngineFaviconManager::init()
-{
- m_view = new QWebEngineView();
- m_page = m_view->page();
-}
-
-
-void tst_QWebEngineFaviconManager::initTestCase()
-{
-}
-
-void tst_QWebEngineFaviconManager::cleanupTestCase()
-{
-}
-
-
-void tst_QWebEngineFaviconManager::cleanup()
-{
- delete m_view;
-}
-
-void tst_QWebEngineFaviconManager::faviconLoad()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-single.html"));
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(iconUrl, m_page->iconUrl());
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qt32.ico")));
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QCOMPARE(icon.availableSizes().count(), 1);
- QSize iconSize = icon.availableSizes().first();
- QCOMPARE(iconSize, QSize(32, 32));
-}
-
-void tst_QWebEngineFaviconManager::faviconLoadFromResources()
-{
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url("qrc:/resources/favicon-single.html");
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(iconUrl, m_page->iconUrl());
- QCOMPARE(iconUrl, QUrl("qrc:/resources/icons/qt32.ico"));
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QCOMPARE(icon.availableSizes().count(), 1);
- QSize iconSize = icon.availableSizes().first();
- QCOMPARE(iconSize, QSize(32, 32));
-}
-
-void tst_QWebEngineFaviconManager::faviconLoadEncodedUrl()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QString urlString = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-single.html")).toString();
- QUrl url(urlString + QLatin1String("?favicon=load should work with#whitespace!"));
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(m_page->iconUrl(), iconUrl);
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qt32.ico")));
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QCOMPARE(icon.availableSizes().count(), 1);
- QSize iconSize = icon.availableSizes().first();
- QCOMPARE(iconSize, QSize(32, 32));
-}
-
-void tst_QWebEngineFaviconManager::noFavicon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/test1.html"));
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_QWebEngineFaviconManager::aboutBlank()
-{
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url("about:blank");
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_QWebEngineFaviconManager::unavailableFavicon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-unavailable.html"));
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_QWebEngineFaviconManager::errorPageEnabled()
-{
- m_page->settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, true);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url("invalid://url");
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_QWebEngineFaviconManager::errorPageDisabled()
-{
- m_page->settings()->setAttribute(QWebEngineSettings::ErrorPageEnabled, false);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url("invalid://url");
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_QWebEngineFaviconManager::bestFavicon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url, iconUrl;
- QIcon icon;
- QSize iconSize;
-
- url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-misc.html"));
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(iconUrl, m_page->iconUrl());
- // Touch icon is ignored
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qt32.ico")));
-
- icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QCOMPARE(icon.availableSizes().count(), 1);
- iconSize = icon.availableSizes().first();
- QCOMPARE(iconSize, QSize(32, 32));
-
- loadFinishedSpy.clear();
- iconUrlChangedSpy.clear();
- iconChangedSpy.clear();
-
- url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-shortcut.html"));
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QTRY_VERIFY(iconUrlChangedSpy.count() >= 1);
- QTRY_VERIFY(iconChangedSpy.count() >= 1);
-
- iconUrl = iconUrlChangedSpy.last().at(0).toString();
-
- // If the icon URL is empty we have to wait for
- // the second iconChanged signal that propagates the expected URL
- if (iconUrl.isEmpty()) {
- QTRY_COMPARE(iconUrlChangedSpy.count(), 2);
- QTRY_COMPARE(iconChangedSpy.count(), 2);
- iconUrl = iconUrlChangedSpy.last().at(0).toString();
- }
-
- QCOMPARE(iconUrl, m_page->iconUrl());
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qt144.png")));
-
- icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QVERIFY(icon.availableSizes().count() >= 1);
- QVERIFY(icon.availableSizes().contains(QSize(144, 144)));
-}
-
-void tst_QWebEngineFaviconManager::touchIcon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-touch.html"));
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_QWebEngineFaviconManager::multiIcon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-multi.html"));
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(m_page->iconUrl(), iconUrl);
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qtmulti.ico")));
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
- QCOMPARE(icon.availableSizes().count(), 3);
- QVERIFY(icon.availableSizes().contains(QSize(16, 16)));
- QVERIFY(icon.availableSizes().contains(QSize(32, 32)));
- QVERIFY(icon.availableSizes().contains(QSize(64, 64)));
-}
-
-void tst_QWebEngineFaviconManager::candidateIcon()
-{
- if (!QDir(TESTS_SOURCE_DIR).exists())
- W_QSKIP(QString("This test requires access to resources found in '%1'").arg(TESTS_SOURCE_DIR).toLatin1().constData(), SkipAll);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- QUrl url = QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/favicon-shortcut.html"));
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- QUrl iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(m_page->iconUrl(), iconUrl);
- QCOMPARE(iconUrl, QUrl::fromLocalFile(TESTS_SOURCE_DIR + QLatin1String("qwebenginefaviconmanager/resources/icons/qt144.png")));
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
- QCOMPARE(icon.availableSizes().count(), 2);
- QVERIFY(icon.availableSizes().contains(QSize(32, 32)));
- QVERIFY(icon.availableSizes().contains(QSize(144, 144)));
-}
-
-void tst_QWebEngineFaviconManager::downloadIconsDisabled_data()
-{
- QTest::addColumn<QUrl>("url");
- QTest::newRow("misc") << QUrl("qrc:/resources/favicon-misc.html");
- QTest::newRow("shortcut") << QUrl("qrc:/resources/favicon-shortcut.html");
- QTest::newRow("single") << QUrl("qrc:/resources/favicon-single.html");
- QTest::newRow("touch") << QUrl("qrc:/resources/favicon-touch.html");
- QTest::newRow("unavailable") << QUrl("qrc:/resources/favicon-unavailable.html");
-}
-
-void tst_QWebEngineFaviconManager::downloadIconsDisabled()
-{
- QFETCH(QUrl, url);
-
- m_page->settings()->setAttribute(QWebEngineSettings::AutoLoadIconsForPage, false);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QCOMPARE(iconUrlChangedSpy.count(), 0);
- QCOMPARE(iconChangedSpy.count(), 0);
-
- QVERIFY(m_page->iconUrl().isEmpty());
- QVERIFY(m_page->icon().isNull());
-}
-
-void tst_QWebEngineFaviconManager::downloadTouchIconsEnabled_data()
-{
- QTest::addColumn<QUrl>("url");
- QTest::addColumn<QUrl>("expectedIconUrl");
- QTest::addColumn<QSize>("expectedIconSize");
- QTest::newRow("misc") << QUrl("qrc:/resources/favicon-misc.html") << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144);
- QTest::newRow("shortcut") << QUrl("qrc:/resources/favicon-shortcut.html") << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144);
- QTest::newRow("single") << QUrl("qrc:/resources/favicon-single.html") << QUrl("qrc:/resources/icons/qt32.ico") << QSize(32, 32);
- QTest::newRow("touch") << QUrl("qrc:/resources/favicon-touch.html") << QUrl("qrc:/resources/icons/qt144.png") << QSize(144, 144);
-}
-
-void tst_QWebEngineFaviconManager::downloadTouchIconsEnabled()
-{
- QFETCH(QUrl, url);
- QFETCH(QUrl, expectedIconUrl);
- QFETCH(QSize, expectedIconSize);
-
- m_page->settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, true);
-
- QSignalSpy loadFinishedSpy(m_page, SIGNAL(loadFinished(bool)));
- QSignalSpy iconUrlChangedSpy(m_page, SIGNAL(iconUrlChanged(QUrl)));
- QSignalSpy iconChangedSpy(m_page, SIGNAL(iconChanged(QIcon)));
-
- m_page->load(url);
-
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
- QTRY_COMPARE(iconUrlChangedSpy.count(), 1);
- QTRY_COMPARE(iconChangedSpy.count(), 1);
-
- const QUrl &iconUrl = iconUrlChangedSpy.at(0).at(0).toString();
- QCOMPARE(m_page->iconUrl(), iconUrl);
- QCOMPARE(iconUrl, expectedIconUrl);
-
- const QIcon &icon = m_page->icon();
- QVERIFY(!icon.isNull());
-
- QVERIFY(icon.availableSizes().count() >= 1);
- QVERIFY(icon.availableSizes().contains(expectedIconSize));
-}
-
-QTEST_MAIN(tst_QWebEngineFaviconManager)
-
-#include "tst_qwebenginefaviconmanager.moc"
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.qrc b/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.qrc
deleted file mode 100644
index a352f8a83..000000000
--- a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.qrc
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource>
- <file>resources/favicon-misc.html</file>
- <file>resources/favicon-multi.html</file>
- <file>resources/favicon-shortcut.html</file>
- <file>resources/favicon-single.html</file>
- <file>resources/favicon-touch.html</file>
- <file>resources/favicon-unavailable.html</file>
- <file>resources/icons/qt144.png</file>
- <file>resources/icons/qt32.ico</file>
- <file>resources/icons/qtmulti.ico</file>
- <file>resources/test1.html</file>
-</qresource>
-</RCC>
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index 1629ec617..fcd40d4cc 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -241,8 +241,6 @@ private Q_SLOTS:
void setZoomFactor();
void mouseButtonTranslation();
- void printToPdf();
-
private:
static QPoint elementCenter(QWebEnginePage *page, const QString &id);
@@ -4221,6 +4219,9 @@ void tst_QWebEnginePage::baseUrl()
void tst_QWebEnginePage::scrollPosition()
{
+#if !defined(QWEBENGINEPAGE_EVALUATEJAVASCRIPT)
+ QSKIP("QWEBENGINEPAGE_EVALUATEJAVASCRIPT");
+#else
// enlarged image in a small viewport, to provoke the scrollbars to appear
QString html("<html><body><img src='qrc:/image.png' height=500 width=500/></body></html>");
@@ -4243,6 +4244,7 @@ void tst_QWebEnginePage::scrollPosition()
int y = evaluateJavaScriptSync(view.page(), "window.scrollY").toInt();
QCOMPARE(x, 23);
QCOMPARE(y, 29);
+#endif
}
void tst_QWebEnginePage::scrollToAnchor()
@@ -4926,37 +4928,6 @@ void tst_QWebEnginePage::setZoomFactor()
delete page;
}
-void tst_QWebEnginePage::printToPdf()
-{
- QTemporaryDir tempDir(QDir::tempPath() + "/tst_qwebengineview-XXXXXX");
- QVERIFY(tempDir.isValid());
- QWebEnginePage page;
- QSignalSpy spy(&page, SIGNAL(loadFinished(bool)));
- page.load(QUrl("qrc:///resources/basic_printing_page.html"));
- QTRY_VERIFY(spy.count() == 1);
-
- QPageLayout layout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0.0, 0.0, 0.0, 0.0));
- QString path = tempDir.path() + "/print_1_success.pdf";
- page.printToPdf(path, layout);
- QTRY_VERIFY(QFile::exists(path));
-
-#if !defined(Q_OS_WIN)
- path = tempDir.path() + "/print_//2_failed.pdf";
-#else
- path = tempDir.path() + "/print_|2_failed.pdf";
-#endif
- page.printToPdf(path, QPageLayout());
- QTRY_VERIFY(!QFile::exists(path));
-
- CallbackSpy<QByteArray> successfulSpy;
- page.printToPdf(successfulSpy.ref(), layout);
- QVERIFY(successfulSpy.waitForResult().length() > 0);
-
- CallbackSpy<QByteArray> failedInvalidLayoutSpy;
- page.printToPdf(failedInvalidLayoutSpy.ref(), QPageLayout());
- QCOMPARE(failedInvalidLayoutSpy.waitForResult().length(), 0);
-}
-
void tst_QWebEnginePage::mouseButtonTranslation()
{
QWebEngineView *view = new QWebEngineView;
diff --git a/tests/auto/widgets/qwebengineprofile/BLACKLIST b/tests/auto/widgets/qwebengineprofile/BLACKLIST
deleted file mode 100644
index fc1c957dd..000000000
--- a/tests/auto/widgets/qwebengineprofile/BLACKLIST
+++ /dev/null
@@ -1,5 +0,0 @@
-[clearDataFromCache]
-*
-[disableCache]
-*
-
diff --git a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
index 579a0f776..8c7a0d399 100644
--- a/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
+++ b/tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp
@@ -44,8 +44,6 @@ class tst_QWebEngineProfile : public QObject
private Q_SLOTS:
void defaultProfile();
void profileConstructors();
- void clearDataFromCache();
- void disableCache();
void urlSchemeHandlers();
void urlSchemeHandlerFailRequest();
void urlSchemeHandlerFailOnRead();
@@ -78,77 +76,6 @@ void tst_QWebEngineProfile::profileConstructors()
QCOMPARE(diskProfile.persistentCookiesPolicy(), QWebEngineProfile::AllowPersistentCookies);
}
-void tst_QWebEngineProfile::clearDataFromCache()
-{
- QWebEnginePage page;
-
- QDir cacheDir("./tst_QWebEngineProfile_cacheDir");
- cacheDir.makeAbsolute();
- if (cacheDir.exists())
- cacheDir.removeRecursively();
- cacheDir.mkpath(cacheDir.path());
-
- QWebEngineProfile *profile = page.profile();
- profile->setCachePath(cacheDir.path());
- profile->setHttpCacheType(QWebEngineProfile::DiskHttpCache);
-
- QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
- page.load(QUrl("http://qt-project.org"));
- if (!loadFinishedSpy.wait(10000) || !loadFinishedSpy.at(0).at(0).toBool())
- QSKIP("Couldn't load page from network, skipping test.");
-
- cacheDir.refresh();
- QVERIFY(cacheDir.entryList().contains("Cache"));
- cacheDir.cd("./Cache");
- int filesBeforeClear = cacheDir.entryList().count();
-
- QFileSystemWatcher fileSystemWatcher;
- fileSystemWatcher.addPath(cacheDir.path());
- QSignalSpy directoryChangedSpy(&fileSystemWatcher, SIGNAL(directoryChanged(const QString &)));
-
- // It deletes most of the files, but not all of them.
- profile->clearHttpCache();
- QTest::qWait(1000);
- QTRY_VERIFY(directoryChangedSpy.count() > 0);
-
- cacheDir.refresh();
- QVERIFY(filesBeforeClear > cacheDir.entryList().count());
-
- cacheDir.removeRecursively();
-}
-
-void tst_QWebEngineProfile::disableCache()
-{
- QWebEnginePage page;
- QDir cacheDir("./tst_QWebEngineProfile_cacheDir");
- if (cacheDir.exists())
- cacheDir.removeRecursively();
- cacheDir.mkpath(cacheDir.path());
-
- QWebEngineProfile *profile = page.profile();
- profile->setCachePath(cacheDir.path());
- QVERIFY(!cacheDir.entryList().contains("Cache"));
-
- profile->setHttpCacheType(QWebEngineProfile::NoCache);
- QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
- page.load(QUrl("http://qt-project.org"));
- if (!loadFinishedSpy.wait(10000) || !loadFinishedSpy.at(0).at(0).toBool())
- QSKIP("Couldn't load page from network, skipping test.");
-
- cacheDir.refresh();
- QVERIFY(!cacheDir.entryList().contains("Cache"));
-
- profile->setHttpCacheType(QWebEngineProfile::DiskHttpCache);
- page.load(QUrl("http://qt-project.org"));
- if (!loadFinishedSpy.wait(10000) || !loadFinishedSpy.at(1).at(0).toBool())
- QSKIP("Couldn't load page from network, skipping test.");
-
- cacheDir.refresh();
- QVERIFY(cacheDir.entryList().contains("Cache"));
-
- cacheDir.removeRecursively();
-}
-
class RedirectingUrlSchemeHandler : public QWebEngineUrlSchemeHandler
{
public:
diff --git a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
index d5ecd8841..2c0b848c9 100644
--- a/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
+++ b/tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp
@@ -118,14 +118,12 @@ void tst_QWebEngineScript::scriptWorld()
page.load(QUrl("about:blank"));
waitForSignal(&page, SIGNAL(loadFinished(bool)));
QCOMPARE(evaluateJavaScriptSync(&page, "typeof(userScriptTest) != \"undefined\" && userScriptTest == 1;"), QVariant::fromValue(true));
- QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "typeof(userScriptTest) == \"undefined\"", QWebEngineScript::ApplicationWorld), QVariant::fromValue(true));
script.setWorldId(QWebEngineScript::ApplicationWorld);
page.scripts().clear();
page.scripts().insert(script);
page.load(QUrl("about:blank"));
waitForSignal(&page, SIGNAL(loadFinished(bool)));
QCOMPARE(evaluateJavaScriptSync(&page, "typeof(userScriptTest) == \"undefined\""), QVariant::fromValue(true));
- QCOMPARE(evaluateJavaScriptSyncInWorld(&page, "typeof(userScriptTest) != \"undefined\" && userScriptTest == 1;", QWebEngineScript::ApplicationWorld), QVariant::fromValue(true));
}
void tst_QWebEngineScript::scriptModifications()
@@ -183,9 +181,7 @@ void tst_QWebEngineScript::webChannel_data()
QTest::addColumn<int>("worldId");
QTest::addColumn<bool>("reloadFirst");
QTest::newRow("MainWorld") << static_cast<int>(QWebEngineScript::MainWorld) << false;
- QTest::newRow("ApplicationWorld") << static_cast<int>(QWebEngineScript::ApplicationWorld) << false;
QTest::newRow("MainWorldWithReload") << static_cast<int>(QWebEngineScript::MainWorld) << true;
- QTest::newRow("ApplicationWorldWithReload") << static_cast<int>(QWebEngineScript::ApplicationWorld) << true;
}
void tst_QWebEngineScript::webChannel()
@@ -196,7 +192,7 @@ void tst_QWebEngineScript::webChannel()
TestObject testObject;
QScopedPointer<QWebChannel> channel(new QWebChannel(this));
channel->registerObject(QStringLiteral("object"), &testObject);
- page.setWebChannel(channel.data(), worldId);
+ page.setWebChannel(channel.data());
QFile qwebchanneljs(":/qwebchannel.js");
QVERIFY(qwebchanneljs.exists());
@@ -220,7 +216,7 @@ void tst_QWebEngineScript::webChannel()
" function(channel) {"
" channel.objects.object.text = 'test';"
" }"
- ");"), worldId);
+ ");"));
waitForSignal(&testObject, SIGNAL(textChanged(QString)));
QCOMPARE(testObject.text(), QStringLiteral("test"));
diff --git a/tests/auto/widgets/qwebenginespellcheck/dict/en-US.aff b/tests/auto/widgets/qwebenginespellcheck/dict/en-US.aff
deleted file mode 100644
index ff8185771..000000000
--- a/tests/auto/widgets/qwebenginespellcheck/dict/en-US.aff
+++ /dev/null
@@ -1,5 +0,0 @@
-SET UTF-8
-TRY esianrtolcdugmphbyfvkwzqESIANRTOLCDUGMPHBYFVKWZQ
-
-PFX Q Y 1
-PFX Q 0 q .
diff --git a/tests/auto/widgets/qwebenginespellcheck/dict/en-US.dic b/tests/auto/widgets/qwebenginespellcheck/dict/en-US.dic
deleted file mode 100644
index 3d4ecdfa4..000000000
--- a/tests/auto/widgets/qwebenginespellcheck/dict/en-US.dic
+++ /dev/null
@@ -1,11 +0,0 @@
-10
-he/Q
-I/Q
-it/Q
-love/Q
-loves/Q
-qt/Q
-she/Q
-they/Q
-we/Q
-you/Q
diff --git a/tests/auto/widgets/qwebenginespellcheck/qwebenginespellcheck.pro b/tests/auto/widgets/qwebenginespellcheck/qwebenginespellcheck.pro
deleted file mode 100644
index 437aad937..000000000
--- a/tests/auto/widgets/qwebenginespellcheck/qwebenginespellcheck.pro
+++ /dev/null
@@ -1,22 +0,0 @@
-include(../tests.pri)
-
-DISTFILES += \
- dict/en-US.dic \
- dict/en-US.aff
-
-qtPrepareTool(CONVERT_TOOL, qwebengine_convert_dict)
-
-debug_and_release {
- CONFIG(debug, debug|release): DICTIONARIES_DIR = debug/qtwebengine_dictionaries
- else: DICTIONARIES_DIR = release/qtwebengine_dictionaries
-} else {
- DICTIONARIES_DIR = qtwebengine_dictionaries
-}
-
-dict.files = $$PWD/dict/en-US.dic
-dictoolbuild.input = dict.files
-dictoolbuild.output = $${DICTIONARIES_DIR}/${QMAKE_FILE_BASE}.bdic
-dictoolbuild.commands = $${CONVERT_TOOL} ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
-dictoolbuild.name = Build ${QMAKE_FILE_IN_BASE}
-dictoolbuild.CONFIG = no_link target_predeps
-QMAKE_EXTRA_COMPILERS += dictoolbuild
diff --git a/tests/auto/widgets/qwebenginespellcheck/resources/index.html b/tests/auto/widgets/qwebenginespellcheck/resources/index.html
deleted file mode 100644
index 520979244..000000000
--- a/tests/auto/widgets/qwebenginespellcheck/resources/index.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<html>
- <head>
- <script type="text/javascript">
- function makeEditable()
- {
- document.getElementsByClassName('textarea')[0].contentEditable = true;
- }
-
- function text()
- {
- return document.getElementsByClassName('textarea')[0].innerHTML;
- }
-
- function findWordPosition(text,word)
- {
- var divElement = document.getElementsByClassName('textarea')[0];
- divElement.innerHTML = text;
- var regex = new RegExp(word,'g');
- divElement.innerHTML = divElement.innerHTML.replace(regex, '<span id="word">' + word + '</span>');
- var spanElement = document.getElementById('word');
- var rect = spanElement.getBoundingClientRect();
- var array = new Array();
- array.push(rect.left);
- array.push(rect.top);
- array.push(rect.right - rect.left);
- array.push(rect.bottom - rect.top);
- divElement.innerHTML = "";
- return array;
- }
- </script>
- </head>
- <body>
- <div class="textarea" style="width:300px; height:200px; border: 1px solid #ccc"></div>
- </body>
-</html>
-
diff --git a/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp b/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp
deleted file mode 100644
index 2dfe3305d..000000000
--- a/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "util.h"
-#include <QtTest/QtTest>
-#include <QtWebEngineWidgets/qwebenginecontextmenudata.h>
-#include <QtWebEngineWidgets/qwebengineprofile.h>
-#include <QtWebEngineWidgets/qwebenginepage.h>
-#include <QtWebEngineWidgets/qwebengineview.h>
-
-class WebView : public QWebEngineView
-{
- Q_OBJECT
-public:
- void activateMenu(const QPoint &position)
- {
- QTest::mouseMove(focusWidget(), position);
- QTest::mousePress(focusWidget(), Qt::RightButton, 0, position);
- QContextMenuEvent evcont(QContextMenuEvent::Mouse, position, mapToGlobal(position));
- event(&evcont);
- }
-
- const QWebEngineContextMenuData& data()
- {
- return m_data;
- }
-
-signals:
- void menuReady();
-
-protected:
- void contextMenuEvent(QContextMenuEvent *)
- {
- m_data = page()->contextMenuData();
- emit menuReady();
- }
-private:
- QWebEngineContextMenuData m_data;
-};
-
-class tst_QWebEngineSpellcheck : public QObject
-{
- Q_OBJECT
-
-private Q_SLOTS:
- void init();
- void cleanup();
- void initTestCase();
- void spellCheckLanguage();
- void spellCheckEnabled();
- void spellcheck();
-
-private:
- void load();
- WebView *m_view;
-};
-
-void tst_QWebEngineSpellcheck::initTestCase()
-{
- QWebEngineProfile *profile = QWebEngineProfile::defaultProfile();
- QVERIFY(profile);
- QVERIFY(!profile->isSpellCheckEnabled());
- QVERIFY(profile->spellCheckLanguage().isEmpty());
-}
-
-void tst_QWebEngineSpellcheck::init()
-{
- QWebEngineProfile *profile = QWebEngineProfile::defaultProfile();
- profile->setSpellCheckEnabled(false);
- profile->setSpellCheckLanguage(QString::null);
- m_view = new WebView();
-}
-
-void tst_QWebEngineSpellcheck::load()
-{
- m_view->page()->load(QUrl("qrc:///resources/index.html"));
- m_view->show();
- waitForSignal(m_view->page(), SIGNAL(loadFinished(bool)));
-}
-
-void tst_QWebEngineSpellcheck::cleanup()
-{
- delete m_view;
-}
-
-void tst_QWebEngineSpellcheck::spellCheckLanguage()
-{
- QWebEngineProfile *profile = QWebEngineProfile::defaultProfile();
- QVERIFY(profile);
- profile->setSpellCheckLanguage("en-US");
- QVERIFY(profile->spellCheckLanguage() == "en-US");
-}
-
-void tst_QWebEngineSpellcheck::spellCheckEnabled()
-{
- QWebEngineProfile *profile = QWebEngineProfile::defaultProfile();
- QVERIFY(profile);
- profile->setSpellCheckEnabled(true);
- QVERIFY(profile->isSpellCheckEnabled());
-}
-
-void tst_QWebEngineSpellcheck::spellcheck()
-{
- QWebEngineProfile *profile = QWebEngineProfile::defaultProfile();
- QVERIFY(profile);
- profile->setSpellCheckLanguage("en-US");
- profile->setSpellCheckEnabled(true);
- load();
-
- // make textarea editable
- evaluateJavaScriptSync(m_view->page(), "makeEditable();");
-
- // calcuate position of misspelled word
- QVariantList list = evaluateJavaScriptSync(m_view->page(), "findWordPosition('I lovee Qt ....','lovee');").toList();
- QRect rect(list[0].value<int>(),list[1].value<int>(),list[2].value<int>(),list[3].value<int>());
-
- //type text, spellchecker needs time
- QTest::mouseMove(m_view->focusWidget(), QPoint(20,20));
- QTest::mousePress(m_view->focusWidget(), Qt::LeftButton, 0, QPoint(20,20));
- QString text("I lovee Qt ....");
- for (int i = 0; i < text.length(); i++) {
- QTest::keyClicks(m_view->focusWidget(), text.at(i));
- QTest::qWait(60);
- }
-
- // make sure text is there
- QString result = evaluateJavaScriptSync(m_view->page(), "text();").toString();
- QVERIFY(result == text);
-
- // open menu on misspelled word
- m_view->activateMenu(rect.center());
- waitForSignal(m_view, SIGNAL(menuReady()));
-
- // check if menu is valid
- QVERIFY(m_view->data().isValid());
- QVERIFY(m_view->data().isContentEditable());
-
- // check misspelled word
- QVERIFY(m_view->data().misspelledWord() == "lovee");
-
- // check suggestions
- QStringList expected {"love", "loves"};
- QVERIFY(m_view->data().spellCheckerSuggestions() == expected);
-
- // check replace word
- m_view->page()->replaceMisspelledWord("love");
- text = "I love Qt ....";
- result = evaluateJavaScriptSync(m_view->page(), "text();").toString();
- QVERIFY(result == text);
-}
-
-QTEST_MAIN(tst_QWebEngineSpellcheck)
-#include "tst_qwebenginespellcheck.moc"
diff --git a/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.qrc b/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.qrc
deleted file mode 100644
index 505b932c7..000000000
--- a/tests/auto/widgets/qwebenginespellcheck/tst_qwebenginespellcheck.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>resources/index.html</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/widgets/qwebengineview/resources/basic_printing_page.html b/tests/auto/widgets/qwebengineview/resources/basic_printing_page.html
deleted file mode 100644
index 0c6ff379f..000000000
--- a/tests/auto/widgets/qwebengineview/resources/basic_printing_page.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
-<head>
-<title> Basic Printing Page </title>
-</head>
-<body>
-<h1>Hello Paper World</h1>
-</body>
-</html>
diff --git a/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc b/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc
index b32b533c2..0b8676a09 100644
--- a/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc
+++ b/tests/auto/widgets/qwebengineview/tst_qwebengineview.qrc
@@ -4,6 +4,5 @@
<file>resources/frame_a.html</file>
<file>resources/input_types.html</file>
<file>resources/scrolltest_page.html</file>
- <file>resources/basic_printing_page.html</file>
</qresource>
</RCC>
diff --git a/tests/auto/widgets/util.h b/tests/auto/widgets/util.h
index 770579f1f..f9bdbec4d 100644
--- a/tests/auto/widgets/util.h
+++ b/tests/auto/widgets/util.h
@@ -166,13 +166,6 @@ static inline QVariant evaluateJavaScriptSync(QWebEnginePage *page, const QStrin
return spy.waitForResult();
}
-static inline QVariant evaluateJavaScriptSyncInWorld(QWebEnginePage *page, const QString &script, int worldId)
-{
- CallbackSpy<QVariant> spy;
- page->runJavaScript(script, worldId, spy.ref());
- return spy.waitForResult();
-}
-
static inline QUrl baseUrlSync(QWebEnginePage *page)
{
CallbackSpy<QVariant> spy;
diff --git a/tests/auto/widgets/widgets.pro b/tests/auto/widgets/widgets.pro
index 2f5416701..fef9ea83a 100644
--- a/tests/auto/widgets/widgets.pro
+++ b/tests/auto/widgets/widgets.pro
@@ -3,7 +3,6 @@ TEMPLATE = subdirs
SUBDIRS += \
qwebengineaccessibility \
qwebenginedefaultsurfaceformat \
- qwebenginefaviconmanager \
qwebenginepage \
qwebenginehistory \
qwebenginehistoryinterface \
@@ -12,8 +11,3 @@ SUBDIRS += \
qwebenginescript \
qwebenginesettings \
qwebengineview
-
-# QTBUG-53135, osx does not use hunspell
-!contains(WEBENGINE_CONFIG, no_spellcheck):!osx:!cross_compile {
- SUBDIRS += qwebenginespellcheck
-}