From c117207e9c0b554c4f505ba01ec92e60eb15017b Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 12 Mar 2014 18:05:04 +0100 Subject: Fork the quicknanobrowser as tests/quicktestbrowser This also removed experimental API uses from the quicknanobrowser example, which should be used mainly for documentation purposes. The quicktestbrowser should be the one that we use from now on as a raw testbed of new APIs. As with other targets in the tests directory, it will only be built by default if Qt is configured with -developer-build (and without -nomake tests). Change-Id: Ib4461c898cd3227bbb810493daac4d841d0d8f3e Reviewed-by: Pierre Rossi --- .../quicknanobrowser/ContextMenuExtras.qml | 61 --------------------- .../quicknanobrowser/quicknanobrowser.pro | 2 - .../webengine/quicknanobrowser/quickwindow.qml | 64 ---------------------- examples/webengine/quicknanobrowser/resources.qrc | 1 - examples/webengine/quicknanobrowser/util.h | 2 +- 5 files changed, 1 insertion(+), 129 deletions(-) delete mode 100644 examples/webengine/quicknanobrowser/ContextMenuExtras.qml (limited to 'examples') diff --git a/examples/webengine/quicknanobrowser/ContextMenuExtras.qml b/examples/webengine/quicknanobrowser/ContextMenuExtras.qml deleted file mode 100644 index cf54e9ba0..000000000 --- a/examples/webengine/quicknanobrowser/ContextMenuExtras.qml +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -import QtQuick 2.1 -import QtWebEngine.UIDelegates 1.0 - -VisualItemModel { - MenuItem { - text: "An application specific entry" - onTriggered: console.log("Application specific action triggered") - } - Menu { - title: "Extras Submenu" - MenuItem { - text: "something" - onTriggered: console.log("something triggered") - } - MenuItem { - text: "something else" - enabled: false - } - } -} - diff --git a/examples/webengine/quicknanobrowser/quicknanobrowser.pro b/examples/webengine/quicknanobrowser/quicknanobrowser.pro index 0ea2e60e2..b5a26cc68 100644 --- a/examples/webengine/quicknanobrowser/quicknanobrowser.pro +++ b/examples/webengine/quicknanobrowser/quicknanobrowser.pro @@ -1,8 +1,6 @@ TEMPLATE = app TARGET = quicknanobrowser -macx: CONFIG -= app_bundle - HEADERS = quickwindow.h \ util.h SOURCES = quickwindow.cpp \ diff --git a/examples/webengine/quicknanobrowser/quickwindow.qml b/examples/webengine/quicknanobrowser/quickwindow.qml index 183e41f4f..ea637e44b 100644 --- a/examples/webengine/quicknanobrowser/quickwindow.qml +++ b/examples/webengine/quicknanobrowser/quickwindow.qml @@ -40,7 +40,6 @@ import QtQuick 2.1 import QtWebEngine 1.0 -import QtWebEngine.experimental 1.0 import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.0 import QtQuick.Layouts 1.0 @@ -52,27 +51,16 @@ ApplicationWindow { function load(url) { currentWebView.url = url } property Item currentWebView: tabs.currentIndex < tabs.count ? tabs.getTab(tabs.currentIndex).item : null - property bool isFullScreen: visibility == Window.FullScreen - onIsFullScreenChanged: { - // This is for the case where the system forces us to leave fullscreen. - if (currentWebView) - currentWebView.state = isFullScreen ? "FullScreen" : "" - } - height: 600 width: 800 visible: true title: currentWebView && currentWebView.title - // Make sure the Qt.WindowFullscreenButtonHint is set on Mac. - Component.onCompleted: flags = flags | Qt.WindowFullscreenButtonHint - // Create a styleItem to determine the platform. // When using style "mac", ToolButtons are not supposed to accept focus. StyleItem { id: styleItem } property bool platformIsMac: styleItem.style == "mac" - Action { id: focus shortcut: "Ctrl+L" @@ -106,14 +94,6 @@ ApplicationWindow { } } - Action { - shortcut: "Escape" - onTriggered: { - if (browserWindow.isFullScreen) - browserWindow.showNormal() - } - } - toolBar: ToolBar { id: navigationBar RowLayout { @@ -196,51 +176,7 @@ ApplicationWindow { id: tabComponent WebEngineView { id: webEngineView - function adoptHandle(viewHandle) { experimental.adoptHandle(viewHandle) } - focus: true - - states: [ - State { - name: "FullScreen" - PropertyChanges { - target: tabs - frameVisible: false - tabsVisible: false - } - PropertyChanges { - target: navigationBar - visible: false - } - } - ] - - experimental { - isFullScreen: webEngineView.state == "FullScreen" && browserWindow.isFullScreen - onFullScreenRequested: { - if (fullScreen) { - webEngineView.state = "FullScreen" - browserWindow.showFullScreen(); - } else { - webEngineView.state = "" - browserWindow.showNormal(); - } - } - - onNewViewRequested: { - if (request.popup) - print("Warning: Blocked a popup window.") - else if (request.destination == WebEngineView.NewViewInTab) { - var tab = tabs.createEmptyTab() - request.openIn(tab.item) - } else { - var component = Qt.createComponent("quickwindow.qml") - var window = component.createObject() - request.openIn(window.currentWebView) - } - } - extraContextMenuEntriesComponent: ContextMenuExtras {} - } } } } diff --git a/examples/webengine/quicknanobrowser/resources.qrc b/examples/webengine/quicknanobrowser/resources.qrc index 1befb4fd1..549207726 100644 --- a/examples/webengine/quicknanobrowser/resources.qrc +++ b/examples/webengine/quicknanobrowser/resources.qrc @@ -1,7 +1,6 @@ quickwindow.qml - ContextMenuExtras.qml icons/go-next.png diff --git a/examples/webengine/quicknanobrowser/util.h b/examples/webengine/quicknanobrowser/util.h index ea0ae8b2e..bad41d6a7 100644 --- a/examples/webengine/quicknanobrowser/util.h +++ b/examples/webengine/quicknanobrowser/util.h @@ -59,7 +59,7 @@ QUrl startupUrl() QUrl ret; QStringList args(qApp->arguments()); args.takeFirst(); - Q_FOREACH(const QString& arg, args) { + Q_FOREACH (const QString& arg, args) { if (arg.startsWith(QLatin1Char('-'))) continue; ret = urlFromUserInput(arg); -- cgit v1.2.3