diff --git a/tools/auto-tester/CMakeLists.txt b/tools/auto-tester/CMakeLists.txt index 940de5d7bb..1546a35f4c 100644 --- a/tools/auto-tester/CMakeLists.txt +++ b/tools/auto-tester/CMakeLists.txt @@ -5,7 +5,7 @@ project(${TARGET_NAME}) SET (CMAKE_AUTOUIC ON) SET (CMAKE_AUTOMOC ON) -setup_hifi_project (Core Widgets Network Xml WebEngineWidgets) +setup_hifi_project (Core Widgets Network Xml) link_hifi_libraries () # FIX: Qt was built with -reduce-relocations diff --git a/tools/auto-tester/src/ui/AutoTester.cpp b/tools/auto-tester/src/ui/AutoTester.cpp index aa9c1ffdfb..13bda4853f 100644 --- a/tools/auto-tester/src/ui/AutoTester.cpp +++ b/tools/auto-tester/src/ui/AutoTester.cpp @@ -31,6 +31,8 @@ AutoTester::AutoTester(QWidget* parent) : QMainWindow(parent) { #ifndef Q_OS_WIN _ui.tabWidget->setTabEnabled(3, false); #endif + + // helpWindow.textBrowser->setText() } void AutoTester::setup() { diff --git a/tools/auto-tester/src/ui/HelpWindow.cpp b/tools/auto-tester/src/ui/HelpWindow.cpp index c6f3fcd2ee..21c5d9d375 100644 --- a/tools/auto-tester/src/ui/HelpWindow.cpp +++ b/tools/auto-tester/src/ui/HelpWindow.cpp @@ -1,189 +1,14 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples 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$ -** -****************************************************************************/ +// +// HelpWindow.cpp +// +// Created by Nissim Hadar on 8 Aug 2017. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// +#include "HelpWindow.h" -#include "helpwindow.h" -#include "previewpage.h" -#include "ui_helpwindow.h" - -#include -#include -#include -#include -#include -#include - -HelpWindow::HelpWindow(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::HelpWindow) -{ - ui->setupUi(this); - ui->editor->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont)); - ui->preview->setContextMenuPolicy(Qt::NoContextMenu); - - PreviewPage *page = new PreviewPage(this); - ui->preview->setPage(page); - - connect(ui->editor, &QPlainTextEdit::textChanged, - [this]() { m_content.setText(ui->editor->toPlainText()); }); - - QWebChannel *channel = new QWebChannel(this); - channel->registerObject(QStringLiteral("content"), &m_content); - page->setWebChannel(channel); - - ui->preview->setUrl(QUrl("qrc:/index.html")); - - connect(ui->actionNew, &QAction::triggered, this, &HelpWindow::onFileNew); - connect(ui->actionOpen, &QAction::triggered, this, &HelpWindow::onFileOpen); - connect(ui->actionSave, &QAction::triggered, this, &HelpWindow::onFileSave); - connect(ui->actionSaveAs, &QAction::triggered, this, &HelpWindow::onFileSaveAs); - connect(ui->actionExit, &QAction::triggered, this, &HelpWindow::onExit); - - connect(ui->editor->document(), &QTextDocument::modificationChanged, - ui->actionSave, &QAction::setEnabled); - - QFile defaultTextFile(":/default.md"); - defaultTextFile.open(QIODevice::ReadOnly); - ui->editor->setPlainText(defaultTextFile.readAll()); -} - -HelpWindow::~HelpWindow() -{ - delete ui; -} - -void HelpWindow::openFile(const QString &path) -{ - QFile f(path); - if (!f.open(QIODevice::ReadOnly)) { - QMessageBox::warning(this, windowTitle(), - tr("Could not open file %1: %2").arg( - QDir::toNativeSeparators(path), f.errorString())); - return; - } - m_filePath = path; - ui->editor->setPlainText(f.readAll()); -} - -bool HelpWindow::isModified() const -{ - return ui->editor->document()->isModified(); -} - -void HelpWindow::onFileNew() -{ - if (isModified()) { - QMessageBox::StandardButton button = QMessageBox::question(this, windowTitle(), - tr("You have unsaved changes. Do you want to create a new document anyway?")); - if (button != QMessageBox::Yes) - return; - } - - m_filePath.clear(); - ui->editor->setPlainText(tr("## New document")); - ui->editor->document()->setModified(false); -} - -void HelpWindow::onFileOpen() -{ - if (isModified()) { - QMessageBox::StandardButton button = QMessageBox::question(this, windowTitle(), - tr("You have unsaved changes. Do you want to open a new document anyway?")); - if (button != QMessageBox::Yes) - return; - } - - QString path = QFileDialog::getOpenFileName(this, - tr("Open MarkDown File"), "", tr("MarkDown File (*.md)")); - if (path.isEmpty()) - return; - - openFile(path); -} - -void HelpWindow::onFileSave() -{ - if (m_filePath.isEmpty()) { - onFileSaveAs(); - return; - } - - QFile f(m_filePath); - if (!f.open(QIODevice::WriteOnly | QIODevice::Text)) { - QMessageBox::warning(this, windowTitle(), - tr("Could not write to file %1: %2").arg( - QDir::toNativeSeparators(m_filePath), f.errorString())); - return; - } - QTextStream str(&f); - str << ui->editor->toPlainText(); - - ui->editor->document()->setModified(false); -} - -void HelpWindow::onFileSaveAs() -{ - QString path = QFileDialog::getSaveFileName(this, - tr("Save MarkDown File"), "", tr("MarkDown File (*.md, *.markdown)")); - if (path.isEmpty()) - return; - m_filePath = path; - onFileSave(); -} - -void HelpWindow::onExit() -{ - if (isModified()) { - QMessageBox::StandardButton button = QMessageBox::question(this, windowTitle(), - tr("You have unsaved changes. Do you want to exit anyway?")); - if (button != QMessageBox::Yes) - return; - } - close(); +HelpWindow::HelpWindow(QWidget *parent) { + setupUi(this); } diff --git a/tools/auto-tester/src/ui/HelpWindow.h b/tools/auto-tester/src/ui/HelpWindow.h index 7b4c99c9a3..5ce91b360d 100644 --- a/tools/auto-tester/src/ui/HelpWindow.h +++ b/tools/auto-tester/src/ui/HelpWindow.h @@ -1,90 +1,22 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples 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$ -** -****************************************************************************/ +// +// HelpWindow.h +// +// Created by Nissim Hadar on 8 Aug 2017. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// +#ifndef hifi_HelpWindow_h +#define hifi_HelpWindow_h -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#include "ui_HelpWindow.h" -#include "document.h" - -#include -#include - -QT_BEGIN_NAMESPACE -namespace Ui { -class HelpWindow; -} -QT_END_NAMESPACE - -class HelpWindow : public QMainWindow -{ +class HelpWindow : public QDialog, public Ui::HelpWindow { Q_OBJECT public: - explicit HelpWindow(QWidget *parent = nullptr); - ~HelpWindow(); - - void openFile(const QString &path); - -private slots: - void onFileNew(); - void onFileOpen(); - void onFileSave(); - void onFileSaveAs(); - void onExit(); - -private: - bool isModified() const; - - Ui::HelpWindow *ui; - QString m_filePath; - Document m_content; + HelpWindow(QWidget* parent = Q_NULLPTR); }; -#endif // MAINWINDOW_H +#endif \ No newline at end of file diff --git a/tools/auto-tester/src/ui/HelpWindow.ui b/tools/auto-tester/src/ui/HelpWindow.ui index 774e1a8651..d2aa0da0d4 100644 --- a/tools/auto-tester/src/ui/HelpWindow.ui +++ b/tools/auto-tester/src/ui/HelpWindow.ui @@ -1,115 +1,46 @@ HelpWindow - + + + Qt::ApplicationModal + 0 0 - 800 - 600 + 696 + 546 - MarkDown Editor + AutoTester Help - - - - - - Qt::Horizontal - - - - - - - - + - 0 - 0 - 800 - 26 + 50 + 50 + 581 + 381 - - - &File - - - - - - - - - - - + + + + 300 + 460 + 93 + 28 + + - &Open... + Close - - Open document - - - Ctrl+O - - - - - &Save - - - Save current document - - - Ctrl+S - - - - - E&xit - - - Exit editor - - - Ctrl+Q - - - - - Save &As... - - - Save document under different name - - - - - &New - - - Create new document - - - Ctrl+N - - + - - - QWebEngineView - QWidget -
qwebengineview.h
- 1 -
-
+
diff --git a/tools/auto-tester/src/ui/document.cpp b/tools/auto-tester/src/ui/document.cpp deleted file mode 100644 index 20e6b6be9a..0000000000 --- a/tools/auto-tester/src/ui/document.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples 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 "document.h" - -void Document::setText(const QString &text) -{ - if (text == m_text) - return; - m_text = text; - emit textChanged(m_text); -} diff --git a/tools/auto-tester/src/ui/document.h b/tools/auto-tester/src/ui/document.h deleted file mode 100644 index 785ce228f2..0000000000 --- a/tools/auto-tester/src/ui/document.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples 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 DOCUMENT_H -#define DOCUMENT_H - -#include -#include - -class Document : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged FINAL) -public: - explicit Document(QObject *parent = nullptr) : QObject(parent) {} - - void setText(const QString &text); - -signals: - void textChanged(const QString &text); - -private: - QString m_text; -}; - -#endif // DOCUMENT_H diff --git a/tools/auto-tester/src/ui/previewpage.cpp b/tools/auto-tester/src/ui/previewpage.cpp deleted file mode 100644 index 1d81d700c0..0000000000 --- a/tools/auto-tester/src/ui/previewpage.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples 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 "previewpage.h" - -#include - -bool PreviewPage::acceptNavigationRequest(const QUrl &url, - QWebEnginePage::NavigationType /*type*/, - bool /*isMainFrame*/) -{ - // Only allow qrc:/index.html. - if (url.scheme() == QString("qrc")) - return true; - QDesktopServices::openUrl(url); - return false; -} diff --git a/tools/auto-tester/src/ui/previewpage.h b/tools/auto-tester/src/ui/previewpage.h deleted file mode 100644 index eb7d7ab00f..0000000000 --- a/tools/auto-tester/src/ui/previewpage.h +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples 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 PREVIEWPAGE_H -#define PREVIEWPAGE_H - -#include - -class PreviewPage : public QWebEnginePage -{ - Q_OBJECT -public: - explicit PreviewPage(QObject *parent = nullptr) : QWebEnginePage(parent) {} - -protected: - bool acceptNavigationRequest(const QUrl &url, NavigationType type, bool isMainFrame); -}; - -#endif // PREVIEWPAGE_H