summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/bearerex/bearerex.cpp24
-rw-r--r--tests/manual/bearerex/bearerex.pro1
-rw-r--r--tests/manual/cocoa/menus/menus.pro1
-rw-r--r--tests/manual/cocoa/nativewidgets/nativewigets.pro1
-rw-r--r--tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.h2
-rw-r--r--tests/manual/cocoa/qmaccocoaviewcontainer/qmaccocoaviewcontainer.pro2
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/main.mm2
-rw-r--r--tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro2
-rw-r--r--tests/manual/cocoa/wheelevent/wheelevent.pro1
-rw-r--r--tests/manual/diaglib/README.txt5
-rw-r--r--tests/manual/diaglib/debugproxystyle.cpp161
-rw-r--r--tests/manual/diaglib/debugproxystyle.h63
-rw-r--r--tests/manual/diaglib/diaglib.pri4
-rw-r--r--tests/manual/gestures/graphicsview/graphicsview.pro1
-rw-r--r--tests/manual/gestures/graphicsview/main.cpp2
-rw-r--r--tests/manual/gestures/scrollarea/scrollarea.pro1
-rw-r--r--tests/manual/highdpi/dragwidget.cpp2
-rw-r--r--tests/manual/highdpi/main.cpp6
-rw-r--r--tests/manual/inputmethodhints/inputmethodhints.pro1
-rw-r--r--tests/manual/keypadnavigation/keypadnavigation.pro1
-rw-r--r--tests/manual/lance/lance.pro1
-rw-r--r--tests/manual/lance/main.cpp2
-rw-r--r--tests/manual/network_remote_stresstest/network_remote_stresstest.pro1
-rw-r--r--tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp19
-rw-r--r--tests/manual/network_stresstest/minihttpserver.cpp2
-rw-r--r--tests/manual/qcursor/allcursors/allcursors.pro1
-rw-r--r--tests/manual/qcursor/grab_override/grab_override.pro1
-rw-r--r--tests/manual/qdesktopwidget/qdesktopwidget.pro1
-rw-r--r--tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro1
-rw-r--r--tests/manual/qgraphicslayout/flicker/flicker.pro1
-rw-r--r--tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro1
-rw-r--r--tests/manual/qimagereader/qimagereader.pro1
-rw-r--r--tests/manual/qlocale/qlocale.pro1
-rw-r--r--tests/manual/qnetworkaccessmanager/qget/qget.cpp2
-rw-r--r--tests/manual/qnetworkaccessmanager/qget/qget.pro1
-rw-r--r--tests/manual/qnetworkaccessmanager/qget/transferitem.cpp4
-rw-r--r--tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro1
-rw-r--r--tests/manual/qnetworkreply/main.cpp2
-rw-r--r--tests/manual/qnetworkreply/qnetworkreply.pro1
-rw-r--r--tests/manual/qscreen/propertyfield.cpp2
-rw-r--r--tests/manual/qssloptions/qssloptions.pro1
-rw-r--r--tests/manual/qt_poll/qt_poll.pro7
-rw-r--r--tests/manual/qt_poll/tst_qt_poll.cpp155
-rw-r--r--tests/manual/qtabletevent/device_information/device_information.pro1
-rw-r--r--tests/manual/qtabletevent/device_information/tabletwidget.cpp4
-rw-r--r--tests/manual/qtabletevent/event_compression/event_compression.pro1
-rw-r--r--tests/manual/qtabletevent/regular_widgets/regular_widgets.pro1
-rw-r--r--tests/manual/qtbug-8933/qtbug-8933.pro1
-rw-r--r--tests/manual/qtouchevent/qtouchevent.pro1
-rw-r--r--tests/manual/qwidget_zorder/qwidget_zorder.pro1
-rw-r--r--tests/manual/repaint/mainwindow/mainwindow.pro1
-rw-r--r--tests/manual/repaint/scrollarea/scrollarea.pro1
-rw-r--r--tests/manual/repaint/splitter/splitter.pro1
-rw-r--r--tests/manual/repaint/tableview/tableview.pro1
-rw-r--r--tests/manual/repaint/task141091/task141091.pro1
-rw-r--r--tests/manual/repaint/toplevel/toplevel.pro1
-rw-r--r--tests/manual/repaint/widget/widget.pro1
-rw-r--r--tests/manual/socketengine/socketengine.pro1
-rw-r--r--tests/manual/textrendering/glyphshaping/glyphshaping.pro1
-rw-r--r--tests/manual/textrendering/textperformance/textperformance.pro1
-rw-r--r--tests/manual/unc/main.cpp2
-rw-r--r--tests/manual/widgetgrab/widgetgrab.pro1
-rw-r--r--tests/manual/widgets/itemviews/delegate/delegate.pro1
-rw-r--r--tests/manual/widgets/itemviews/qheaderview/qheaderview.pro1
-rw-r--r--tests/manual/widgets/itemviews/qtreeview/qtreeview.pro1
-rw-r--r--tests/manual/widgets/itemviews/qtreewidget/qtreewidget.pro1
-rw-r--r--tests/manual/widgets/qgraphicsview/rubberband/rubberband.pro1
-rw-r--r--tests/manual/windowflags/windowflags.pro1
-rw-r--r--tests/manual/windowgeometry/windowgeometry.pro1
-rw-r--r--tests/manual/windowmodality/windowmodality.pro1
70 files changed, 437 insertions, 86 deletions
diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp
index fe96c55636..2b04bd8bda 100644
--- a/tests/manual/bearerex/bearerex.cpp
+++ b/tests/manual/bearerex/bearerex.cpp
@@ -147,7 +147,7 @@ void BearerEx::on_createSessionButton_clicked()
QNetworkConfiguration networkConfiguration = qvariant_cast<QNetworkConfiguration>(item->data(Qt::UserRole));
int newTabIndex = mainTabWidget->count();
SessionTab* newTab = new SessionTab(&networkConfiguration,&m_NetworkConfigurationManager,eventListWidget,newTabIndex-1);
- QString label = QString("S")+QString::number(newTabIndex-1);
+ QString label = QLatin1Char('S') + QString::number(newTabIndex-1);
mainTabWidget->insertTab(newTabIndex,newTab,label);
mainTabWidget->setCurrentIndex(newTabIndex);
}
@@ -271,9 +271,11 @@ SessionTab::SessionTab(QNetworkConfiguration* apNetworkConfiguration,
snapLabel->hide();
snapLineEdit->hide();
alrButton->hide();
- iapLineEdit->setText(apNetworkConfiguration->name()+" ("+apNetworkConfiguration->identifier()+")");
+ iapLineEdit->setText(apNetworkConfiguration->name()+ " (" + apNetworkConfiguration->identifier()
+ + QLatin1Char(')'));
} else if (apNetworkConfiguration->type() == QNetworkConfiguration::ServiceNetwork) {
- snapLineEdit->setText(apNetworkConfiguration->name()+" ("+apNetworkConfiguration->identifier()+")");
+ snapLineEdit->setText(apNetworkConfiguration->name()+ " (" + apNetworkConfiguration->identifier()
+ + QLatin1Char(')'));
}
bearerLineEdit->setText(apNetworkConfiguration->bearerTypeName());
sentRecDataLineEdit->setText(QString::number(m_NetworkSession->bytesWritten())+
@@ -380,7 +382,7 @@ void SessionTab::newConfigurationActivated()
msgBox.setDefaultButton(QMessageBox::Yes);
if (msgBox.exec() == QMessageBox::Yes) {
m_NetworkSession->accept();
- iapLineEdit->setText(m_config.name()+" ("+m_config.identifier()+")");
+ iapLineEdit->setText(m_config.name() + " (" + m_config.identifier() + QLatin1Char(')'));
} else {
m_NetworkSession->reject();
}
@@ -391,7 +393,7 @@ void SessionTab::preferredConfigurationChanged(const QNetworkConfiguration& conf
m_config = config;
QMessageBox msgBox;
msgBox.setText("Roaming to new configuration.");
- msgBox.setInformativeText("Do you want to migrate to "+config.name()+"?");
+ msgBox.setInformativeText("Do you want to migrate to " + config.name() + QLatin1Char('?'));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
if (msgBox.exec() == QMessageBox::Yes) {
@@ -407,7 +409,7 @@ void SessionTab::opened()
QFont font = listItem->font();
font.setBold(true);
listItem->setFont(font);
- listItem->setText(QString("S")+QString::number(m_index)+QString(" - ")+QString("Opened"));
+ listItem->setText(QLatin1Char('S') + QString::number(m_index) + QLatin1String(" - Opened"));
m_eventListWidget->addItem(listItem);
QVariant identifier = m_NetworkSession->sessionProperty("ActiveConfiguration");
@@ -415,7 +417,7 @@ void SessionTab::opened()
QString configId = identifier.toString();
QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId);
if (config.isValid()) {
- iapLineEdit->setText(config.name()+" ("+config.identifier()+")");
+ iapLineEdit->setText(config.name() + " (" + config.identifier() + QLatin1Char(')'));
}
}
newState(m_NetworkSession->state()); // Update the "(open)"
@@ -438,7 +440,7 @@ void SessionTab::closed()
QFont font = listItem->font();
font.setBold(true);
listItem->setFont(font);
- listItem->setText(QString("S")+QString::number(m_index)+QString(" - ")+QString("Closed"));
+ listItem->setText(QLatin1Char('S') + QString::number(m_index) + QLatin1String(" - Closed"));
m_eventListWidget->addItem(listItem);
}
@@ -489,7 +491,7 @@ void SessionTab::stateChanged(QNetworkSession::State state)
newState(state);
QListWidgetItem* listItem = new QListWidgetItem();
- listItem->setText(QString("S")+QString::number(m_index)+QString(" - ")+stateString(state));
+ listItem->setText(QLatin1Char('S') + QString::number(m_index) + QLatin1String(" - ") + stateString(state));
m_eventListWidget->addItem(listItem);
}
@@ -500,7 +502,7 @@ void SessionTab::newState(QNetworkSession::State state)
QString configId = identifier.toString();
QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId);
if (config.isValid()) {
- iapLineEdit->setText(config.name()+" ("+config.identifier()+")");
+ iapLineEdit->setText(config.name() + " (" + config.identifier() + QLatin1Char(')'));
bearerLineEdit->setText(config.bearerTypeName());
}
} else {
@@ -539,7 +541,7 @@ void SessionTab::error(QNetworkSession::SessionError error)
errorString = "InvalidConfigurationError";
break;
}
- listItem->setText(QString("S")+QString::number(m_index)+QString(" - ")+errorString);
+ listItem->setText(QLatin1Char('S') + QString::number(m_index) + QString(" - ") + errorString);
m_eventListWidget->addItem(listItem);
msgBox.setText(errorString);
diff --git a/tests/manual/bearerex/bearerex.pro b/tests/manual/bearerex/bearerex.pro
index 8f0af52b40..e643657660 100644
--- a/tests/manual/bearerex/bearerex.pro
+++ b/tests/manual/bearerex/bearerex.pro
@@ -19,4 +19,3 @@ SOURCES += bearerex.cpp \
main.cpp \
xqlistwidget.cpp \
datatransferer.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/cocoa/menus/menus.pro b/tests/manual/cocoa/menus/menus.pro
index 855a77455f..0ccb25feb9 100644
--- a/tests/manual/cocoa/menus/menus.pro
+++ b/tests/manual/cocoa/menus/menus.pro
@@ -3,4 +3,3 @@ TEMPLATE = app
SOURCES += main.cpp
QT += gui widgets
CONFIG -=app_bundle
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/cocoa/nativewidgets/nativewigets.pro b/tests/manual/cocoa/nativewidgets/nativewigets.pro
index f1b1260688..d81b567276 100644
--- a/tests/manual/cocoa/nativewidgets/nativewigets.pro
+++ b/tests/manual/cocoa/nativewidgets/nativewigets.pro
@@ -4,4 +4,3 @@ HEADERS +=
SOURCES += main.cpp
QT += core widgets
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.h b/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.h
index 95601906e7..5aaffc7048 100644
--- a/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.h
+++ b/tests/manual/cocoa/qmaccocoaviewcontainer/TestMouseMovedNSView.h
@@ -31,7 +31,7 @@
**
****************************************************************************/
-#import <Cocoa/Cocoa.h>
+#import <AppKit/AppKit.h>
@interface TestMouseMovedNSView : NSView {
NSPoint mouseMovedPoint_;
diff --git a/tests/manual/cocoa/qmaccocoaviewcontainer/qmaccocoaviewcontainer.pro b/tests/manual/cocoa/qmaccocoaviewcontainer/qmaccocoaviewcontainer.pro
index 9546adea1c..1d1eb08253 100644
--- a/tests/manual/cocoa/qmaccocoaviewcontainer/qmaccocoaviewcontainer.pro
+++ b/tests/manual/cocoa/qmaccocoaviewcontainer/qmaccocoaviewcontainer.pro
@@ -2,7 +2,7 @@ TEMPLATE = app
TARGET = qmaccocoaviewcontainer
INCLUDEPATH += .
QT += widgets
-LIBS += -framework Cocoa
+LIBS += -framework AppKit
# Input
OBJECTIVE_SOURCES += main.mm TestMouseMovedNSView.m
HEADERS += TestMouseMovedNSView.h
diff --git a/tests/manual/cocoa/qt_on_cocoa/main.mm b/tests/manual/cocoa/qt_on_cocoa/main.mm
index 23370b0305..219bb56416 100644
--- a/tests/manual/cocoa/qt_on_cocoa/main.mm
+++ b/tests/manual/cocoa/qt_on_cocoa/main.mm
@@ -36,7 +36,7 @@
#include <QtGui>
#include <QtWidgets/QtWidgets>
-#include <Cocoa/Cocoa.h>
+#include <AppKit/AppKit.h>
@interface AppDelegate : NSObject <NSApplicationDelegate> {
QGuiApplication *m_app;
diff --git a/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro b/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro
index 97e4473e15..91c4d2c875 100644
--- a/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro
+++ b/tests/manual/cocoa/qt_on_cocoa/qt_on_cocoa.pro
@@ -3,7 +3,7 @@ TEMPLATE = app
OBJECTIVE_SOURCES += main.mm
HEADERS += rasterwindow.h
SOURCES += rasterwindow.cpp
-LIBS += -framework Cocoa
+LIBS += -framework AppKit
QT += gui widgets quick
diff --git a/tests/manual/cocoa/wheelevent/wheelevent.pro b/tests/manual/cocoa/wheelevent/wheelevent.pro
index f90302da95..3a30aef3fb 100644
--- a/tests/manual/cocoa/wheelevent/wheelevent.pro
+++ b/tests/manual/cocoa/wheelevent/wheelevent.pro
@@ -4,4 +4,3 @@ HEADERS += window.h
SOURCES += window.cpp main.cpp
QT += core core-private gui gui-private widgets
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/diaglib/README.txt b/tests/manual/diaglib/README.txt
index 0fb226c750..fd199d09cb 100644
--- a/tests/manual/diaglib/README.txt
+++ b/tests/manual/diaglib/README.txt
@@ -27,6 +27,11 @@ class EventFilter (eventfilter.h):
An event filter that logs Qt events to qDebug() depending on
configured categories (for example mouse, keyboard, etc).
+class DebugProxyStyle (debugproxystyle.h)
+ A proxy style that wraps around an existing style and outputs
+ the parameters and return values of its function calls, useful
+ for debugging QStyle.
+
function glInfo() (glinfo.h):
Returns a string describing the Open GL configuration (obtained
by querying GL_VENDOR and GL_RENDERER). Available only
diff --git a/tests/manual/diaglib/debugproxystyle.cpp b/tests/manual/diaglib/debugproxystyle.cpp
new file mode 100644
index 0000000000..51f15a4fee
--- /dev/null
+++ b/tests/manual/diaglib/debugproxystyle.cpp
@@ -0,0 +1,161 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "debugproxystyle.h"
+
+#include <QDebug>
+#include <QWidget>
+#include <QStyleOption>
+#include <QApplication>
+
+#if QT_VERSION < 0x050000
+QDebug operator<<(QDebug d, const QPixmap &p)
+{
+ d << "QPixmap(" << p.size() << ')';
+ return d;
+}
+#endif // QT_VERSION < 0x050000
+
+QDebug operator<<(QDebug debug, const QStyleOption *option)
+{
+#if QT_VERSION >= 0x050000
+ QDebugStateSaver saver(debug);
+ debug.nospace();
+#endif
+ debug << "QStyleOption(";
+ if (option)
+ debug << "rec=" << option->rect;
+ else
+ debug << '0';
+ debug << ')';
+ return debug;
+}
+
+namespace QtDiag {
+
+DebugProxyStyle::DebugProxyStyle(QStyle *style) : QProxyStyle(style)
+{
+#if QT_VERSION >= 0x050000
+ const qreal devicePixelRatio = qApp->devicePixelRatio();
+#else
+ const qreal devicePixelRatio = 1;
+#endif
+ qDebug() << __FUNCTION__ << QT_VERSION_STR
+#if QT_VERSION >= 0x050000
+ << QGuiApplication::platformName()
+#endif
+ << style->objectName() << "devicePixelRatio=" << devicePixelRatio;
+}
+
+void DebugProxyStyle::drawPrimitive(QStyle::PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
+{
+ qDebug() << __FUNCTION__ << "element=" << element << option << widget;
+ QProxyStyle::drawPrimitive( element, option, painter, widget);
+}
+
+void DebugProxyStyle::drawControl(QStyle::ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
+{
+ qDebug() << __FUNCTION__ << "element=" << element << option << widget;
+ QProxyStyle::drawControl(element, option, painter, widget);
+}
+
+void DebugProxyStyle::drawComplexControl(QStyle::ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const
+{
+ qDebug() << __FUNCTION__ << "control=" << control << option << widget;
+ QProxyStyle::drawComplexControl(control, option, painter, widget);
+}
+
+void DebugProxyStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const
+{
+ qDebug() << __FUNCTION__ << rect << "alignment=" << alignment << pixmap;
+ QProxyStyle::drawItemPixmap(painter, rect, alignment, pixmap);
+}
+
+QSize DebugProxyStyle::sizeFromContents(QStyle::ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const
+{
+ const QSize result = QProxyStyle::sizeFromContents(type, option, size, widget);
+ qDebug() << __FUNCTION__ << size << "type=" << type << option << widget << "returns" << result;
+ return result;
+}
+
+QRect DebugProxyStyle::subElementRect(QStyle::SubElement element, const QStyleOption *option, const QWidget *widget) const
+{
+ const QRect result = QProxyStyle::subElementRect(element, option, widget);
+ qDebug() << __FUNCTION__ << "element=" << element << option << widget << "returns" << result;
+ return result;
+}
+
+QRect DebugProxyStyle::subControlRect(QStyle::ComplexControl cc, const QStyleOptionComplex *opt, QStyle::SubControl sc, const QWidget *widget) const
+{
+ const QRect result = QProxyStyle::subControlRect(cc, opt, sc, widget);
+ qDebug() << __FUNCTION__ << "cc=" << cc << "sc=" << sc << opt << widget << "returns" << result;
+ return result;
+}
+
+QRect DebugProxyStyle::itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const
+{
+ const QRect result = QProxyStyle::itemTextRect(fm, r, flags, enabled, text);
+ qDebug() << __FUNCTION__ << r << "flags=" << flags << "enabled=" << enabled
+ << text << "returns" << result;
+ return result;
+}
+
+QRect DebugProxyStyle::itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const
+{
+ const QRect result = QProxyStyle::itemPixmapRect(r, flags, pixmap);
+ qDebug() << __FUNCTION__ << r << "flags=" << flags << pixmap << "returns" << result;
+ return result;
+}
+
+int DebugProxyStyle::pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, const QWidget *widget) const
+{
+ const int result = QProxyStyle::pixelMetric(metric, option, widget);
+ qDebug() << __FUNCTION__ << "metric=" << metric << option << widget << "returns" << result;
+ return result;
+}
+
+QPixmap DebugProxyStyle::standardPixmap(QStyle::StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget) const
+{
+ const QPixmap result = QProxyStyle::standardPixmap(standardPixmap, opt, widget);
+ qDebug() << __FUNCTION__ << "standardPixmap=" << standardPixmap << opt << "returns" << result;
+ return result;
+}
+
+QPixmap DebugProxyStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const
+{
+ const QPixmap result = QProxyStyle::generatedIconPixmap(iconMode, pixmap, opt);
+ qDebug() << __FUNCTION__ << "iconMode=" << iconMode << pixmap << opt << "returns" << result;
+ return result;
+}
+
+} // namespace QtDiag
diff --git a/tests/manual/diaglib/debugproxystyle.h b/tests/manual/diaglib/debugproxystyle.h
new file mode 100644
index 0000000000..d7a15ec2c0
--- /dev/null
+++ b/tests/manual/diaglib/debugproxystyle.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DEBUGPROXYSTYLE_H
+#define DEBUGPROXYSTYLE_H
+
+#include <QProxyStyle>
+
+namespace QtDiag {
+
+class DebugProxyStyle : public QProxyStyle {
+ Q_OBJECT
+
+public:
+ explicit DebugProxyStyle(QStyle *style);
+
+ void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
+ void drawControl(ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const;
+ void drawComplexControl(ComplexControl control, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget = 0) const;
+ void drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const;
+ QSize sizeFromContents(ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const;
+ QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const;
+ QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget) const;
+ QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const;
+ QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const;
+ int pixelMetric(PixelMetric metric, const QStyleOption *option = 0, const QWidget *widget = 0) const;
+ QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt, const QWidget *widget = 0) const;
+ QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const;
+};
+
+} // namespace QtDiag
+
+#endif // DEBUGPROXYSTYLE_H
diff --git a/tests/manual/diaglib/diaglib.pri b/tests/manual/diaglib/diaglib.pri
index a1f1893f52..a51d2f1201 100644
--- a/tests/manual/diaglib/diaglib.pri
+++ b/tests/manual/diaglib/diaglib.pri
@@ -3,12 +3,14 @@ SOURCES += \
$$PWD/textdump.cpp \
$$PWD/eventfilter.cpp \
$$PWD/qwindowdump.cpp \
+ $$PWD/debugproxystyle.cpp
HEADERS += \
$$PWD/textdump.h \
$$PWD/eventfilter.h \
$$PWD/qwindowdump.h \
- $$PWD/nativewindowdump.h
+ $$PWD/nativewindowdump.h \
+ $$PWD/debugproxystyle.h
win32 {
SOURCES += $$PWD/nativewindowdump_win.cpp
diff --git a/tests/manual/gestures/graphicsview/graphicsview.pro b/tests/manual/gestures/graphicsview/graphicsview.pro
index 4cc989efd2..9ecd0b372f 100644
--- a/tests/manual/gestures/graphicsview/graphicsview.pro
+++ b/tests/manual/gestures/graphicsview/graphicsview.pro
@@ -8,4 +8,3 @@ SOURCES += main.cpp \
HEADERS += imageitem.h \
gestures.h \
mousepangesturerecognizer.h
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/gestures/graphicsview/main.cpp b/tests/manual/gestures/graphicsview/main.cpp
index 062a1643df..30fd79ec8f 100644
--- a/tests/manual/gestures/graphicsview/main.cpp
+++ b/tests/manual/gestures/graphicsview/main.cpp
@@ -175,7 +175,7 @@ void MainWindow::setDirectory(const QString &path)
QDir dir(path);
QStringList files = dir.entryList(QDir::Files | QDir::Readable | QDir::NoDotAndDotDot);
foreach(const QString &file, files) {
- QImageReader img(path + QLatin1String("/")+file);
+ QImageReader img(path + QLatin1Char('/') +file);
QImage image = img.read();
if (!image.isNull()) {
{
diff --git a/tests/manual/gestures/scrollarea/scrollarea.pro b/tests/manual/gestures/scrollarea/scrollarea.pro
index a4854e2599..84e2af3f49 100644
--- a/tests/manual/gestures/scrollarea/scrollarea.pro
+++ b/tests/manual/gestures/scrollarea/scrollarea.pro
@@ -3,4 +3,3 @@ QT += widgets
SOURCES = main.cpp \
mousepangesturerecognizer.cpp
HEADERS += mousepangesturerecognizer.h
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/highdpi/dragwidget.cpp b/tests/manual/highdpi/dragwidget.cpp
index b203566696..dacafef203 100644
--- a/tests/manual/highdpi/dragwidget.cpp
+++ b/tests/manual/highdpi/dragwidget.cpp
@@ -166,7 +166,7 @@ void DragWidget::mousePressEvent(QMouseEvent *event)
QMimeData *mimeData = new QMimeData;
mimeData->setText(child->text());
mimeData->setData("application/x-hotspot",
- QByteArray::number(hotSpot.x()) + " " + QByteArray::number(hotSpot.y()));
+ QByteArray::number(hotSpot.x()) + ' ' + QByteArray::number(hotSpot.y()));
QPixmap pixmap(child->size());
child->render(&pixmap);
diff --git a/tests/manual/highdpi/main.cpp b/tests/manual/highdpi/main.cpp
index 692a60d511..3e0073dd52 100644
--- a/tests/manual/highdpi/main.cpp
+++ b/tests/manual/highdpi/main.cpp
@@ -139,7 +139,7 @@ private slots:
// update label, add ".0" if needed.
QString number = QString::number(scalefactorF);
- if (!number.contains("."))
+ if (!number.contains(QLatin1Char('.')))
number.append(".0");
m_label->setText(number);
}
@@ -203,8 +203,8 @@ DemoController::DemoController(DemoContainerList *demos, QCommandLineParser *par
foreach (QScreen *screen, screens) {
// create scale control line
QSize screenSize = screen->geometry().size();
- QString screenId = screen->name() + " " + QString::number(screenSize.width())
- + " " + QString::number(screenSize.height());
+ QString screenId = screen->name() + QLatin1Char(' ') + QString::number(screenSize.width())
+ + QLatin1Char(' ') + QString::number(screenSize.height());
LabelSlider *slider = new LabelSlider(this, screenId, layout, layoutRow++);
slider->setValue(getScreenFactorWithoutPixelDensity(screen) * 10);
diff --git a/tests/manual/inputmethodhints/inputmethodhints.pro b/tests/manual/inputmethodhints/inputmethodhints.pro
index 2f6608b602..f253f72332 100644
--- a/tests/manual/inputmethodhints/inputmethodhints.pro
+++ b/tests/manual/inputmethodhints/inputmethodhints.pro
@@ -8,4 +8,3 @@ SOURCES += main.cpp \
inputmethodhints.cpp
FORMS += inputmethodhints.ui
RESOURCES +=
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/keypadnavigation/keypadnavigation.pro b/tests/manual/keypadnavigation/keypadnavigation.pro
index 3ec3241998..a45d38af21 100644
--- a/tests/manual/keypadnavigation/keypadnavigation.pro
+++ b/tests/manual/keypadnavigation/keypadnavigation.pro
@@ -1,4 +1,3 @@
QT += widgets
SOURCES += main.cpp
FORMS += keypadnavigation.ui
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/lance/lance.pro b/tests/manual/lance/lance.pro
index 430c9196e6..312106c2f0 100644
--- a/tests/manual/lance/lance.pro
+++ b/tests/manual/lance/lance.pro
@@ -16,4 +16,3 @@ RESOURCES += icons.qrc \
qtHaveModule(opengl): QT += opengl
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/lance/main.cpp b/tests/manual/lance/main.cpp
index 6c0a651ce6..79e72cb5b3 100644
--- a/tests/manual/lance/main.cpp
+++ b/tests/manual/lance/main.cpp
@@ -602,7 +602,7 @@ int main(int argc, char **argv)
pcmd.setType(type);
pcmd.setCheckersBackground(checkers_background);
pcmd.setContents(content);
- QString file = QString(files.at(j)).replace(".", "_") + ".ps";
+ QString file = QString(files.at(j)).replace(QLatin1Char('.'), QLatin1Char('_')) + ".ps";
QPrinter p(highres ? QPrinter::HighResolution : QPrinter::ScreenResolution);
if (printdlg) {
diff --git a/tests/manual/network_remote_stresstest/network_remote_stresstest.pro b/tests/manual/network_remote_stresstest/network_remote_stresstest.pro
index 736747e486..754776f7e9 100644
--- a/tests/manual/network_remote_stresstest/network_remote_stresstest.pro
+++ b/tests/manual/network_remote_stresstest/network_remote_stresstest.pro
@@ -7,4 +7,3 @@ SOURCES += tst_network_remote_stresstest.cpp
RESOURCES += url-list.qrc
LIBS += $$QMAKE_LIBS_NETWORK
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
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 486c5179b7..df61325439 100644
--- a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp
+++ b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp
@@ -246,30 +246,31 @@ void tst_NetworkRemoteStressTest::blockingSequentialRemoteHosts()
socket = QSharedPointer<QTcpSocket>(new QTcpSocket);
socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80));
- QVERIFY2(socket->waitForConnected(10000), "Timeout connecting to " + url.encodedHost());
+ const QByteArray encodedHost = url.host(QUrl::FullyEncoded).toLatin1();
+ QVERIFY2(socket->waitForConnected(10000), "Timeout connecting to " + encodedHost);
#ifndef QT_NO_SSL
if (isHttps) {
static_cast<QSslSocket *>(socket.data())->setProtocol(QSsl::TlsV1_0);
static_cast<QSslSocket *>(socket.data())->startClientEncryption();
static_cast<QSslSocket *>(socket.data())->ignoreSslErrors();
- QVERIFY2(static_cast<QSslSocket *>(socket.data())->waitForEncrypted(10000), "Timeout starting TLS with " + url.encodedHost());
+ QVERIFY2(static_cast<QSslSocket *>(socket.data())->waitForEncrypted(10000), "Timeout starting TLS with " + encodedHost);
}
#endif // QT_NO_SSL
socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n"
"Connection: close\r\n"
"User-Agent: tst_QTcpSocket_stresstest/1.0\r\n"
- "Host: " + url.encodedHost() + "\r\n"
+ "Host: " + encodedHost + "\r\n"
"\r\n");
while (socket->bytesToWrite())
- QVERIFY2(socket->waitForBytesWritten(10000), "Timeout writing to " + url.encodedHost());
+ QVERIFY2(socket->waitForBytesWritten(10000), "Timeout writing to " + encodedHost);
while (socket->state() == QAbstractSocket::ConnectedState && !timeout.hasExpired(10000)) {
socket->waitForReadyRead(10000);
byteCounter += socket->readAll().size(); // discard
}
- QVERIFY2(!timeout.hasExpired(10000), "Timeout reading from " + url.encodedHost());
+ QVERIFY2(!timeout.hasExpired(10000), "Timeout reading from " + encodedHost);
totalBytes += byteCounter;
if (intermediateDebug) {
@@ -318,16 +319,17 @@ void tst_NetworkRemoteStressTest::sequentialRemoteHosts()
socket->connectToHost(url.host(), url.port(80));
}
+ const QByteArray encodedHost = url.host(QUrl::FullyEncoded).toLatin1();
socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n"
"Connection: close\r\n"
"User-Agent: tst_QTcpSocket_stresstest/1.0\r\n"
- "Host: " + url.encodedHost() + "\r\n"
+ "Host: " + encodedHost + "\r\n"
"\r\n");
connect(socket.data(), SIGNAL(readyRead()), SLOT(slotReadAll()));
QTestEventLoop::instance().connect(socket.data(), SIGNAL(disconnected()), SLOT(exitLoop()));
QTestEventLoop::instance().enterLoop(30);
- QVERIFY2(!QTestEventLoop::instance().timeout(), "Timeout with " + url.encodedHost() + "; "
+ QVERIFY2(!QTestEventLoop::instance().timeout(), "Timeout with " + encodedHost + "; "
+ QByteArray::number(socket->bytesToWrite()) + " bytes to write");
totalBytes += byteCounter;
@@ -397,10 +399,11 @@ void tst_NetworkRemoteStressTest::parallelRemoteHosts()
socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80));
}
+ const QByteArray encodedHost = url.host(QUrl::FullyEncoded).toLatin1();
socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n"
"Connection: close\r\n"
"User-Agent: tst_QTcpSocket_stresstest/1.0\r\n"
- "Host: " + url.encodedHost() + "\r\n"
+ "Host: " + encodedHost + "\r\n"
"\r\n");
connect(socket, SIGNAL(readyRead()), SLOT(slotReadAll()));
QTestEventLoop::instance().connect(socket, SIGNAL(disconnected()), SLOT(exitLoop()));
diff --git a/tests/manual/network_stresstest/minihttpserver.cpp b/tests/manual/network_stresstest/minihttpserver.cpp
index d97fd7ec96..1a5fefcce7 100644
--- a/tests/manual/network_stresstest/minihttpserver.cpp
+++ b/tests/manual/network_stresstest/minihttpserver.cpp
@@ -141,7 +141,7 @@ void MiniHttpServerConnection::handlePendingRequest()
}
QUrl uri = QUrl::fromEncoded(request.mid(4, eol - int(strlen(http11)) - 4));
- source.setFileName(":" + uri.path());
+ source.setFileName(QLatin1Char(':') + uri.path());
// connection-close?
request = request.toLower();
diff --git a/tests/manual/qcursor/allcursors/allcursors.pro b/tests/manual/qcursor/allcursors/allcursors.pro
index c85ef861c2..b9f6a0c98d 100644
--- a/tests/manual/qcursor/allcursors/allcursors.pro
+++ b/tests/manual/qcursor/allcursors/allcursors.pro
@@ -14,4 +14,3 @@ SOURCES += main.cpp\
HEADERS += mainwindow.h
FORMS += mainwindow.ui
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qcursor/grab_override/grab_override.pro b/tests/manual/qcursor/grab_override/grab_override.pro
index d163a726c3..d84e2ee2b8 100644
--- a/tests/manual/qcursor/grab_override/grab_override.pro
+++ b/tests/manual/qcursor/grab_override/grab_override.pro
@@ -16,4 +16,3 @@ HEADERS += mainwindow.h
FORMS += mainwindow.ui
RESOURCES += images.qrc
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qdesktopwidget/qdesktopwidget.pro b/tests/manual/qdesktopwidget/qdesktopwidget.pro
index 8d10589476..8979e7ef35 100644
--- a/tests/manual/qdesktopwidget/qdesktopwidget.pro
+++ b/tests/manual/qdesktopwidget/qdesktopwidget.pro
@@ -1,4 +1,3 @@
TEMPLATE = app
QT += widgets
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro b/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro
index a45ad29a5b..6135f74b8b 100644
--- a/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro
+++ b/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro
@@ -7,4 +7,3 @@ SOURCES += main.cpp \
HEADERS += widget.h \
customitem.h
FORMS += widget.ui
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qgraphicslayout/flicker/flicker.pro b/tests/manual/qgraphicslayout/flicker/flicker.pro
index 12506c5571..d800418f85 100644
--- a/tests/manual/qgraphicslayout/flicker/flicker.pro
+++ b/tests/manual/qgraphicslayout/flicker/flicker.pro
@@ -1,4 +1,3 @@
QT += widgets
HEADERS += window.h
SOURCES += main.cpp window.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro
index 8440453cb7..62838785d6 100644
--- a/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro
+++ b/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro
@@ -5,4 +5,3 @@ QT -= gui
QT += network testlib
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qimagereader/qimagereader.pro b/tests/manual/qimagereader/qimagereader.pro
index 99e96537dc..3523257f3e 100644
--- a/tests/manual/qimagereader/qimagereader.pro
+++ b/tests/manual/qimagereader/qimagereader.pro
@@ -1,3 +1,2 @@
QT += widgets
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qlocale/qlocale.pro b/tests/manual/qlocale/qlocale.pro
index 98079c7690..a5a2766e65 100644
--- a/tests/manual/qlocale/qlocale.pro
+++ b/tests/manual/qlocale/qlocale.pro
@@ -1,4 +1,3 @@
QT += widgets
HEADERS += currency.h calendar.h dateformats.h numberformats.h languages.h window.h miscellaneous.h info.h
SOURCES += currency.cpp main.cpp calendar.cpp dateformats.cpp numberformats.cpp languages.cpp window.cpp miscellaneous.cpp info.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qnetworkaccessmanager/qget/qget.cpp b/tests/manual/qnetworkaccessmanager/qget/qget.cpp
index 000e268c6e..cb435a792c 100644
--- a/tests/manual/qnetworkaccessmanager/qget/qget.cpp
+++ b/tests/manual/qnetworkaccessmanager/qget/qget.cpp
@@ -159,7 +159,7 @@ int main(int argc, char *argv[])
headersFile=str.mid(10);
else if (str == "--serial")
dl.setQueueMode(DownloadManager::Serial);
- else if (str.startsWith("-"))
+ else if (str.startsWith(QLatin1Char('-')))
qDebug() << "unsupported option" << str;
else {
QUrl url(QUrl::fromUserInput(str));
diff --git a/tests/manual/qnetworkaccessmanager/qget/qget.pro b/tests/manual/qnetworkaccessmanager/qget/qget.pro
index 082ffa7ac8..8a632f8d4e 100644
--- a/tests/manual/qnetworkaccessmanager/qget/qget.pro
+++ b/tests/manual/qnetworkaccessmanager/qget/qget.pro
@@ -6,4 +6,3 @@ SOURCES += qget.cpp
SOURCES += transferitem.cpp
SOURCES += downloadmanager.cpp
HEADERS += qget.h
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qnetworkaccessmanager/qget/transferitem.cpp b/tests/manual/qnetworkaccessmanager/qget/transferitem.cpp
index 13fba9f2e5..2e975cdfb2 100644
--- a/tests/manual/qnetworkaccessmanager/qget/transferitem.cpp
+++ b/tests/manual/qnetworkaccessmanager/qget/transferitem.cpp
@@ -42,9 +42,9 @@ TransferItem::TransferItem(const QNetworkRequest &r, const QString &u, const QSt
void TransferItem::progress(qint64 sent, qint64 total)
{
if (total > 0)
- qDebug() << (sent*100/total) << "%";
+ qDebug() << (sent*100/total) << '%';
else
- qDebug() << sent << "B";
+ qDebug() << sent << 'B';
}
void TransferItem::start()
diff --git a/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro b/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
index 79de15933e..8f9314cc96 100644
--- a/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
+++ b/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro
@@ -5,4 +5,3 @@ QT -= gui
QT += network testlib
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qnetworkreply/main.cpp b/tests/manual/qnetworkreply/main.cpp
index 98825f02ba..7630cff0bc 100644
--- a/tests/manual/qnetworkreply/main.cpp
+++ b/tests/manual/qnetworkreply/main.cpp
@@ -177,7 +177,7 @@ void tst_qnetworkreply::setSslConfiguration()
#ifdef QT_BUILD_INTERNAL
QFETCH(bool, works);
bool rootCertLoadingAllowed = QSslSocketPrivate::rootCertOnDemandLoadingSupported();
-#if defined(Q_OS_LINUX) || defined (Q_OS_BLACKBERRY)
+#if defined(Q_OS_LINUX)
QCOMPARE(rootCertLoadingAllowed, true);
#elif defined(Q_OS_MAC)
QCOMPARE(rootCertLoadingAllowed, false);
diff --git a/tests/manual/qnetworkreply/qnetworkreply.pro b/tests/manual/qnetworkreply/qnetworkreply.pro
index 64666103a0..eddcbdff1d 100644
--- a/tests/manual/qnetworkreply/qnetworkreply.pro
+++ b/tests/manual/qnetworkreply/qnetworkreply.pro
@@ -5,4 +5,3 @@ QT -= gui
QT += core-private network network-private testlib
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qscreen/propertyfield.cpp b/tests/manual/qscreen/propertyfield.cpp
index 01f38624d4..a8cf90c9bb 100644
--- a/tests/manual/qscreen/propertyfield.cpp
+++ b/tests/manual/qscreen/propertyfield.cpp
@@ -87,7 +87,7 @@ void PropertyField::propertyChanged()
m_lastChangeTime = QTime::currentTime().addSecs(-5);
}
- qDebug() << " " << QString::fromUtf8(m_prop.name()) << ":" << val;
+ qDebug() << " " << QString::fromUtf8(m_prop.name()) << ':' << val;
// If the value has recently changed, show the change
if (text != m_lastText || m_lastChangeTime.elapsed() < 1000) {
setText(m_lastTextShowing + " -> " + text);
diff --git a/tests/manual/qssloptions/qssloptions.pro b/tests/manual/qssloptions/qssloptions.pro
index d4325b0fd1..a98fd61f51 100644
--- a/tests/manual/qssloptions/qssloptions.pro
+++ b/tests/manual/qssloptions/qssloptions.pro
@@ -6,4 +6,3 @@ QT += network testlib
#CONFIG += release
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qt_poll/qt_poll.pro b/tests/manual/qt_poll/qt_poll.pro
new file mode 100644
index 0000000000..beea4d1316
--- /dev/null
+++ b/tests/manual/qt_poll/qt_poll.pro
@@ -0,0 +1,7 @@
+CONFIG += testcase
+TARGET = tst_qt_poll
+QT = core-private network testlib
+INCLUDEPATH += ../../../src/corelib/kernel
+SOURCES += \
+ tst_qt_poll.cpp \
+ ../../../src/corelib/kernel/qpoll.cpp
diff --git a/tests/manual/qt_poll/tst_qt_poll.cpp b/tests/manual/qt_poll/tst_qt_poll.cpp
new file mode 100644
index 0000000000..56e41e4093
--- /dev/null
+++ b/tests/manual/qt_poll/tst_qt_poll.cpp
@@ -0,0 +1,155 @@
+/****************************************************************************
+**
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL21$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 or version 3 as published by the Free
+** Software Foundation and appearing in the file LICENSE.LGPLv21 and
+** LICENSE.LGPLv3 included in the packaging of this file. Please review the
+** following information to ensure the GNU Lesser General Public License
+** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** As a special exception, The Qt Company gives you certain additional
+** rights. These rights are described in The Qt Company LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT_NO_NATIVE_POLL
+#define QT_NO_NATIVE_POLL
+#endif
+
+#include <QtTest/QtTest>
+#include <QtNetwork>
+
+#include <private/qcore_unix_p.h>
+
+QT_BEGIN_NAMESPACE
+// defined in qpoll.cpp
+int qt_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts);
+QT_END_NAMESPACE
+
+class tst_qt_poll : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void pollout();
+ void pollin();
+ void pollnval();
+ void pollprihup();
+};
+
+void tst_qt_poll::pollout()
+{
+ int fds[2];
+ QCOMPARE(pipe(fds), 0);
+
+ struct pollfd pfd = { fds[1], POLLOUT, 0 };
+ const int nready = qt_poll(&pfd, 1, NULL);
+
+ QCOMPARE(nready, 1);
+ QCOMPARE(pfd.revents, short(POLLOUT));
+
+ qt_safe_close(fds[0]);
+ qt_safe_close(fds[1]);
+}
+
+void tst_qt_poll::pollin()
+{
+ int fds[2];
+ QCOMPARE(pipe(fds), 0);
+
+ const char data = 'Q';
+ QCOMPARE(qt_safe_write(fds[1], &data, 1), 1);
+
+ struct pollfd pfd = { fds[0], POLLIN, 0 };
+ const int nready = qt_poll(&pfd, 1, NULL);
+
+ QCOMPARE(nready, 1);
+ QCOMPARE(pfd.revents, short(POLLIN));
+
+ qt_safe_close(fds[0]);
+ qt_safe_close(fds[1]);
+}
+
+void tst_qt_poll::pollnval()
+{
+ struct pollfd pfd = { 42, POLLOUT, 0 };
+
+ int nready = qt_poll(&pfd, 1, NULL);
+ QCOMPARE(nready, 1);
+ QCOMPARE(pfd.revents, short(POLLNVAL));
+
+ pfd.events = 0;
+ pfd.revents = 0;
+
+ nready = qt_poll(&pfd, 1, NULL);
+ QCOMPARE(nready, 1);
+ QCOMPARE(pfd.revents, short(POLLNVAL));
+}
+
+void tst_qt_poll::pollprihup()
+{
+ QTcpServer server;
+ QTcpSocket client_socket;
+
+ QVERIFY(server.listen(QHostAddress::LocalHost));
+
+ const quint16 server_port = server.serverPort();
+ client_socket.connectToHost(server.serverAddress(), server_port);
+
+ QVERIFY(client_socket.waitForConnected());
+ QVERIFY(server.waitForNewConnection());
+
+ QTcpSocket *server_socket = server.nextPendingConnection();
+ server.close();
+
+ // TCP supports only a single byte of urgent data
+ static const char oob_out = 'Q';
+ QCOMPARE(::send(server_socket->socketDescriptor(), &oob_out, 1, MSG_OOB),
+ ssize_t(1));
+
+ struct pollfd pfd = {
+ int(client_socket.socketDescriptor()),
+ POLLPRI | POLLIN,
+ 0
+ };
+ int res = qt_poll(&pfd, 1, NULL);
+
+ QCOMPARE(res, 1);
+ QCOMPARE(pfd.revents, short(POLLPRI | POLLIN));
+
+ char oob_in = 0;
+ // We do not specify MSG_OOB here as SO_OOBINLINE is turned on by default
+ // in the native socket engine
+ QCOMPARE(::recv(client_socket.socketDescriptor(), &oob_in, 1, 0),
+ ssize_t(1));
+ QCOMPARE(oob_in, oob_out);
+
+ server_socket->close();
+ pfd.events = POLLIN;
+ res = qt_poll(&pfd, 1, NULL);
+
+ QCOMPARE(res, 1);
+ QCOMPARE(pfd.revents, short(POLLHUP));
+}
+
+QTEST_APPLESS_MAIN(tst_qt_poll)
+#include "tst_qt_poll.moc"
diff --git a/tests/manual/qtabletevent/device_information/device_information.pro b/tests/manual/qtabletevent/device_information/device_information.pro
index 59669843ba..727ad34bc1 100644
--- a/tests/manual/qtabletevent/device_information/device_information.pro
+++ b/tests/manual/qtabletevent/device_information/device_information.pro
@@ -4,4 +4,3 @@ SOURCES += \
tabletwidget.cpp
HEADERS += \
tabletwidget.h
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.cpp b/tests/manual/qtabletevent/device_information/tabletwidget.cpp
index f1d838f01d..f868d5a910 100644
--- a/tests/manual/qtabletevent/device_information/tabletwidget.cpp
+++ b/tests/manual/qtabletevent/device_information/tabletwidget.cpp
@@ -61,7 +61,7 @@ bool TabletWidget::eventFilter(QObject *, QEvent *ev)
mType = event->type();
mPos = event->pos();
mGPos = event->globalPos();
- mHiResGlobalPos = event->hiResGlobalPos();
+ mHiResGlobalPos = event->posF();
mDev = event->device();
mPointerType = event->pointerType();
mUnique = event->uniqueId();
@@ -201,7 +201,7 @@ QString TabletWidget::buttonsToString(Qt::MouseButtons bs)
if (bs.testFlag(b))
ret << buttonToString(b);
}
- return ret.join("|");
+ return ret.join(QLatin1Char('|'));
}
void TabletWidget::tabletEvent(QTabletEvent *event)
diff --git a/tests/manual/qtabletevent/event_compression/event_compression.pro b/tests/manual/qtabletevent/event_compression/event_compression.pro
index 8300c33c87..15650d6190 100644
--- a/tests/manual/qtabletevent/event_compression/event_compression.pro
+++ b/tests/manual/qtabletevent/event_compression/event_compression.pro
@@ -3,4 +3,3 @@ QT += widgets testlib
SOURCES += main.cpp \
mousestatwidget.cpp
HEADERS += mousestatwidget.h
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro b/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro
index fa41d09d1b..8f1f4342ee 100644
--- a/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro
+++ b/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro
@@ -2,4 +2,3 @@ TEMPLATE = app
QT += widgets
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qtbug-8933/qtbug-8933.pro b/tests/manual/qtbug-8933/qtbug-8933.pro
index 0d8bfcc797..4600d47cac 100644
--- a/tests/manual/qtbug-8933/qtbug-8933.pro
+++ b/tests/manual/qtbug-8933/qtbug-8933.pro
@@ -14,4 +14,3 @@ SOURCES += main.cpp\
HEADERS += widget.h
FORMS += widget.ui
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qtouchevent/qtouchevent.pro b/tests/manual/qtouchevent/qtouchevent.pro
index 6a1ca85335..81384eaf24 100644
--- a/tests/manual/qtouchevent/qtouchevent.pro
+++ b/tests/manual/qtouchevent/qtouchevent.pro
@@ -4,4 +4,3 @@ SOURCES = main.cpp \
touchwidget.cpp
FORMS += form.ui
HEADERS += touchwidget.h
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/qwidget_zorder/qwidget_zorder.pro b/tests/manual/qwidget_zorder/qwidget_zorder.pro
index 99e96537dc..3523257f3e 100644
--- a/tests/manual/qwidget_zorder/qwidget_zorder.pro
+++ b/tests/manual/qwidget_zorder/qwidget_zorder.pro
@@ -1,3 +1,2 @@
QT += widgets
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/repaint/mainwindow/mainwindow.pro b/tests/manual/repaint/mainwindow/mainwindow.pro
index 1fc3773864..f20e5fe402 100644
--- a/tests/manual/repaint/mainwindow/mainwindow.pro
+++ b/tests/manual/repaint/mainwindow/mainwindow.pro
@@ -1,4 +1,3 @@
QT += widgets
HEADERS += ../shared/shared.h
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/repaint/scrollarea/scrollarea.pro b/tests/manual/repaint/scrollarea/scrollarea.pro
index 1fc3773864..f20e5fe402 100644
--- a/tests/manual/repaint/scrollarea/scrollarea.pro
+++ b/tests/manual/repaint/scrollarea/scrollarea.pro
@@ -1,4 +1,3 @@
QT += widgets
HEADERS += ../shared/shared.h
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/repaint/splitter/splitter.pro b/tests/manual/repaint/splitter/splitter.pro
index 1fc3773864..f20e5fe402 100644
--- a/tests/manual/repaint/splitter/splitter.pro
+++ b/tests/manual/repaint/splitter/splitter.pro
@@ -1,4 +1,3 @@
QT += widgets
HEADERS += ../shared/shared.h
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/repaint/tableview/tableview.pro b/tests/manual/repaint/tableview/tableview.pro
index ae27c84109..6a5aaad251 100644
--- a/tests/manual/repaint/tableview/tableview.pro
+++ b/tests/manual/repaint/tableview/tableview.pro
@@ -1,4 +1,3 @@
QT += widgets
HEADERS +=../shared/shared.h
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/repaint/task141091/task141091.pro b/tests/manual/repaint/task141091/task141091.pro
index a7db71ba3e..b54299e540 100644
--- a/tests/manual/repaint/task141091/task141091.pro
+++ b/tests/manual/repaint/task141091/task141091.pro
@@ -1,4 +1,3 @@
CONFIG += console
QT += widgets
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/repaint/toplevel/toplevel.pro b/tests/manual/repaint/toplevel/toplevel.pro
index 827a7e2dac..a881c24f56 100644
--- a/tests/manual/repaint/toplevel/toplevel.pro
+++ b/tests/manual/repaint/toplevel/toplevel.pro
@@ -3,4 +3,3 @@ QT += widgets
HEADERS += ../shared/shared.h
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/repaint/widget/widget.pro b/tests/manual/repaint/widget/widget.pro
index 1fc3773864..f20e5fe402 100644
--- a/tests/manual/repaint/widget/widget.pro
+++ b/tests/manual/repaint/widget/widget.pro
@@ -1,4 +1,3 @@
QT += widgets
HEADERS += ../shared/shared.h
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/socketengine/socketengine.pro b/tests/manual/socketengine/socketengine.pro
index 3da17c2d49..d379628669 100644
--- a/tests/manual/socketengine/socketengine.pro
+++ b/tests/manual/socketengine/socketengine.pro
@@ -5,4 +5,3 @@ QT -= gui
QT += network-private core-private testlib
SOURCES += main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/textrendering/glyphshaping/glyphshaping.pro b/tests/manual/textrendering/glyphshaping/glyphshaping.pro
index 5dc8542e86..6500814423 100644
--- a/tests/manual/textrendering/glyphshaping/glyphshaping.pro
+++ b/tests/manual/textrendering/glyphshaping/glyphshaping.pro
@@ -4,4 +4,3 @@ OTHER_FILES = glyphshaping_data.xml
glyphshaping_data.path = .
glyphshaping_data.files = $$PWD/glyphshaping_data.xml
DEPLOYMENT += glyphshaping_data
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/textrendering/textperformance/textperformance.pro b/tests/manual/textrendering/textperformance/textperformance.pro
index acfd7b1906..f07a4f0294 100644
--- a/tests/manual/textrendering/textperformance/textperformance.pro
+++ b/tests/manual/textrendering/textperformance/textperformance.pro
@@ -1,3 +1,2 @@
QT += widgets
SOURCES = main.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/unc/main.cpp b/tests/manual/unc/main.cpp
index d507bb2ba4..b5893eda20 100644
--- a/tests/manual/unc/main.cpp
+++ b/tests/manual/unc/main.cpp
@@ -63,7 +63,7 @@ protected:
label->setTextInteractionFlags(Qt::TextBrowserInteraction);
label->setOpenExternalLinks(true);
- QString link("<a href=" + path + ">" + path + "</a>");
+ QString link("<a href=" + path + QLatin1Char('>') + path + "</a>");
label->setText(link);
return label;
diff --git a/tests/manual/widgetgrab/widgetgrab.pro b/tests/manual/widgetgrab/widgetgrab.pro
index f1d2b0e65f..d206fb1df1 100644
--- a/tests/manual/widgetgrab/widgetgrab.pro
+++ b/tests/manual/widgetgrab/widgetgrab.pro
@@ -6,5 +6,4 @@ SOURCES += main.cpp
greaterThan(QT_MAJOR_VERSION, 4) {
QT += widgets
- DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
}
diff --git a/tests/manual/widgets/itemviews/delegate/delegate.pro b/tests/manual/widgets/itemviews/delegate/delegate.pro
index 1ce6d141ab..e5c90f18ec 100644
--- a/tests/manual/widgets/itemviews/delegate/delegate.pro
+++ b/tests/manual/widgets/itemviews/delegate/delegate.pro
@@ -1,4 +1,3 @@
TEMPLATE = app
QT += widgets
SOURCES=example.cpp
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/widgets/itemviews/qheaderview/qheaderview.pro b/tests/manual/widgets/itemviews/qheaderview/qheaderview.pro
index f83136266d..ac40c6e9e1 100644
--- a/tests/manual/widgets/itemviews/qheaderview/qheaderview.pro
+++ b/tests/manual/widgets/itemviews/qheaderview/qheaderview.pro
@@ -1,4 +1,3 @@
TEMPLATE = app
SOURCES = qheaderviewtest1.cpp
QT += widgets
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/widgets/itemviews/qtreeview/qtreeview.pro b/tests/manual/widgets/itemviews/qtreeview/qtreeview.pro
index c241ee1045..f06006ea3a 100644
--- a/tests/manual/widgets/itemviews/qtreeview/qtreeview.pro
+++ b/tests/manual/widgets/itemviews/qtreeview/qtreeview.pro
@@ -1,4 +1,3 @@
TEMPLATE = app
SOURCES = main.cpp
QT += widgets
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/widgets/itemviews/qtreewidget/qtreewidget.pro b/tests/manual/widgets/itemviews/qtreewidget/qtreewidget.pro
index 4b1da9be38..1969392ab3 100644
--- a/tests/manual/widgets/itemviews/qtreewidget/qtreewidget.pro
+++ b/tests/manual/widgets/itemviews/qtreewidget/qtreewidget.pro
@@ -1,4 +1,3 @@
TEMPLATE = app
SOURCES = main.cpp
QT += widgets core-private
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/widgets/qgraphicsview/rubberband/rubberband.pro b/tests/manual/widgets/qgraphicsview/rubberband/rubberband.pro
index 805b0cc119..731756cff3 100644
--- a/tests/manual/widgets/qgraphicsview/rubberband/rubberband.pro
+++ b/tests/manual/widgets/qgraphicsview/rubberband/rubberband.pro
@@ -1,4 +1,3 @@
TEMPLATE = app
SOURCES = rubberbandtest.cpp
QT += gui widgets # core-private
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/windowflags/windowflags.pro b/tests/manual/windowflags/windowflags.pro
index 546264cafc..ba0f75b65c 100644
--- a/tests/manual/windowflags/windowflags.pro
+++ b/tests/manual/windowflags/windowflags.pro
@@ -8,4 +8,3 @@ SOURCES = controllerwindow.cpp \
controls.cpp
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/windowgeometry/windowgeometry.pro b/tests/manual/windowgeometry/windowgeometry.pro
index c0c7ef0217..e717799649 100644
--- a/tests/manual/windowgeometry/windowgeometry.pro
+++ b/tests/manual/windowgeometry/windowgeometry.pro
@@ -7,4 +7,3 @@ INCLUDEPATH += ../windowflags
SOURCES += $$PWD/main.cpp controllerwidget.cpp ../windowflags/controls.cpp
HEADERS += controllerwidget.h ../windowflags/controls.h
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/windowmodality/windowmodality.pro b/tests/manual/windowmodality/windowmodality.pro
index 12071fa7ee..b29e939d27 100644
--- a/tests/manual/windowmodality/windowmodality.pro
+++ b/tests/manual/windowmodality/windowmodality.pro
@@ -1,4 +1,3 @@
SOURCES = main.cpp
FORMS = widget.ui dialog.ui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0