diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2019-11-14 13:03:46 +0100 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2019-11-19 13:53:21 +0100 |
commit | 26e876912435bdafbca2b425af43824d7ec5b876 (patch) | |
tree | b7ee83cdd9de18ce5970bab0bb217a972d3d2445 /tests/manual | |
parent | 7a6c6da2ebbfef33f7284ce5c96aa0c3acabc6bc (diff) | |
parent | bac999f38ca10147832846f6d7df1e4a051d3760 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
Diffstat (limited to 'tests/manual')
26 files changed, 139 insertions, 66 deletions
diff --git a/tests/manual/cocoa/menurama/menurama.pro b/tests/manual/cocoa/menurama/menurama.pro index da6f224e0d..f0928be31d 100644 --- a/tests/manual/cocoa/menurama/menurama.pro +++ b/tests/manual/cocoa/menurama/menurama.pro @@ -4,9 +4,7 @@ # #------------------------------------------------- -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui widgets TARGET = Menurama TEMPLATE = app diff --git a/tests/manual/corelib/tools/qhash/main.cpp b/tests/manual/corelib/tools/qhash/main.cpp index b2c40f2183..298d1777ea 100644 --- a/tests/manual/corelib/tools/qhash/main.cpp +++ b/tests/manual/corelib/tools/qhash/main.cpp @@ -27,7 +27,6 @@ ****************************************************************************/ #include <QDebug> -//#define QT_STRICT_ITERATORS #include <QHash> void testEraseNoError() diff --git a/tests/manual/corelib/tools/qlist/main.cpp b/tests/manual/corelib/tools/qlist/main.cpp index 3f8ade5778..0b54105f5e 100644 --- a/tests/manual/corelib/tools/qlist/main.cpp +++ b/tests/manual/corelib/tools/qlist/main.cpp @@ -26,7 +26,6 @@ ** ****************************************************************************/ #include <QDebug> -//#define QT_STRICT_ITERATORS #include <QVector> void testErase() { @@ -55,4 +54,4 @@ int main() // testErase(); testInsert(); return 0; -}
\ No newline at end of file +} diff --git a/tests/manual/corelib/tools/qset/main.cpp b/tests/manual/corelib/tools/qset/main.cpp index 1066e53e7d..701c8889db 100644 --- a/tests/manual/corelib/tools/qset/main.cpp +++ b/tests/manual/corelib/tools/qset/main.cpp @@ -27,7 +27,6 @@ ****************************************************************************/ #include <QDebug> -//#define QT_STRICT_ITERATORS #include <QSet> void testErase() diff --git a/tests/manual/corelib/tools/qvarlengtharray/main.cpp b/tests/manual/corelib/tools/qvarlengtharray/main.cpp index 8580d97a36..0544bb0c4b 100644 --- a/tests/manual/corelib/tools/qvarlengtharray/main.cpp +++ b/tests/manual/corelib/tools/qvarlengtharray/main.cpp @@ -27,7 +27,6 @@ ****************************************************************************/ #include <QDebug> -//#define QT_STRICT_ITERATORS #include <QVarLengthArray> void testErase() diff --git a/tests/manual/corelib/tools/qvector/main.cpp b/tests/manual/corelib/tools/qvector/main.cpp index e3dc89b149..1b35123f15 100644 --- a/tests/manual/corelib/tools/qvector/main.cpp +++ b/tests/manual/corelib/tools/qvector/main.cpp @@ -27,7 +27,6 @@ ****************************************************************************/ #include <QDebug> -//#define QT_STRICT_ITERATORS #include <QVector> void testErase() diff --git a/tests/manual/diaglib/diaglib.pri b/tests/manual/diaglib/diaglib.pri index b57ee75841..ace9caecc6 100644 --- a/tests/manual/diaglib/diaglib.pri +++ b/tests/manual/diaglib/diaglib.pri @@ -17,20 +17,8 @@ win32:!winrt: { SOURCES += $$PWD/nativewindowdump.cpp } -greaterThan(QT_MAJOR_VERSION, 4) { - QT += gui-private core-private - contains(QT, widgets) { - HEADERS += \ - $$PWD/qwidgetdump.h \ - $$PWD/debugproxystyle.h \ - $$PWD/logwidget.h - - SOURCES += \ - $$PWD/qwidgetdump.cpp \ - $$PWD/debugproxystyle.cpp \ - $$PWD/logwidget.cpp - } -} else { +QT += gui-private core-private +contains(QT, widgets) { HEADERS += \ $$PWD/qwidgetdump.h \ $$PWD/debugproxystyle.h \ @@ -40,14 +28,17 @@ greaterThan(QT_MAJOR_VERSION, 4) { $$PWD/qwidgetdump.cpp \ $$PWD/debugproxystyle.cpp \ $$PWD/logwidget.cpp + QT += widgets-private } contains(QT, opengl) { -HEADERS += \ - $$PWD/glinfo.h + HEADERS += \ + $$PWD/glinfo.h -SOURCES += \ - $$PWD/glinfo.cpp + SOURCES += \ + $$PWD/glinfo.cpp + + QT += opengl } DEFINES += QT_DIAG_LIB diff --git a/tests/manual/dialogs/dialogs.pro b/tests/manual/dialogs/dialogs.pro index d765b8cf05..1beedc251e 100644 --- a/tests/manual/dialogs/dialogs.pro +++ b/tests/manual/dialogs/dialogs.pro @@ -1,9 +1,5 @@ -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4) { - QT += widgets - qtHaveModule(printsupport): QT += printsupport -} +QT += core gui widgets +qtHaveModule(printsupport): QT += printsupport TARGET = dialogs TEMPLATE = app diff --git a/tests/manual/dialogs/messageboxpanel.cpp b/tests/manual/dialogs/messageboxpanel.cpp index ef6731cd74..3c6a042e19 100644 --- a/tests/manual/dialogs/messageboxpanel.cpp +++ b/tests/manual/dialogs/messageboxpanel.cpp @@ -39,6 +39,8 @@ #include <QLineEdit> #include <QLabel> #include <QCheckBox> +#include <QRegularExpressionValidator> +#include <QRegularExpression> MessageBoxPanel::MessageBoxPanel(QWidget *parent) : QWidget(parent) ,m_iconComboBox(new QComboBox) @@ -80,7 +82,7 @@ MessageBoxPanel::MessageBoxPanel(QWidget *parent) : QWidget(parent) // buttons mask optionsLayout->addWidget(new QLabel(QString::fromLatin1("Message box button mask (in hex)"))); - m_validator = new QRegExpValidator(QRegExp("0[xX]?[0-9a-fA-F]+"), this); + m_validator = new QRegularExpressionValidator(QRegularExpression("0[xX]?[0-9a-fA-F]+"), this); m_buttonsMask->setMaxLength(10); m_buttonsMask->setValidator(m_validator); m_buttonsMask->setText(QString::fromLatin1("0x00300400")); diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro index 42f9878e44..de13bc799e 100644 --- a/tests/manual/manual.pro +++ b/tests/manual/manual.pro @@ -67,8 +67,4 @@ qtConfig(opengl) { win32: SUBDIRS -= network_remote_stresstest network_stresstest -lessThan(QT_MAJOR_VERSION, 5): SUBDIRS -= bearerex lance qnetworkaccessmanager/qget qmimedatabase qnetworkreply \ -qpainfo qscreen socketengine xembed-raster xembed-widgets windowtransparency \ -embeddedintoforeignwindow foreignwindows - qtConfig(vulkan): SUBDIRS += qvulkaninstance diff --git a/tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro b/tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro index 3a8fc25b33..b0a5a75a67 100644 --- a/tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro +++ b/tests/manual/qcursor/qcursorhighdpi/qcursorhighdpi.pro @@ -1,6 +1,5 @@ TEMPLATE = app -QT = core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += gui-private core-private widgets +QT = core gui gui-private core-private widgets CONFIG -= app_bundle SOURCES += main.cpp win32: LIBS += -lUser32 diff --git a/tests/manual/qtexteditlist/qtexteditlist.pro b/tests/manual/qtexteditlist/qtexteditlist.pro index 953333f3ee..972e054445 100644 --- a/tests/manual/qtexteditlist/qtexteditlist.pro +++ b/tests/manual/qtexteditlist/qtexteditlist.pro @@ -1,6 +1,6 @@ #This project can be used to verify QTBUG-5111 case. QT += core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += widgets TARGET = qtexteditlist TEMPLATE = app SOURCES += main.cpp widget.cpp diff --git a/tests/manual/qtexttableborders/qtexttableborders.pro b/tests/manual/qtexttableborders/qtexttableborders.pro index 7e454f978d..3805ac6ed0 100644 --- a/tests/manual/qtexttableborders/qtexttableborders.pro +++ b/tests/manual/qtexttableborders/qtexttableborders.pro @@ -1,7 +1,6 @@ #This project can be used to verify QTBUG-36152 case. -QT += core gui printsupport +QT += core gui printsupport widgets CONFIG += c++11 -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = qtexttableborders TEMPLATE = app SOURCES += main.cpp widget.cpp diff --git a/tests/manual/qtouchevent/qtouchevent.pro b/tests/manual/qtouchevent/qtouchevent.pro index 81384eaf24..4ba921d301 100644 --- a/tests/manual/qtouchevent/qtouchevent.pro +++ b/tests/manual/qtouchevent/qtouchevent.pro @@ -1,5 +1,4 @@ -QT += testlib -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += testlib widgets SOURCES = main.cpp \ touchwidget.cpp FORMS += form.ui diff --git a/tests/manual/touch/touch.pro b/tests/manual/touch/touch.pro index fcb3c47f43..08e3fdcd71 100644 --- a/tests/manual/touch/touch.pro +++ b/tests/manual/touch/touch.pro @@ -1,5 +1,4 @@ TEMPLATE = app -QT = core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT = core gui widgets CONFIG -= app_bundle SOURCES += main.cpp diff --git a/tests/manual/unc/unc.pro b/tests/manual/unc/unc.pro index 977bd0c177..a1536a03db 100644 --- a/tests/manual/unc/unc.pro +++ b/tests/manual/unc/unc.pro @@ -1,5 +1,4 @@ -QT += core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui widgets TEMPLATE = app diff --git a/tests/manual/wasm/localfiles/localfiles.pro b/tests/manual/wasm/localfiles/localfiles.pro new file mode 100644 index 0000000000..04ad4c0ce1 --- /dev/null +++ b/tests/manual/wasm/localfiles/localfiles.pro @@ -0,0 +1,8 @@ +TEMPLATE = app +TARGET = localfiles +QT += core gui widgets + +OBJECTS_DIR = .obj +MOC_DIR = .moc + +SOURCES += main.cpp diff --git a/tests/manual/wasm/localfiles/main.cpp b/tests/manual/wasm/localfiles/main.cpp new file mode 100644 index 0000000000..9dfc30885c --- /dev/null +++ b/tests/manual/wasm/localfiles/main.cpp @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2019 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 <QtWidgets/QtWidgets> + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + + QByteArray content; + + QWidget loadFileUi; + QVBoxLayout *layout = new QVBoxLayout(); + QPushButton *loadFile = new QPushButton("Load File"); + QLabel *fileInfo = new QLabel("Opened file:"); + fileInfo->setTextInteractionFlags(Qt::TextSelectableByMouse); + QLabel *fileHash = new QLabel("Sha256:"); + fileHash->setTextInteractionFlags(Qt::TextSelectableByMouse); + QPushButton *saveFile = new QPushButton("Save File"); + saveFile->setEnabled(false); + + auto onFileReady = [=, &content](const QString &fileName, const QByteArray &fileContents) { + content = fileContents; + fileInfo->setText(QString("Opened file: %1 size: %2").arg(fileName).arg(fileContents.size())); + saveFile->setEnabled(true); + + auto computeDisplayFileHash = [=](){ + QByteArray hash = QCryptographicHash::hash(fileContents, QCryptographicHash::Sha256); + fileHash->setText(QString("Sha256: %1").arg(QString(hash.toHex()))); + }; + + QTimer::singleShot(100, computeDisplayFileHash); // update UI before computing hash + }; + auto onLoadClicked = [=](){ + QFileDialog::getOpenFileContent("*.*", onFileReady); + }; + QObject::connect(loadFile, &QPushButton::clicked, onLoadClicked); + + auto onSaveClicked = [=, &content]() { + QFileDialog::saveFileContent(content, "qtsavefiletest.dat"); + }; + QObject::connect(saveFile, &QPushButton::clicked, onSaveClicked); + + layout->addWidget(loadFile); + layout->addWidget(fileInfo); + layout->addWidget(fileHash); + layout->addWidget(saveFile); + layout->addStretch(); + + loadFileUi.setLayout(layout); + loadFileUi.show(); + + return app.exec(); +} diff --git a/tests/manual/widgetgrab/widgetgrab.pro b/tests/manual/widgetgrab/widgetgrab.pro index d206fb1df1..c354711197 100644 --- a/tests/manual/widgetgrab/widgetgrab.pro +++ b/tests/manual/widgetgrab/widgetgrab.pro @@ -1,9 +1,5 @@ -QT += core gui +QT += core gui widgets TARGET = widgetgrab TEMPLATE = app SOURCES += main.cpp - -greaterThan(QT_MAJOR_VERSION, 4) { - QT += widgets -} diff --git a/tests/manual/widgets/styles/styles.pro b/tests/manual/widgets/styles/styles.pro index 68980ae867..1830e21705 100644 --- a/tests/manual/widgets/styles/styles.pro +++ b/tests/manual/widgets/styles/styles.pro @@ -1,5 +1,6 @@ TEMPLATE = app -QT = tst_manual_widgets +QT = widgets +TARGET = tst_manual_styles CONFIG += cmdline CONFIG += c++11 diff --git a/tests/manual/widgets/widgets.pro b/tests/manual/widgets/widgets.pro index e3942a49e9..03aaa880b8 100644 --- a/tests/manual/widgets/widgets.pro +++ b/tests/manual/widgets/widgets.pro @@ -1,3 +1,2 @@ TEMPLATE = subdirs -SUBDIRS = itemviews qgraphicsview kernel widgets -greaterThan(QT_MAJOR_VERSION, 4): SUBDIRS += styles +SUBDIRS = itemviews qgraphicsview kernel widgets styles diff --git a/tests/manual/widgets/widgets/bigmenucreator/bigmenucreator.pro b/tests/manual/widgets/widgets/bigmenucreator/bigmenucreator.pro index 69fbea3834..408dab6482 100644 --- a/tests/manual/widgets/widgets/bigmenucreator/bigmenucreator.pro +++ b/tests/manual/widgets/widgets/bigmenucreator/bigmenucreator.pro @@ -4,9 +4,7 @@ # #------------------------------------------------- -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui widgets TARGET = BigMenuCreator TEMPLATE = app diff --git a/tests/manual/windowchildgeometry/windowchildgeometry.pro b/tests/manual/windowchildgeometry/windowchildgeometry.pro index 921acd8a4e..7722547ce7 100644 --- a/tests/manual/windowchildgeometry/windowchildgeometry.pro +++ b/tests/manual/windowchildgeometry/windowchildgeometry.pro @@ -1,5 +1,4 @@ -QT += core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui widgets TARGET = windowchildgeometry TEMPLATE = app diff --git a/tests/manual/windowflags/windowflags.pro b/tests/manual/windowflags/windowflags.pro index 626684cccd..4cd60ae6cf 100644 --- a/tests/manual/windowflags/windowflags.pro +++ b/tests/manual/windowflags/windowflags.pro @@ -9,4 +9,4 @@ SOURCES = controllerwindow.cpp \ main.cpp \ controls.cpp -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += widgets diff --git a/tests/manual/windowgeometry/windowgeometry.pro b/tests/manual/windowgeometry/windowgeometry.pro index e717799649..ee99f1950c 100644 --- a/tests/manual/windowgeometry/windowgeometry.pro +++ b/tests/manual/windowgeometry/windowgeometry.pro @@ -1,5 +1,4 @@ -QT += core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui widgets TARGET = windowgeometry TEMPLATE = app diff --git a/tests/manual/windowmodality/windowmodality.pro b/tests/manual/windowmodality/windowmodality.pro index b29e939d27..973579c508 100644 --- a/tests/manual/windowmodality/windowmodality.pro +++ b/tests/manual/windowmodality/windowmodality.pro @@ -1,3 +1,3 @@ SOURCES = main.cpp FORMS = widget.ui dialog.ui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport +QT += widgets printsupport |