Commit 028bd20e authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

Merge 5.9 into 5.9.0

Change-Id: If450c073521057241f34ed9b9a7f9965c6752a15
Showing with 152 additions and 101 deletions
QMAKEPATH += $$PWD/tools/qmake
# Resolve root directories for sources
QTWEBENGINE_ROOT = $$PWD
QTWEBENGINE_OUT_ROOT = $$shadowed($$PWD)
......
File moved
File moved
File moved
File moved
File moved
......@@ -4,13 +4,10 @@
"printsupport"
],
"testDir": "tools/qmake/config.tests",
"commandline": {
"options": {
"alsa": "boolean",
"embedded": "boolean",
"optimize-for-size": { "type": "boolean", "name": "optimize_size" },
"ffmpeg": { "type": "enum", "name": "system-ffmpeg", "values": { "system": "yes", "qt": "no" } },
"opus": { "type": "enum", "name": "system-opus", "values": { "system": "yes", "qt": "no" } },
"webp": { "type": "enum", "name": "system-webp", "values": { "system": "yes", "qt": "no" } },
......@@ -58,6 +55,11 @@
},
"tests" : {
"python2": {
"label": "Python 2",
"type": "detectPython2",
"log": "location"
},
"ninja": {
"label": "system ninja",
"type": "detectNinja"
......@@ -73,6 +75,13 @@
},
"features": {
"python2": {
"label": "Python 2",
"condition": "tests.python2",
"output": [
{ "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.python2.location" }
]
},
"embedded": {
"label": "Embedded build",
"condition": "config.unix",
......@@ -80,11 +89,6 @@
"purpose": "Enables the embedded build configuration",
"output": [ "privateFeature" ]
},
"optimize_size": {
"label": "Optimize for size",
"autoDetect": "tests.embedded",
"output": [ "privateFeature" ]
},
"alsa": {
"label": "ALSA",
"condition": "config.unix && libs.alsa",
......@@ -157,12 +161,19 @@
}
},
"report": [
{
"type": "warning",
"condition": "!features.python2",
"message": "Python version 2 (2.7.5 or later) is required to build QtWebEngine."
}
],
"summary": [
{
"section": "Qt WebEngine",
"entries": [
"embedded",
"optimize_size",
"pepper-plugins",
"printing-and-pdf",
"proprietary-codecs",
......
equals(QMAKE_HOST.os, Windows): EXE_SUFFIX = .exe
defineTest(isPythonVersionSupported) {
python = $$system_quote($$system_path($$1))
python_version = $$system('$$python -c "import sys; print(sys.version_info[0:3])"')
python_version ~= s/[()]//g
python_version = $$split(python_version, ',')
python_major_version = $$first(python_version)
greaterThan(python_major_version, 2) {
qtLog("Python version 3 is not supported by Chromium.")
return(false)
}
python_minor_version = $$member(python_version, 1)
python_patch_version = $$member(python_version, 2)
greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true)
qtLog("Unsupported python version: $${python_major_version}.$${python_minor_version}.$${python_patch_version}.")
return(false)
}
defineTest(qtConfTest_detectPython2) {
python = $$qtConfFindInPath("python2")
isEmpty(python) {
qtLog("'python2' not found in PATH. Checking for 'python'.")
python = $$qtConfFindInPath("python$$EXE_SUFFIX")
}
isEmpty(python) {
qtLog("'python$$EXE_SUFFIX' not found in PATH. Giving up.")
return(false)
}
!isPythonVersionSupported($$python) {
qtLog("A suitable Python 2 executable could not be located.")
return(false)
}
# Make tests.python2.location available in configure.json.
$${1}.location = $$clean_path($$python)
export($${1}.location)
$${1}.cache += location
export($${1}.cache)
return(true)
}
defineTest(qtConfTest_detectNinja) {
ninja = $$qtConfFindInPath("ninja$$EXE_SUFFIX")
!isEmpty(ninja) {
......
......@@ -70,18 +70,18 @@ QtObject {
onClosing: destroy()
}
function createWindow(profile) {
var newWindow = browserWindowComponent.createObject(root)
newWindow.currentWebView.profile = profile
profile.downloadRequested.connect(newWindow.onDownloadRequested)
return newWindow
var newWindow = browserWindowComponent.createObject(root);
newWindow.currentWebView.profile = profile;
profile.downloadRequested.connect(newWindow.onDownloadRequested);
return newWindow;
}
function createDialog(profile) {
var newDialog = browserDialogComponent.createObject(root)
newDialog.currentWebView.profile = profile
return newDialog
var newDialog = browserDialogComponent.createObject(root);
newDialog.currentWebView.profile = profile;
return newDialog;
}
function load(url) {
var browserWindow = createWindow(defaultProfile)
browserWindow.currentWebView.url = url
var browserWindow = createWindow(defaultProfile);
browserWindow.currentWebView.url = url;
}
}
......@@ -48,15 +48,16 @@
**
****************************************************************************/
import Qt.labs.settings 1.0
import QtQml 2.2
import QtQuick 2.2
import QtWebEngine 1.2
import QtQuick.Controls 1.0
import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.0
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.0
import QtQuick.Window 2.1
import QtQuick.Controls.Private 1.0
import QtQuick.Dialogs 1.2
import Qt.labs.settings 1.0
import QtWebEngine 1.3
ApplicationWindow {
id: browserWindow
......@@ -79,19 +80,19 @@ ApplicationWindow {
Settings {
id : appSettings
property alias autoLoadImages: loadImages.checked;
property alias javaScriptEnabled: javaScriptEnabled.checked;
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;
property alias autoLoadImages: loadImages.checked
property alias javaScriptEnabled: javaScriptEnabled.checked
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 {
shortcut: "Ctrl+D"
onTriggered: {
downloadView.visible = !downloadView.visible
downloadView.visible = !downloadView.visible;
}
}
Action {
......@@ -106,14 +107,14 @@ ApplicationWindow {
shortcut: StandardKey.Refresh
onTriggered: {
if (currentWebView)
currentWebView.reload()
currentWebView.reload();
}
}
Action {
shortcut: StandardKey.AddTab
onTriggered: {
tabs.createEmptyTab(currentWebView.profile)
tabs.currentIndex = tabs.count - 1
tabs.createEmptyTab(currentWebView.profile);
tabs.currentIndex = tabs.count - 1;
addressBar.forceActiveFocus();
addressBar.selectAll();
}
......@@ -128,23 +129,23 @@ ApplicationWindow {
shortcut: "Escape"
onTriggered: {
if (currentWebView.state == "FullScreen") {
browserWindow.visibility = browserWindow.previousVisibility
fullScreenNotification.hide()
browserWindow.visibility = browserWindow.previousVisibility;
fullScreenNotification.hide();
currentWebView.triggerWebAction(WebEngineView.ExitFullScreen);
}
}
}
Action {
shortcut: "Ctrl+0"
onTriggered: currentWebView.zoomFactor = 1.0;
onTriggered: currentWebView.zoomFactor = 1.0
}
Action {
shortcut: StandardKey.ZoomOut
onTriggered: currentWebView.zoomFactor -= 0.1;
onTriggered: currentWebView.zoomFactor -= 0.1
}
Action {
shortcut: StandardKey.ZoomIn
onTriggered: currentWebView.zoomFactor += 0.1;
onTriggered: currentWebView.zoomFactor += 0.1
}
Action {
......@@ -187,7 +188,7 @@ ApplicationWindow {
toolBar: ToolBar {
id: navigationBar
RowLayout {
anchors.fill: parent;
anchors.fill: parent
ToolButton {
enabled: currentWebView && (currentWebView.canGoBack || currentWebView.canGoForward)
menu:Menu {
......@@ -294,7 +295,7 @@ ApplicationWindow {
id: httpDiskCacheEnabled
text: "HTTP Disk Cache"
checkable: !currentWebView.profile.offTheRecord
checked: (currentWebView.profile.httpCacheType == WebEngineProfile.DiskHttpCache)
checked: (currentWebView.profile.httpCacheType === WebEngineProfile.DiskHttpCache)
onToggled: currentWebView.profile.httpCacheType = checked ? WebEngineProfile.DiskHttpCache : WebEngineProfile.MemoryHttpCache
}
MenuItem {
......@@ -336,12 +337,12 @@ ApplicationWindow {
TabView {
id: tabs
function createEmptyTab(profile) {
var tab = addTab("", tabComponent)
var tab = addTab("", tabComponent);
// We must do this first to make sure that tab.active gets set so that tab.item gets instantiated immediately.
tab.active = true
tab.title = Qt.binding(function() { return tab.item.title })
tab.item.profile = profile
return tab
tab.active = true;
tab.title = Qt.binding(function() { return tab.item.title });
tab.item.profile = profile;
return tab;
}
anchors.fill: parent
......@@ -355,10 +356,10 @@ ApplicationWindow {
onLinkHovered: {
if (hoveredUrl == "")
resetStatusText.start()
resetStatusText.start();
else {
resetStatusText.stop()
statusText.text = hoveredUrl
resetStatusText.stop();
statusText.text = hoveredUrl;
}
}
......@@ -385,69 +386,69 @@ ApplicationWindow {
settings.touchIconsEnabled: appSettings.touchIconsEnabled
onCertificateError: {
error.defer()
sslDialog.enqueue(error)
error.defer();
sslDialog.enqueue(error);
}
onNewViewRequested: {
if (!request.userInitiated)
print("Warning: Blocked a popup window.")
print("Warning: Blocked a popup window.");
else if (request.destination == WebEngineView.NewViewInTab) {
var tab = tabs.createEmptyTab(currentWebView.profile)
tabs.currentIndex = tabs.count - 1
request.openIn(tab.item)
var tab = tabs.createEmptyTab(currentWebView.profile);
tabs.currentIndex = tabs.count - 1;
request.openIn(tab.item);
} else if (request.destination == WebEngineView.NewViewInBackgroundTab) {
var tab = tabs.createEmptyTab(currentWebView.profile)
request.openIn(tab.item)
var backgroundTab = tabs.createEmptyTab(currentWebView.profile);
request.openIn(backgroundTab.item);
} else if (request.destination == WebEngineView.NewViewInDialog) {
var dialog = applicationRoot.createDialog(currentWebView.profile)
request.openIn(dialog.currentWebView)
var dialog = applicationRoot.createDialog(currentWebView.profile);
request.openIn(dialog.currentWebView);
} else {
var window = applicationRoot.createWindow(currentWebView.profile)
request.openIn(window.currentWebView)
var window = applicationRoot.createWindow(currentWebView.profile);
request.openIn(window.currentWebView);
}
}
onFullScreenRequested: {
if (request.toggleOn) {
webEngineView.state = "FullScreen"
browserWindow.previousVisibility = browserWindow.visibility
browserWindow.showFullScreen()
fullScreenNotification.show()
webEngineView.state = "FullScreen";
browserWindow.previousVisibility = browserWindow.visibility;
browserWindow.showFullScreen();
fullScreenNotification.show();
} else {
webEngineView.state = ""
browserWindow.visibility = browserWindow.previousVisibility
fullScreenNotification.hide()
webEngineView.state = "";
browserWindow.visibility = browserWindow.previousVisibility;
fullScreenNotification.hide();
}
request.accept()
request.accept();
}
onRenderProcessTerminated: {
var status = ""
var status = "";
switch (terminationStatus) {
case WebEngineView.NormalTerminationStatus:
status = "(normal exit)"
status = "(normal exit)";
break;
case WebEngineView.AbnormalTerminationStatus:
status = "(abnormal exit)"
status = "(abnormal exit)";
break;
case WebEngineView.CrashedTerminationStatus:
status = "(crashed)"
status = "(crashed)";
break;
case WebEngineView.KilledTerminationStatus:
status = "(killed)"
status = "(killed)";
break;
}
print("Render process exited with code " + exitCode + " " + status)
reloadTimer.running = true
print("Render process exited with code " + exitCode + " " + status);
reloadTimer.running = true;
}
onWindowCloseRequested: {
if (tabs.count == 1)
browserWindow.close()
browserWindow.close();
else
tabs.removeTab(tabs.currentIndex)
tabs.removeTab(tabs.currentIndex);
}
Timer {
......@@ -473,19 +474,19 @@ ApplicationWindow {
"you may not be connected with the host you tried to connect to.\n" +
"Do you wish to override the security check and continue?"
onYes: {
certErrors.shift().ignoreCertificateError()
presentError()
certErrors.shift().ignoreCertificateError();
presentError();
}
onNo: reject()
onRejected: reject()
function reject(){
certErrors.shift().rejectCertificate()
presentError()
certErrors.shift().rejectCertificate();
presentError();
}
function enqueue(error){
certErrors.push(error)
presentError()
certErrors.push(error);
presentError();
}
function presentError(){
visible = certErrors.length > 0
......@@ -503,9 +504,9 @@ ApplicationWindow {
}
function onDownloadRequested(download) {
downloadView.visible = true
downloadView.append(download)
download.accept()
downloadView.visible = true;
downloadView.append(download);
download.accept();
}
Rectangle {
......
......@@ -64,8 +64,8 @@ Rectangle {
}
function append(download) {
downloadModel.append(download)
downloadModel.downloads.push(download)
downloadModel.append(download);
downloadModel.downloads.push(download);
}
Component {
......@@ -113,14 +113,14 @@ Rectangle {
anchors.right: parent.right
iconSource: "icons/process-stop.png"
onClicked: {
var download = downloadModel.downloads[index]
var download = downloadModel.downloads[index];
download.cancel()
download.cancel();
downloadModel.downloads = downloadModel.downloads.filter(function (el) {
return el.id !== download.id;
});
downloadModel.remove(index)
downloadModel.remove(index);
}
}
}
......@@ -167,7 +167,7 @@ Rectangle {
text: "OK"
anchors.centerIn: parent
onClicked: {
downloadView.visible = false
downloadView.visible = false;
}
}
}
......
......@@ -51,14 +51,14 @@ Rectangle {
opacity: 0
function show() {
visible = true
opacity = 1
reset.start()
visible = true;
opacity = 1;
reset.start();
}
function hide() {
reset.stop()
opacity = 0
reset.stop();
opacity = 0;
}
Behavior on opacity {
......@@ -66,7 +66,7 @@ Rectangle {
duration: 750
onStopped: {
if (opacity == 0)
visible = false
visible = false;
}
}
}
......
......@@ -57,7 +57,7 @@
class Document : public QObject
{
Q_OBJECT
Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged)
Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged FINAL)
public:
explicit Document(QObject *parent = nullptr) : QObject(parent) {}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment