summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/manual/embeddedintoforeignwindow/main.cpp2
-rw-r--r--tests/manual/gestures/scrollarea/main.cpp2
-rw-r--r--tests/manual/highdpi/main.cpp2
-rw-r--r--tests/manual/qgraphicslayout/flicker/window.cpp5
-rw-r--r--tests/manual/qgraphicslayout/flicker/window.h8
-rw-r--r--tests/manual/qhttpnetworkconnection/main.cpp5
-rw-r--r--tests/manual/qnetworkreply/main.cpp5
-rw-r--r--tests/manual/qsysinfo/main.cpp107
-rw-r--r--tests/manual/qtabbar/main.cpp4
-rw-r--r--tests/manual/textrendering/textperformance/main.cpp8
-rw-r--r--tests/manual/windowflags/controls.cpp14
-rw-r--r--tests/manual/windowgeometry/controllerwidget.cpp14
12 files changed, 39 insertions, 137 deletions
diff --git a/tests/manual/embeddedintoforeignwindow/main.cpp b/tests/manual/embeddedintoforeignwindow/main.cpp
index d6cff8ac04..8827b3a0a2 100644
--- a/tests/manual/embeddedintoforeignwindow/main.cpp
+++ b/tests/manual/embeddedintoforeignwindow/main.cpp
@@ -233,7 +233,7 @@ int main(int argc, char *argv[])
parser.process(QCoreApplication::arguments());
- QtDiag::EventFilter::EventCategories eventCategories = 0;
+ QtDiag::EventFilter::EventCategories eventCategories = {};
for (int i = 0; i < eventFilterOptionCount; ++i) {
if (parser.isSet(QLatin1String(eventFilterOptions[i].name)))
eventCategories |= eventFilterOptions[i].categories;
diff --git a/tests/manual/gestures/scrollarea/main.cpp b/tests/manual/gestures/scrollarea/main.cpp
index 83197a9c7f..517054eeb9 100644
--- a/tests/manual/gestures/scrollarea/main.cpp
+++ b/tests/manual/gestures/scrollarea/main.cpp
@@ -203,7 +203,7 @@ public:
QWidget *w = new QWidget;
w->setMinimumWidth(700);
QVBoxLayout *l = new QVBoxLayout(w);
- l->setMargin(20);
+ l->setContentsMargins(20, 20, 20, 20);
for (int i = 0; i < 100; ++i) {
QWidget *w = new QWidget;
QHBoxLayout *ll = new QHBoxLayout(w);
diff --git a/tests/manual/highdpi/main.cpp b/tests/manual/highdpi/main.cpp
index d4fe1d00c6..f976d1c590 100644
--- a/tests/manual/highdpi/main.cpp
+++ b/tests/manual/highdpi/main.cpp
@@ -286,7 +286,7 @@ DemoController::DemoController(DemoContainerList demos, QCommandLineParser *pars
button->setChecked(true);
}
}
- connect(m_group, QOverload<int,bool>::of(&QButtonGroup::buttonToggled),
+ connect(m_group, &QButtonGroup::idToggled,
this, &DemoController::handleButton);
}
diff --git a/tests/manual/qgraphicslayout/flicker/window.cpp b/tests/manual/qgraphicslayout/flicker/window.cpp
index 32d12f35ee..f5f4131ab7 100644
--- a/tests/manual/qgraphicslayout/flicker/window.cpp
+++ b/tests/manual/qgraphicslayout/flicker/window.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -41,7 +41,7 @@ void SlowWidget::setGeometry(const QRectF &rect)
qDebug() << "currentBenchmarkIteration:" << stats.currentBenchmarkIteration;
if (stats.currentBenchmarkIteration == m_window->m_benchmarkIterationsSpinBox->value()) {
if (stats.output)
- stats.output->setText(tr("DONE. Elapsed: %1, setGeometryCount: %2").arg(stats.time.elapsed()).arg(stats.setGeometryCount));
+ stats.output->setText(tr("DONE. Elapsed: %1, setGeometryCount: %2").arg(stats.timer.elapsed()).arg(stats.setGeometryCount));
} else {
reiterate = true;
}
@@ -57,4 +57,3 @@ void SlowWidget::setGeometry(const QRectF &rect)
//QTimer::singleShot(0, m_window, SLOT(doAgain()));
}
}
-
diff --git a/tests/manual/qgraphicslayout/flicker/window.h b/tests/manual/qgraphicslayout/flicker/window.h
index b2ebe60af4..cb1ac16016 100644
--- a/tests/manual/qgraphicslayout/flicker/window.h
+++ b/tests/manual/qgraphicslayout/flicker/window.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -43,7 +43,7 @@
#include <QApplication>
#include <QThread>
#include <QMap>
-#include <QTime>
+#include <QElapsedTimer>
#include <QDebug>
struct Statistics {
@@ -52,7 +52,7 @@ struct Statistics {
{
}
QMap<QGraphicsWidget*, int> setGeometryTracker;
- QTime time;
+ QElapsedTimer timer;
int setGeometryCount;
int sleepMsecs;
QLabel *output;
@@ -227,7 +227,7 @@ private slots:
m_stats.setGeometryCount = 0;
m_stats.setGeometryTracker.clear();
m_stats.sleepMsecs = m_sleepSpinBox->value();
- m_stats.time.start();
+ m_stats.timer.start();
m_stats.currentBenchmarkIteration = 0;
m_leaf->setMinimumSize(sz);
m_leaf->setMaximumSize(sz);
diff --git a/tests/manual/qhttpnetworkconnection/main.cpp b/tests/manual/qhttpnetworkconnection/main.cpp
index d67d76699c..a588e08e9b 100644
--- a/tests/manual/qhttpnetworkconnection/main.cpp
+++ b/tests/manual/qhttpnetworkconnection/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -33,6 +33,7 @@
#include <QtNetwork/qnetworkreply.h>
#include <QtNetwork/qnetworkrequest.h>
#include <QtNetwork/qnetworkaccessmanager.h>
+#include <QtCore/QElapsedTimer>
class tst_qhttpnetworkconnection : public QObject
{
@@ -48,7 +49,7 @@ void tst_qhttpnetworkconnection::bigRemoteFile()
{
QNetworkAccessManager manager;
qint64 size;
- QTime t;
+ QElapsedTimer t;
QNetworkRequest request(QUrl(QString::fromLatin1(urlC)));
QNetworkReply* reply = manager.get(request);
connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()), Qt::QueuedConnection);
diff --git a/tests/manual/qnetworkreply/main.cpp b/tests/manual/qnetworkreply/main.cpp
index 0ba8a19913..8cf725dbd3 100644
--- a/tests/manual/qnetworkreply/main.cpp
+++ b/tests/manual/qnetworkreply/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
** Contact: https://www.qt.io/licensing/
**
@@ -37,6 +37,7 @@
#include <QtNetwork/qsslconfiguration.h>
#include <QtNetwork/qhttpmultipart.h>
#include <QtNetwork/qauthenticator.h>
+#include <QtCore/QElapsedTimer>
#include <QtCore/QJsonDocument>
#include "../../auto/network-settings.h"
@@ -99,7 +100,7 @@ class HttpReceiver : public QObject
}
protected:
QTimer *timer;
- QTime stopwatch;
+ QElapsedTimer stopwatch;
};
void tst_qnetworkreply::initTestCase()
diff --git a/tests/manual/qsysinfo/main.cpp b/tests/manual/qsysinfo/main.cpp
index 1d39514236..119bb7682e 100644
--- a/tests/manual/qsysinfo/main.cpp
+++ b/tests/manual/qsysinfo/main.cpp
@@ -32,107 +32,6 @@
#include <stdio.h>
-#if QT_DEPRECATED_SINCE(5, 9)
-#define CASE_VERSION(v) case QSysInfo::v: return QT_STRINGIFY(v)
-
-QByteArray windowsVersionToString(QSysInfo::WinVersion v)
-{
- switch (v) {
- CASE_VERSION(WV_None);
-
- CASE_VERSION(WV_32s);
- CASE_VERSION(WV_95);
- CASE_VERSION(WV_98);
- CASE_VERSION(WV_Me);
- case QSysInfo::WV_DOS_based: // shouldn't happen
- break;
-
- CASE_VERSION(WV_NT);
- CASE_VERSION(WV_2000);
- CASE_VERSION(WV_XP);
- CASE_VERSION(WV_2003);
- CASE_VERSION(WV_VISTA);
- CASE_VERSION(WV_WINDOWS7);
- CASE_VERSION(WV_WINDOWS8);
- CASE_VERSION(WV_WINDOWS8_1);
- CASE_VERSION(WV_WINDOWS10);
- case QSysInfo::WV_NT_based: // shouldn't happen
- case QSysInfo::WV_CE:
- case QSysInfo::WV_CENET:
- case QSysInfo::WV_CE_5:
- case QSysInfo::WV_CE_6:
- case QSysInfo::WV_CE_based:
- break;
- }
-
- return "WinVersion(0x" + QByteArray::number(v, 16) + ')';
-}
-
-QByteArray macVersionToString(QSysInfo::MacVersion v)
-{
- switch (v) {
- CASE_VERSION(MV_None);
- CASE_VERSION(MV_Unknown);
-
- CASE_VERSION(MV_9);
- CASE_VERSION(MV_10_0);
- CASE_VERSION(MV_10_1);
- CASE_VERSION(MV_10_2);
- CASE_VERSION(MV_10_3);
- CASE_VERSION(MV_10_4);
- CASE_VERSION(MV_10_5);
- CASE_VERSION(MV_10_6);
- CASE_VERSION(MV_10_7);
- CASE_VERSION(MV_10_8);
- CASE_VERSION(MV_10_9);
- CASE_VERSION(MV_10_10);
- CASE_VERSION(MV_10_11);
- CASE_VERSION(MV_10_12);
-
- CASE_VERSION(MV_IOS_4_3);
- CASE_VERSION(MV_IOS_5_0);
- CASE_VERSION(MV_IOS_5_1);
- CASE_VERSION(MV_IOS_6_0);
- CASE_VERSION(MV_IOS_6_1);
- CASE_VERSION(MV_IOS_7_0);
- CASE_VERSION(MV_IOS_7_1);
- CASE_VERSION(MV_IOS_8_0);
- CASE_VERSION(MV_IOS_8_1);
- CASE_VERSION(MV_IOS_8_2);
- CASE_VERSION(MV_IOS_8_3);
- CASE_VERSION(MV_IOS_8_4);
- CASE_VERSION(MV_IOS_9_0);
- CASE_VERSION(MV_IOS_9_1);
- CASE_VERSION(MV_IOS_9_2);
- CASE_VERSION(MV_IOS_9_3);
- CASE_VERSION(MV_IOS_10_0);
- case QSysInfo::MV_IOS: // shouldn't happen:
- case QSysInfo::MV_TVOS:
- case QSysInfo::MV_WATCHOS:
- break;
-
- CASE_VERSION(MV_TVOS_9_0);
- CASE_VERSION(MV_TVOS_9_1);
- CASE_VERSION(MV_TVOS_9_2);
- CASE_VERSION(MV_TVOS_10_0);
-
- CASE_VERSION(MV_WATCHOS_2_0);
- CASE_VERSION(MV_WATCHOS_2_1);
- CASE_VERSION(MV_WATCHOS_2_2);
- CASE_VERSION(MV_WATCHOS_3_0);
- }
-
- if (v & QSysInfo::MV_IOS) {
- int major = (v >> 4) & 0xf;
- int minor = v & 0xf;
- return "MacVersion(Q_MV_IOS("
- + QByteArray::number(major) + ", "
- + QByteArray::number(minor) + "))";
- }
- return "MacVersion(Q_MV_OSX(10, " + QByteArray::number(v - 2) + "))";
-}
-#endif
-
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
@@ -140,12 +39,6 @@ int main(int argc, char *argv[])
printf("QSysInfo::WordSize = %d\n", QSysInfo::WordSize);
printf("QSysInfo::ByteOrder = QSysInfo::%sEndian\n",
QSysInfo::ByteOrder == QSysInfo::LittleEndian ? "Little" : "Big");
-#if QT_DEPRECATED_SINCE(5, 9)
- printf("QSysInfo::WindowsVersion = QSysInfo::%s\n",
- windowsVersionToString(QSysInfo::WindowsVersion).constData());
- printf("QSysInfo::MacintoshVersion = QSysInfo::%s\n",
- macVersionToString(QSysInfo::MacintoshVersion).constData());
-#endif
printf("QSysInfo::buildCpuArchitecture() = %s\n", qPrintable(QSysInfo::buildCpuArchitecture()));
printf("QSysInfo::currentCpuArchitecture() = %s\n", qPrintable(QSysInfo::currentCpuArchitecture()));
printf("QSysInfo::buildAbi() = %s\n", qPrintable(QSysInfo::buildAbi()));
diff --git a/tests/manual/qtabbar/main.cpp b/tests/manual/qtabbar/main.cpp
index 6af80958cd..f916141497 100644
--- a/tests/manual/qtabbar/main.cpp
+++ b/tests/manual/qtabbar/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -231,7 +231,7 @@ int main(int argc, char *argv[])
QApplication::sendEvent(&tabBar, new QEvent(QEvent::StyleChange));
});
- layout->setMargin(12);
+ layout->setContentsMargins(12, 12, 12, 12);
widget.show();
return app.exec();
diff --git a/tests/manual/textrendering/textperformance/main.cpp b/tests/manual/textrendering/textperformance/main.cpp
index eb6d09b9c8..8fb3a3c4a2 100644
--- a/tests/manual/textrendering/textperformance/main.cpp
+++ b/tests/manual/textrendering/textperformance/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -31,7 +31,7 @@
#include <QFontDatabase>
#include <QPainter>
#include <QRandomGenerator>
-#include <QTime>
+#include <QElapsedTimer>
#include <QTimer>
static const int lastMeasurementsCount = 50;
@@ -53,7 +53,7 @@ public:
Q_UNUSED(event);
QPainter p(this);
- if (!m_timer.isNull())
+ if (m_timer.isValid())
m_lastMeasurements.append(m_timer.elapsed());
m_timer.start();
@@ -195,7 +195,7 @@ private:
int m_currentMode;
QList<int> m_lastMeasurements;
- QTime m_timer;
+ QElapsedTimer m_timer;
};
const struct FontBlaster::mode FontBlaster::m_modes[] = {
diff --git a/tests/manual/windowflags/controls.cpp b/tests/manual/windowflags/controls.cpp
index b999a59abe..410b928299 100644
--- a/tests/manual/windowflags/controls.cpp
+++ b/tests/manual/windowflags/controls.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -72,7 +72,8 @@ HintControl::HintControl(QWidget *parent)
connect(transparentForInputCheckBox, SIGNAL(clicked()), this, SLOT(slotCheckBoxChanged()));
QGridLayout *layout = new QGridLayout(this);
layout->setSpacing(0);
- layout->setMargin(ControlLayoutMargin);
+ layout->setContentsMargins(ControlLayoutMargin, ControlLayoutMargin,
+ ControlLayoutMargin, ControlLayoutMargin);
layout->addWidget(msWindowsFixedSizeDialogCheckBox, 0, 0);
layout->addWidget(x11BypassWindowManagerCheckBox, 1, 0);
layout->addWidget(framelessWindowCheckBox, 2, 0);
@@ -171,7 +172,8 @@ WindowStateControl::WindowStateControl(QWidget *parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
group->setExclusive(false);
- layout->setMargin(ControlLayoutMargin);
+ layout->setContentsMargins(ControlLayoutMargin, ControlLayoutMargin,
+ ControlLayoutMargin, ControlLayoutMargin);
group->addButton(restoreButton, Qt::WindowNoState);
restoreButton->setEnabled(false);
layout->addWidget(restoreButton);
@@ -214,7 +216,8 @@ WindowStatesControl::WindowStatesControl(QWidget *parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setSpacing(0);
- layout->setMargin(ControlLayoutMargin);
+ layout->setContentsMargins(ControlLayoutMargin, ControlLayoutMargin,
+ ControlLayoutMargin, ControlLayoutMargin);
connect(visibleCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
layout->addWidget(visibleCheckBox);
connect(activeCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
@@ -280,7 +283,8 @@ TypeControl::TypeControl(QWidget *parent)
group->setExclusive(true);
QGridLayout *layout = new QGridLayout(this);
layout->setSpacing(0);
- layout->setMargin(ControlLayoutMargin);
+ layout->setContentsMargins(ControlLayoutMargin, ControlLayoutMargin,
+ ControlLayoutMargin, ControlLayoutMargin);
group->addButton(windowRadioButton, Qt::Window);
layout->addWidget(windowRadioButton, 0, 0);
group->addButton(dialogRadioButton, Qt::Dialog);
diff --git a/tests/manual/windowgeometry/controllerwidget.cpp b/tests/manual/windowgeometry/controllerwidget.cpp
index b05ea2907e..3ad0cfb409 100644
--- a/tests/manual/windowgeometry/controllerwidget.cpp
+++ b/tests/manual/windowgeometry/controllerwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -85,7 +85,8 @@ RectControl::RectControl()
{
QHBoxLayout *l = new QHBoxLayout(this);
l->setSpacing(0);
- l->setMargin(ControlLayoutMargin);
+ l->setContentsMargins(ControlLayoutMargin, ControlLayoutMargin,
+ ControlLayoutMargin, ControlLayoutMargin);
connect(m_point, SIGNAL(pointValueChanged(QPoint)), this, SLOT(handleChanged()));
connect(m_point, SIGNAL(pointValueChanged(QPoint)), this, SIGNAL(positionChanged(QPoint)));
l->addWidget(m_point);
@@ -128,11 +129,13 @@ BaseWindowControl::BaseWindowControl(QObject *w)
m_geometry->setTitle(tr("Geometry"));
int row = 0;
m_layout->addWidget(m_geometry, row, 0, 1, 2);
- m_layout->setMargin(ControlLayoutMargin);
+ m_layout->setContentsMargins(ControlLayoutMargin, ControlLayoutMargin,
+ ControlLayoutMargin, ControlLayoutMargin);
QGroupBox *frameGB = new QGroupBox(tr("Frame"));
QVBoxLayout *frameL = new QVBoxLayout(frameGB);
frameL->setSpacing(0);
- frameL->setMargin(ControlLayoutMargin);
+ frameL->setContentsMargins(ControlLayoutMargin, ControlLayoutMargin,
+ ControlLayoutMargin, ControlLayoutMargin);
frameL->addWidget(m_framePosition);
m_layout->addWidget(frameGB, row, 2);
@@ -144,7 +147,8 @@ BaseWindowControl::BaseWindowControl(QObject *w)
QGroupBox *eventGroupBox = new QGroupBox(tr("Events"));
QVBoxLayout *l = new QVBoxLayout(eventGroupBox);
l->setSpacing(0);
- l->setMargin(ControlLayoutMargin);
+ l->setContentsMargins(ControlLayoutMargin, ControlLayoutMargin,
+ ControlLayoutMargin, ControlLayoutMargin);
l->addWidget(m_moveEventLabel);
l->addWidget(m_resizeEventLabel);
l->addWidget(m_mouseEventLabel);