summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/common/common_resources.qrc8
-rw-r--r--examples/examples.pro3
-rw-r--r--examples/quick/quicknanobrowser/icons/go-next.png (renamed from examples/common/icons/go-next.png)bin930 -> 930 bytes
-rw-r--r--examples/quick/quicknanobrowser/icons/go-previous.png (renamed from examples/common/icons/go-previous.png)bin955 -> 955 bytes
-rw-r--r--examples/quick/quicknanobrowser/icons/process-stop.png (renamed from examples/common/icons/process-stop.png)bin1272 -> 1272 bytes
-rw-r--r--examples/quick/quicknanobrowser/icons/view-refresh.png (renamed from examples/common/icons/view-refresh.png)bin1364 -> 1364 bytes
-rw-r--r--examples/quick/quicknanobrowser/quicknanobrowser.pro4
-rw-r--r--examples/quick/quicknanobrowser/quickwindow.cpp2
-rw-r--r--examples/quick/quicknanobrowser/resources.qrc6
-rw-r--r--examples/quick/quicknanobrowser/util.h (renamed from examples/common/util.h)0
-rw-r--r--examples/widgets/widgetsnanobrowser/main.cpp53
-rw-r--r--examples/widgets/widgetsnanobrowser/widgetsnanobrowser.pro13
-rw-r--r--examples/widgets/widgetsnanobrowser/widgetwindow.cpp128
-rw-r--r--examples/widgets/widgetsnanobrowser/widgetwindow.h72
14 files changed, 10 insertions, 279 deletions
diff --git a/examples/common/common_resources.qrc b/examples/common/common_resources.qrc
deleted file mode 100644
index 45e766179..000000000
--- a/examples/common/common_resources.qrc
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="icons">
- <file alias="go-next.png">icons/go-next.png</file>
- <file alias="go-previous.png">icons/go-previous.png</file>
- <file alias="process-stop.png">icons/process-stop.png</file>
- <file alias="view-refresh.png">icons/view-refresh.png</file>
-</qresource>
-</RCC>
diff --git a/examples/examples.pro b/examples/examples.pro
index d70bc3fe2..4952e0b15 100644
--- a/examples/examples.pro
+++ b/examples/examples.pro
@@ -4,6 +4,5 @@ SUBDIRS += quick/quicknanobrowser
qtHaveModule(widgets) {
SUBDIRS += \
widgets/browser \
- widgets/fancybrowser \
- widgets/widgetsnanobrowser
+ widgets/fancybrowser
}
diff --git a/examples/common/icons/go-next.png b/examples/quick/quicknanobrowser/icons/go-next.png
index 6f3f65d33..6f3f65d33 100644
--- a/examples/common/icons/go-next.png
+++ b/examples/quick/quicknanobrowser/icons/go-next.png
Binary files differ
diff --git a/examples/common/icons/go-previous.png b/examples/quick/quicknanobrowser/icons/go-previous.png
index 93be3d1ee..93be3d1ee 100644
--- a/examples/common/icons/go-previous.png
+++ b/examples/quick/quicknanobrowser/icons/go-previous.png
Binary files differ
diff --git a/examples/common/icons/process-stop.png b/examples/quick/quicknanobrowser/icons/process-stop.png
index b68290bf1..b68290bf1 100644
--- a/examples/common/icons/process-stop.png
+++ b/examples/quick/quicknanobrowser/icons/process-stop.png
Binary files differ
diff --git a/examples/common/icons/view-refresh.png b/examples/quick/quicknanobrowser/icons/view-refresh.png
index cab4d02c7..cab4d02c7 100644
--- a/examples/common/icons/view-refresh.png
+++ b/examples/quick/quicknanobrowser/icons/view-refresh.png
Binary files differ
diff --git a/examples/quick/quicknanobrowser/quicknanobrowser.pro b/examples/quick/quicknanobrowser/quicknanobrowser.pro
index 3455f02e0..b07bd4e51 100644
--- a/examples/quick/quicknanobrowser/quicknanobrowser.pro
+++ b/examples/quick/quicknanobrowser/quicknanobrowser.pro
@@ -3,7 +3,8 @@ TARGET = quicknanobrowser
macx: CONFIG -= app_bundle
-HEADERS = quickwindow.h
+HEADERS = quickwindow.h \
+ util.h
SOURCES = quickwindow.cpp \
main.cpp
@@ -11,7 +12,6 @@ OTHER_FILES += ContextMenuExtras.qml \
quickwindow.qml
RESOURCES += resources.qrc
-RESOURCES += ../../common/common_resources.qrc
QT += qml quick
QT_PRIVATE += quick-private gui-private core-private
diff --git a/examples/quick/quicknanobrowser/quickwindow.cpp b/examples/quick/quicknanobrowser/quickwindow.cpp
index df93cd218..ec7b6f94a 100644
--- a/examples/quick/quicknanobrowser/quickwindow.cpp
+++ b/examples/quick/quicknanobrowser/quickwindow.cpp
@@ -41,7 +41,7 @@
#include "quickwindow.h"
-#include "../../common/util.h"
+#include "util.h"
#include <QFileInfo>
#include <QObject>
diff --git a/examples/quick/quicknanobrowser/resources.qrc b/examples/quick/quicknanobrowser/resources.qrc
index 5294b7ff6..1befb4fd1 100644
--- a/examples/quick/quicknanobrowser/resources.qrc
+++ b/examples/quick/quicknanobrowser/resources.qrc
@@ -3,4 +3,10 @@
<file>quickwindow.qml</file>
<file>ContextMenuExtras.qml</file>
</qresource>
+ <qresource prefix="icons">
+ <file alias="go-next.png">icons/go-next.png</file>
+ <file alias="go-previous.png">icons/go-previous.png</file>
+ <file alias="process-stop.png">icons/process-stop.png</file>
+ <file alias="view-refresh.png">icons/view-refresh.png</file>
+ </qresource>
</RCC>
diff --git a/examples/common/util.h b/examples/quick/quicknanobrowser/util.h
index ea0ae8b2e..ea0ae8b2e 100644
--- a/examples/common/util.h
+++ b/examples/quick/quicknanobrowser/util.h
diff --git a/examples/widgets/widgetsnanobrowser/main.cpp b/examples/widgets/widgetsnanobrowser/main.cpp
deleted file mode 100644
index f6c9a37b0..000000000
--- a/examples/widgets/widgetsnanobrowser/main.cpp
+++ /dev/null
@@ -1,53 +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: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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt 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$
-**
-****************************************************************************/
-
-#include "widgetwindow.h"
-#include <QApplication>
-
-int main(int argc, char **argv)
-{
- QApplication app(argc, argv);
-
- WidgetWindow window;
- window.show();
-
- return app.exec();
-}
diff --git a/examples/widgets/widgetsnanobrowser/widgetsnanobrowser.pro b/examples/widgets/widgetsnanobrowser/widgetsnanobrowser.pro
deleted file mode 100644
index 39963222d..000000000
--- a/examples/widgets/widgetsnanobrowser/widgetsnanobrowser.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = widgetsnanobrowser
-
-macx: CONFIG -= app_bundle
-
-HEADERS = widgetwindow.h
-SOURCES = widgetwindow.cpp main.cpp
-
-RESOURCES += ../../common/common_resources.qrc
-
-QT += webenginewidgets
-
-CONFIG -= qt_example_installs
diff --git a/examples/widgets/widgetsnanobrowser/widgetwindow.cpp b/examples/widgets/widgetsnanobrowser/widgetwindow.cpp
deleted file mode 100644
index c35d1f756..000000000
--- a/examples/widgets/widgetsnanobrowser/widgetwindow.cpp
+++ /dev/null
@@ -1,128 +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: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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt 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$
-**
-****************************************************************************/
-
-#include "widgetwindow.h"
-
-#include "qwebengineview.h"
-#include "qwebenginepage.h"
-#include "qwebenginehistory.h"
-#include "../../common/util.h"
-
-#include <QShortcut>
-
-static const int margin = 1;
-
-WidgetWindow::WidgetWindow()
-: m_webView(new QWebEngineView)
-, addressLineEdit(0)
-{
- setGeometry(0, 0, 800, 600);
-
- QVBoxLayout* layout = new QVBoxLayout;
- layout->setContentsMargins(margin, margin, margin, margin);
-
- // Create a widget based address bar.
- QHBoxLayout* addressBar = new QHBoxLayout;
- addressBar->setSpacing(margin); // Bigger buttons, less space between them
-
- backButton = new QToolButton;
- backButton->setIcon(QIcon(":/icons/go-previous.png"));
- addressBar->addWidget(backButton);
-
- forwardButton = new QToolButton;
- forwardButton->setIcon(QIcon(":/icons/go-next.png"));
- addressBar->addWidget(forwardButton);
-
- reloadButton = new QToolButton;
- reloadButton->setIcon(QIcon::fromTheme(":/icons/view-refresh.png"));
- addressBar->addWidget(reloadButton);
-
- addressLineEdit = new QLineEdit;
- addressBar->addWidget(addressLineEdit);
-
- QShortcut* focusUrlBarShortcut = new QShortcut(addressLineEdit);
- focusUrlBarShortcut->setKey(QKeySequence(Qt::CTRL | Qt::Key_L));
- connect(focusUrlBarShortcut, SIGNAL(activated()), addressLineEdit, SLOT(setFocus()));
- connect(focusUrlBarShortcut, SIGNAL(activated()), addressLineEdit, SLOT(selectAll()));
-
- layout->addLayout(addressBar);
- layout->addWidget(m_webView.data());
-
- setLayout(layout);
-
- connect(addressLineEdit, SIGNAL(returnPressed()), SLOT(loadAddressFromAddressBar()));
- connect(backButton, SIGNAL(clicked()), m_webView.data(), SLOT(back()));
- connect(forwardButton, SIGNAL(clicked()), m_webView.data(), SLOT(forward()));
- connect(reloadButton, SIGNAL(clicked()), m_webView.data(), SLOT(reload()));
- connect(m_webView.data(), SIGNAL(loadStarted()), SLOT(loadStarted()));
- connect(m_webView.data(), SIGNAL(loadFinished(bool)), SLOT(loadFinished(bool)));
- connect(m_webView.data(), SIGNAL(titleChanged(const QString&)), SLOT(setWindowTitle(const QString&)));
- connect(m_webView.data(), SIGNAL(urlChanged(const QUrl&)), SLOT(setAddressBarUrl(const QUrl&)));
-
- m_webView->load(startupUrl());
-}
-
-WidgetWindow::~WidgetWindow()
-{
-}
-
-void WidgetWindow::loadAddressFromAddressBar()
-{
- m_webView->load(urlFromUserInput(addressLineEdit->text()));
-}
-
-void WidgetWindow::setAddressBarUrl(const QUrl& url)
-{
- addressLineEdit->setText(url.toString());
-}
-
-void WidgetWindow::loadStarted()
-{
- reloadButton->setIcon(QIcon(":/icons/process-stop.png"));
-}
-
-void WidgetWindow::loadFinished(bool success)
-{
- Q_UNUSED(success);
- forwardButton->setEnabled(m_webView->page()->history()->canGoForward());
- backButton->setEnabled(m_webView->page()->history()->canGoBack());
- reloadButton->setIcon(QIcon(":/icons/view-refresh.png"));
-}
diff --git a/examples/widgets/widgetsnanobrowser/widgetwindow.h b/examples/widgets/widgetsnanobrowser/widgetwindow.h
deleted file mode 100644
index b162efd52..000000000
--- a/examples/widgets/widgetsnanobrowser/widgetwindow.h
+++ /dev/null
@@ -1,72 +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: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 Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/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.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt 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$
-**
-****************************************************************************/
-
-#ifndef WIDGETWINDOW_H
-#define WIDGETWINDOW_H
-
-#include <QtWidgets>
-#include <QScopedPointer>
-
-QT_BEGIN_NAMESPACE
-class QWebEngineView;
-QT_END_NAMESPACE
-
-class WidgetWindow : public QWidget {
- Q_OBJECT
-public:
- WidgetWindow();
- ~WidgetWindow();
-
-private Q_SLOTS:
- void loadAddressFromAddressBar();
- void setAddressBarUrl(const QUrl& url);
- void loadStarted();
- void loadFinished(bool);
-
-private:
- QScopedPointer<QWebEngineView> m_webView;
- QLineEdit* addressLineEdit;
- QToolButton* forwardButton;
- QToolButton* backButton;
- QToolButton* reloadButton;
-};
-
-#endif // WIDGETWINDOW_H