summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorAssam Boudjelthia <assam.boudjelthia@qt.io>2023-01-17 21:07:18 +0200
committerAssam Boudjelthia <assam.boudjelthia@qt.io>2023-01-20 15:48:20 +0200
commita375f2e2754b4f458358663ffafb009daa715b43 (patch)
tree24ddcb1ed23534bce3aa5e294fbd449a9353a79c /tests/manual
parentdbb622a38d6ce4fbd7fba010aea238e5f9552c67 (diff)
Fix build errors in manual tests
various fixes like missing includes, linking, obsolete API usage, etc. Pick-to: 6.5 Change-Id: I786bff396933b87cd39559ac8964d386ef368df1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp1
-rw-r--r--tests/manual/network_stresstest/tst_network_stresstest.cpp1
-rw-r--r--tests/manual/qhttpnetworkconnection/main.cpp1
-rw-r--r--tests/manual/qscreen/propertyfield.cpp3
-rw-r--r--tests/manual/qscreen/propertyfield.h4
-rw-r--r--tests/manual/qtbug-52641/main.cpp1
-rw-r--r--tests/manual/qtexttableborders/widget.cpp2
-rw-r--r--tests/manual/qtouchevent/main.cpp1
-rw-r--r--tests/manual/widgets/widgets/defaultUpMenuBar/main.cpp2
-rw-r--r--tests/manual/windowtransparency/CMakeLists.txt1
-rw-r--r--tests/manual/windowtransparency/windowtransparency.cpp1
11 files changed, 13 insertions, 5 deletions
diff --git a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp
index cc9f361e50..390395a9f6 100644
--- a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp
+++ b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QTest>
+#include <QtTest/qtesteventloop.h>
#include <QtCore/QElapsedTimer>
#include <QtCore/QList>
#include <QtCore/QSemaphore>
diff --git a/tests/manual/network_stresstest/tst_network_stresstest.cpp b/tests/manual/network_stresstest/tst_network_stresstest.cpp
index f740ab654f..29a7d57a84 100644
--- a/tests/manual/network_stresstest/tst_network_stresstest.cpp
+++ b/tests/manual/network_stresstest/tst_network_stresstest.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QTest>
+#include <QtTest/qtesteventloop.h>
#include <QtCore/QElapsedTimer>
#include <QtCore/QList>
#include <QtCore/QSemaphore>
diff --git a/tests/manual/qhttpnetworkconnection/main.cpp b/tests/manual/qhttpnetworkconnection/main.cpp
index d1ea378a7b..f29f823f0c 100644
--- a/tests/manual/qhttpnetworkconnection/main.cpp
+++ b/tests/manual/qhttpnetworkconnection/main.cpp
@@ -5,6 +5,7 @@
#include <QDebug>
#include <qtest.h>
#include <QTest>
+#include <QtTest/qtesteventloop.h>
#include <QtNetwork/qnetworkreply.h>
#include <QtNetwork/qnetworkrequest.h>
#include <QtNetwork/qnetworkaccessmanager.h>
diff --git a/tests/manual/qscreen/propertyfield.cpp b/tests/manual/qscreen/propertyfield.cpp
index 7ed2759634..a184ea3785 100644
--- a/tests/manual/qscreen/propertyfield.cpp
+++ b/tests/manual/qscreen/propertyfield.cpp
@@ -5,7 +5,7 @@
#include <QDebug>
PropertyField::PropertyField(QObject* subject, const QMetaProperty& prop, QWidget *parent)
- : QLineEdit(parent), m_subject(subject), m_lastChangeTime(QTime::currentTime()), m_prop(prop)
+ : QLineEdit(parent), m_subject(subject), m_lastChangeTime(), m_prop(prop)
, m_defaultBrush(palette().brush(QPalette::Active, QPalette::Text))
{
setReadOnly(true);
@@ -57,7 +57,6 @@ void PropertyField::propertyChanged()
if (m_lastText.isEmpty()) {
m_lastText = text;
m_lastTextShowing = text;
- m_lastChangeTime = QTime::currentTime().addSecs(-5);
}
qDebug() << " " << QString::fromUtf8(m_prop.name()) << ':' << val;
diff --git a/tests/manual/qscreen/propertyfield.h b/tests/manual/qscreen/propertyfield.h
index 91960c892a..b5ff55947e 100644
--- a/tests/manual/qscreen/propertyfield.h
+++ b/tests/manual/qscreen/propertyfield.h
@@ -6,7 +6,7 @@
#include <QLineEdit>
#include <QMetaProperty>
-#include <QTime>
+#include <QElapsedTimer>
/*!
A QLineEdit for viewing the text form of a property on an object.
@@ -31,7 +31,7 @@ private:
QObject* m_subject;
QString m_lastText;
QString m_lastTextShowing;
- QTime m_lastChangeTime;
+ QElapsedTimer m_lastChangeTime;
const QMetaProperty m_prop;
QBrush m_defaultBrush;
};
diff --git a/tests/manual/qtbug-52641/main.cpp b/tests/manual/qtbug-52641/main.cpp
index b32e783d5c..27323f1979 100644
--- a/tests/manual/qtbug-52641/main.cpp
+++ b/tests/manual/qtbug-52641/main.cpp
@@ -4,6 +4,7 @@
#include <QApplication>
#include <QFileDialog>
#include <QPainter>
+#include <QPainterPath>
#include <QPdfWriter>
int main(int argc, char *argv[])
diff --git a/tests/manual/qtexttableborders/widget.cpp b/tests/manual/qtexttableborders/widget.cpp
index 1d85b16a12..a5af034562 100644
--- a/tests/manual/qtexttableborders/widget.cpp
+++ b/tests/manual/qtexttableborders/widget.cpp
@@ -68,7 +68,7 @@ void Widget::onPrint()
QPrinter printer(QPrinter::HighResolution);
QPrintDialog dlg(&printer, this);
if (ui->htmlEdit->textCursor().hasSelection())
- dlg.addEnabledOption(QAbstractPrintDialog::PrintSelection);
+ dlg.setOption(QAbstractPrintDialog::PrintSelection, true);
dlg.setWindowTitle(tr("Print Document"));
if (dlg.exec() == QDialog::Accepted) {
ui->htmlEdit->print(&printer);
diff --git a/tests/manual/qtouchevent/main.cpp b/tests/manual/qtouchevent/main.cpp
index 27c3a2176b..43dc10d3ca 100644
--- a/tests/manual/qtouchevent/main.cpp
+++ b/tests/manual/qtouchevent/main.cpp
@@ -3,6 +3,7 @@
#include <QApplication>
#include <QTest>
+#include <QTimer>
#include "ui_form.h"
#include "touchwidget.h"
diff --git a/tests/manual/widgets/widgets/defaultUpMenuBar/main.cpp b/tests/manual/widgets/widgets/defaultUpMenuBar/main.cpp
index 544de6a93d..7eeccf1286 100644
--- a/tests/manual/widgets/widgets/defaultUpMenuBar/main.cpp
+++ b/tests/manual/widgets/widgets/defaultUpMenuBar/main.cpp
@@ -71,9 +71,11 @@ int main(int argc, char **argv)
MainWindow *mainWindow = new MainWindow;
mainWindow->setGeometry(screen->geometry());
mainWindow->winId();
+#ifdef Q_OS_WIN
using namespace QNativeInterface::Private;
if (auto *windowsWindow = dynamic_cast<QWindowsWindow *>(mainWindow->windowHandle()->handle()))
windowsWindow->setHasBorderInFullScreen(true);
+#endif
mainWindow->showMaximized();
}
int ret = a.exec();
diff --git a/tests/manual/windowtransparency/CMakeLists.txt b/tests/manual/windowtransparency/CMakeLists.txt
index 17cf9b362d..59ba273e33 100644
--- a/tests/manual/windowtransparency/CMakeLists.txt
+++ b/tests/manual/windowtransparency/CMakeLists.txt
@@ -13,4 +13,5 @@ qt_internal_add_manual_test(windowtransparency
LIBRARIES
Qt::Gui
Qt::Widgets
+ Qt::OpenGL
)
diff --git a/tests/manual/windowtransparency/windowtransparency.cpp b/tests/manual/windowtransparency/windowtransparency.cpp
index 20a56cc801..2878308bef 100644
--- a/tests/manual/windowtransparency/windowtransparency.cpp
+++ b/tests/manual/windowtransparency/windowtransparency.cpp
@@ -3,6 +3,7 @@
#include <QtGui>
#include <QtWidgets>
+#include <QtOpenGL/QOpenGLShaderProgram>
class GLWindow : public QWindow
{