From a375f2e2754b4f458358663ffafb009daa715b43 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Tue, 17 Jan 2023 21:07:18 +0200 Subject: 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 --- .../network_remote_stresstest/tst_network_remote_stresstest.cpp | 1 + tests/manual/network_stresstest/tst_network_stresstest.cpp | 1 + tests/manual/qhttpnetworkconnection/main.cpp | 1 + tests/manual/qscreen/propertyfield.cpp | 3 +-- tests/manual/qscreen/propertyfield.h | 4 ++-- tests/manual/qtbug-52641/main.cpp | 1 + tests/manual/qtexttableborders/widget.cpp | 2 +- tests/manual/qtouchevent/main.cpp | 1 + tests/manual/widgets/widgets/defaultUpMenuBar/main.cpp | 2 ++ tests/manual/windowtransparency/CMakeLists.txt | 1 + tests/manual/windowtransparency/windowtransparency.cpp | 1 + 11 files changed, 13 insertions(+), 5 deletions(-) (limited to 'tests/manual') 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 +#include #include #include #include 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 +#include #include #include #include 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 #include #include +#include #include #include #include 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 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 #include -#include +#include /*! 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 #include #include +#include #include 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 #include +#include #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(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 #include +#include class GLWindow : public QWindow { -- cgit v1.2.3