summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/cocoa/menurama/mainwindow.h2
-rw-r--r--tests/manual/cocoa/menurama/menuramaapplication.cpp2
-rw-r--r--tests/manual/diaglib/logwidget.cpp2
-rw-r--r--tests/manual/foreignwindows/main.cpp6
-rw-r--r--tests/manual/highdpi/dragwidget.h18
-rw-r--r--tests/manual/qlayout/gridwidget.cpp4
-rw-r--r--tests/manual/qlayout/hbwidget.cpp4
-rw-r--r--tests/manual/qlayout/vbwidget.cpp4
-rw-r--r--tests/manual/qscreen/main.cpp8
-rw-r--r--tests/manual/qscreen/propertywatcher.cpp2
-rw-r--r--tests/manual/qscreen/propertywatcher.h2
-rw-r--r--tests/manual/qsysinfo/main.cpp4
-rw-r--r--tests/manual/qtabletevent/regular_widgets/main.cpp37
-rw-r--r--tests/manual/touch/main.cpp12
-rw-r--r--tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp4
-rw-r--r--tests/manual/widgets/styles/main.cpp6
16 files changed, 77 insertions, 40 deletions
diff --git a/tests/manual/cocoa/menurama/mainwindow.h b/tests/manual/cocoa/menurama/mainwindow.h
index a7afa770be..3ca90dad8f 100644
--- a/tests/manual/cocoa/menurama/mainwindow.h
+++ b/tests/manual/cocoa/menurama/mainwindow.h
@@ -44,7 +44,7 @@ public:
~MainWindow();
protected:
- void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *) override;
public slots:
void enableStuffMenu(bool enable);
diff --git a/tests/manual/cocoa/menurama/menuramaapplication.cpp b/tests/manual/cocoa/menurama/menuramaapplication.cpp
index acd44565eb..5fb2041ae4 100644
--- a/tests/manual/cocoa/menurama/menuramaapplication.cpp
+++ b/tests/manual/cocoa/menurama/menuramaapplication.cpp
@@ -71,5 +71,5 @@ QAction *MenuramaApplication::findAction(QLatin1String title, QMenu *parentMenu)
if (a->text() == title)
return a;
- return Q_NULLPTR;
+ return nullptr;
}
diff --git a/tests/manual/diaglib/logwidget.cpp b/tests/manual/diaglib/logwidget.cpp
index 8e4844fab2..35fabd6e2e 100644
--- a/tests/manual/diaglib/logwidget.cpp
+++ b/tests/manual/diaglib/logwidget.cpp
@@ -133,7 +133,7 @@ void LogWidget::install()
qInfo("%s", qPrintable(LogWidget::startupMessage()));
}
-void LogWidget::uninstall() { qInstallMessageHandler(Q_NULLPTR); }
+void LogWidget::uninstall() { qInstallMessageHandler(nullptr); }
#else // Qt 5
diff --git a/tests/manual/foreignwindows/main.cpp b/tests/manual/foreignwindows/main.cpp
index cda7e7207e..74c6d8c376 100644
--- a/tests/manual/foreignwindows/main.cpp
+++ b/tests/manual/foreignwindows/main.cpp
@@ -110,7 +110,7 @@ EmbeddingWindow::EmbeddingWindow(QWindow *window) : m_window(window)
+ QLatin1String(" 0x") + QString::number(window->winId(), 16);
setWindowTitle(title);
setObjectName("MainWindow");
- QWidget *container = QWidget::createWindowContainer(window, Q_NULLPTR, Qt::Widget);
+ QWidget *container = QWidget::createWindowContainer(window, nullptr, Qt::Widget);
container->setObjectName("Container");
setCentralWidget(container);
@@ -149,8 +149,8 @@ EmbeddingWindow::EmbeddingWindow(QWindow *window) : m_window(window)
void EmbeddingWindow::releaseForeignWindow()
{
if (m_window) {
- m_window->setParent(Q_NULLPTR);
- m_window = Q_NULLPTR;
+ m_window->setParent(nullptr);
+ m_window = nullptr;
m_releaseAction->setEnabled(false);
}
}
diff --git a/tests/manual/highdpi/dragwidget.h b/tests/manual/highdpi/dragwidget.h
index 2cb821d509..8b67b20410 100644
--- a/tests/manual/highdpi/dragwidget.h
+++ b/tests/manual/highdpi/dragwidget.h
@@ -43,15 +43,15 @@ public:
DragWidget(QString text = QString(), QWidget *parent = 0);
protected:
- void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE;
- void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent * event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
- void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
- void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(QDragEnterEvent *event) override;
+ void dragLeaveEvent(QDragLeaveEvent *event) override;
+ void dropEvent(QDropEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void dragMoveEvent(QDragMoveEvent * event) override;
+ void paintEvent(QPaintEvent *) override;
+ void timerEvent(QTimerEvent *event) override;
+ void showEvent(QShowEvent *event) override;
+ void hideEvent(QHideEvent *event) override;
private:
QPoint dragPos;
QPoint dropPos;
diff --git a/tests/manual/qlayout/gridwidget.cpp b/tests/manual/qlayout/gridwidget.cpp
index ede13a22c3..f19b3eac6f 100644
--- a/tests/manual/qlayout/gridwidget.cpp
+++ b/tests/manual/qlayout/gridwidget.cpp
@@ -62,8 +62,8 @@ GridWidget::GridWidget(QWidget *parent) :
qDebug("There should be four warnings, but no crash or freeze:");
hb->addWidget(this, 6, 6); ///< This command should print a warning, but should not add "this"
- hb->addWidget(Q_NULLPTR, 6, 7); ///< This command should print a warning, but should not add "NULL"
+ hb->addWidget(nullptr, 6, 7); ///< This command should print a warning, but should not add "NULL"
hb->addLayout(hb, 7, 6); ///< This command should print a warning, but should not add "hb"
- hb->addLayout(Q_NULLPTR, 7, 7); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(nullptr, 7, 7); ///< This command should print a warning, but should not add "NULL"
qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/hbwidget.cpp b/tests/manual/qlayout/hbwidget.cpp
index d1f6c94d5b..80219d01fd 100644
--- a/tests/manual/qlayout/hbwidget.cpp
+++ b/tests/manual/qlayout/hbwidget.cpp
@@ -58,8 +58,8 @@ HbWidget::HbWidget(QWidget *parent) :
qDebug("There should be four warnings, but no crash or freeze:");
hb->addWidget(this); ///< This command should print a warning, but should not add "this"
- hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addWidget(nullptr); ///< This command should print a warning, but should not add "NULL"
hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
- hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(nullptr); ///< This command should print a warning, but should not add "NULL"
qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qlayout/vbwidget.cpp b/tests/manual/qlayout/vbwidget.cpp
index d3898422fb..97f240f9a0 100644
--- a/tests/manual/qlayout/vbwidget.cpp
+++ b/tests/manual/qlayout/vbwidget.cpp
@@ -58,8 +58,8 @@ VbWidget::VbWidget(QWidget *parent) :
qDebug("There should be four warnings, but no crash or freeze:");
hb->addWidget(this); ///< This command should print a warning, but should not add "this"
- hb->addWidget(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addWidget(nullptr); ///< This command should print a warning, but should not add "NULL"
hb->addLayout(hb); ///< This command should print a warning, but should not add "hb"
- hb->addLayout(Q_NULLPTR); ///< This command should print a warning, but should not add "NULL"
+ hb->addLayout(nullptr); ///< This command should print a warning, but should not add "NULL"
qDebug("Neither crashed nor frozen");
}
diff --git a/tests/manual/qscreen/main.cpp b/tests/manual/qscreen/main.cpp
index 445af82e09..6fba872b12 100644
--- a/tests/manual/qscreen/main.cpp
+++ b/tests/manual/qscreen/main.cpp
@@ -73,12 +73,12 @@ public:
}
protected:
- void mouseMoveEvent(QMouseEvent *ev) Q_DECL_OVERRIDE {
+ void mouseMoveEvent(QMouseEvent *ev) override {
m_cursorPos = ev->screenPos().toPoint();
updateText();
}
- void mousePressEvent(QMouseEvent *ev) Q_DECL_OVERRIDE {
+ void mousePressEvent(QMouseEvent *ev) override {
m_cursorPos = ev->screenPos().toPoint();
qDebug() << "top level @" << m_cursorPos << ":" << QGuiApplication::topLevelAt(m_cursorPos);
updateText();
@@ -100,7 +100,7 @@ class ScreenPropertyWatcher : public PropertyWatcher
{
Q_OBJECT
public:
- ScreenPropertyWatcher(QWidget *wp = Q_NULLPTR) : PropertyWatcher(Q_NULLPTR, QString(), wp)
+ ScreenPropertyWatcher(QWidget *wp = nullptr) : PropertyWatcher(nullptr, QString(), wp)
{
// workaround for the fact that virtualSiblings is not a property,
// thus there is no change notification:
@@ -150,7 +150,7 @@ public:
QScreen *screenSubject() const { return m_watcher->screenSubject(); }
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
void startMouseMonitor();
private:
diff --git a/tests/manual/qscreen/propertywatcher.cpp b/tests/manual/qscreen/propertywatcher.cpp
index 0fb322a480..d2a552f108 100644
--- a/tests/manual/qscreen/propertywatcher.cpp
+++ b/tests/manual/qscreen/propertywatcher.cpp
@@ -34,7 +34,7 @@
#include "propertyfield.h"
PropertyWatcher::PropertyWatcher(QObject *subject, QString annotation, QWidget *parent)
- : QWidget(parent), m_subject(Q_NULLPTR), m_formLayout(new QFormLayout(this))
+ : QWidget(parent), m_subject(nullptr), m_formLayout(new QFormLayout(this))
{
setMinimumSize(450, 300);
m_formLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
diff --git a/tests/manual/qscreen/propertywatcher.h b/tests/manual/qscreen/propertywatcher.h
index f371a3b9b6..d988d96c91 100644
--- a/tests/manual/qscreen/propertywatcher.h
+++ b/tests/manual/qscreen/propertywatcher.h
@@ -39,7 +39,7 @@ class PropertyWatcher : public QWidget
Q_OBJECT
public:
- explicit PropertyWatcher(QObject* subject = Q_NULLPTR, QString annotation = QString(), QWidget *parent = Q_NULLPTR);
+ explicit PropertyWatcher(QObject* subject = nullptr, QString annotation = QString(), QWidget *parent = nullptr);
QFormLayout *formLayout() { return m_formLayout; }
diff --git a/tests/manual/qsysinfo/main.cpp b/tests/manual/qsysinfo/main.cpp
index 5b391e5dfd..62d0c51416 100644
--- a/tests/manual/qsysinfo/main.cpp
+++ b/tests/manual/qsysinfo/main.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 Intel Corporation.
+** Copyright (C) 2017 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -133,6 +133,8 @@ int main(int argc, char *argv[])
printf("QSysInfo::productVersion() = %s\n", qPrintable(QSysInfo::productVersion()));
printf("QSysInfo::prettyProductName() = %s\n", qPrintable(QSysInfo::prettyProductName()));
printf("QSysInfo::machineHostName() = %s\n", qPrintable(QSysInfo::machineHostName()));
+ printf("QSysInfo::machineUniqueId() = %s\n", QSysInfo::machineUniqueId().constData());
+ printf("QSysInfo::bootUniqueId() = %s\n", qPrintable(QSysInfo::bootUniqueId()));
const auto osv = QOperatingSystemVersion::current();
printf("QOperatingSystemVersion::current() = %s %d.%d.%d\n",
diff --git a/tests/manual/qtabletevent/regular_widgets/main.cpp b/tests/manual/qtabletevent/regular_widgets/main.cpp
index 339d1d3633..caf8c70c6f 100644
--- a/tests/manual/qtabletevent/regular_widgets/main.cpp
+++ b/tests/manual/qtabletevent/regular_widgets/main.cpp
@@ -82,7 +82,7 @@ class EventReportWidget : public QWidget
{
Q_OBJECT
public:
- EventReportWidget() { startTimer(1000); }
+ EventReportWidget();
public slots:
void clearPoints() { m_points.clear(); update(); }
@@ -98,6 +98,8 @@ protected:
void tabletEvent(QTabletEvent *) override;
+ bool event(QEvent *event) override;
+
void paintEvent(QPaintEvent *) override;
void timerEvent(QTimerEvent *) override;
@@ -108,10 +110,17 @@ private:
bool m_lastIsTabletMove = false;
Qt::MouseButton m_lastButton = Qt::NoButton;
QVector<TabletPoint> m_points;
+ QVector<QPointF> m_touchPoints;
int m_tabletMoveCount = 0;
int m_paintEventCount = 0;
};
+EventReportWidget::EventReportWidget()
+{
+ setAttribute(Qt::WA_AcceptTouchEvents);
+ startTimer(1000);
+}
+
void EventReportWidget::paintEvent(QPaintEvent *)
{
QPainter p(this);
@@ -160,6 +169,11 @@ void EventReportWidget::paintEvent(QPaintEvent *)
}
}
}
+ p.setPen(Qt::blue);
+ for (QPointF t : m_touchPoints) {
+ p.drawLine(t.x() - 40, t.y(), t.x() + 40, t.y());
+ p.drawLine(t.x(), t.y() - 40, t.x(), t.y() + 40);
+ }
++m_paintEventCount;
}
@@ -198,6 +212,27 @@ void EventReportWidget::tabletEvent(QTabletEvent *event)
m_lastIsTabletMove = isMove;
}
+bool EventReportWidget::event(QEvent *event)
+{
+ switch (event->type()) {
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ event->accept();
+ m_touchPoints.clear();
+ for (const QTouchEvent::TouchPoint &p : static_cast<const QTouchEvent *>(event)->touchPoints())
+ m_touchPoints.append(p.pos());
+ update();
+ break;
+ case QEvent::TouchEnd:
+ m_touchPoints.clear();
+ update();
+ break;
+ default:
+ return QWidget::event(event);
+ }
+ return true;
+}
+
void EventReportWidget::outputMouseEvent(QMouseEvent *event)
{
if (event->type() == QEvent::MouseMove) {
diff --git a/tests/manual/touch/main.cpp b/tests/manual/touch/main.cpp
index 1d00ea5db5..d3c6079c7d 100644
--- a/tests/manual/touch/main.cpp
+++ b/tests/manual/touch/main.cpp
@@ -118,7 +118,7 @@ public:
explicit PanGesture(const QWidget *w, const QPanGesture *source) : Gesture(w, source)
, m_offset(source->offset()) {}
- void draw(const QRectF &rect, QPainter &painter) const Q_DECL_OVERRIDE
+ void draw(const QRectF &rect, QPainter &painter) const override
{
const QPointF hotSpot = drawHotSpot(rect, painter);
painter.drawLine(hotSpot, hotSpot + m_offset);
@@ -134,7 +134,7 @@ public:
, m_horizontal(source->horizontalDirection()), m_vertical(source->verticalDirection())
, m_angle(source->swipeAngle()) {}
- void draw(const QRectF &rect, QPainter &painter) const Q_DECL_OVERRIDE;
+ void draw(const QRectF &rect, QPainter &painter) const override;
private:
QSwipeGesture::SwipeDirection m_horizontal;
@@ -169,7 +169,7 @@ void SwipeGesture::draw(const QRectF &rect, QPainter &painter) const
Gesture *Gesture::fromQGesture(const QWidget *w, const QGesture *source)
{
- Gesture *result = Q_NULLPTR;
+ Gesture *result = nullptr;
switch (source->gestureType()) {
case Qt::TapGesture:
case Qt::TapAndHoldGesture:
@@ -197,7 +197,7 @@ class EventFilter : public QObject {
public:
explicit EventFilter(const EventTypeVector &types, QObject *p) : QObject(p), m_types(types) {}
- bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *, QEvent *) override;
signals:
void eventReceived(const QString &);
@@ -292,8 +292,8 @@ signals:
void logMessage(const QString &);
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ void paintEvent(QPaintEvent *) override;
private:
void handleGestureEvent(QGestureEvent *gestureEvent);
diff --git a/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp b/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp
index e8844f87fd..f2c5494ebc 100644
--- a/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp
+++ b/tests/manual/widgets/qgraphicsview/rubberband/rubberbandtest.cpp
@@ -36,7 +36,7 @@ public:
setFlags(QGraphicsItem::ItemIsSelectable);
}
- void paint(QPainter *painter, const QStyleOptionGraphicsItem * /* option*/, QWidget * /*widget*/) Q_DECL_OVERRIDE
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem * /* option*/, QWidget * /*widget*/) override
{
if (isSelected())
painter->fillRect(rect(), QColor(255, 0, 0));
@@ -55,7 +55,7 @@ public:
connect(this, SIGNAL(rubberBandChanged(QRect, QPointF, QPointF)), this, SLOT(updateRubberbandInfo(QRect, QPointF, QPointF)));
}
protected:
- void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE
+ void mouseMoveEvent(QMouseEvent *event) override
{
QGraphicsView::mouseMoveEvent(event);
diff --git a/tests/manual/widgets/styles/main.cpp b/tests/manual/widgets/styles/main.cpp
index 7c840dc9ae..7df54baef5 100644
--- a/tests/manual/widgets/styles/main.cpp
+++ b/tests/manual/widgets/styles/main.cpp
@@ -87,7 +87,7 @@ static QWidget *createStandardPixmapPage(QWidget *parent)
const int maxColumns = 6;
for (int i = 0; i <= int(QStyle::SP_LineEditClearButton); ++i) {
const QStyle::StandardPixmap sp = static_cast<QStyle::StandardPixmap>(i);
- QPixmap pixmap = result->style()->standardPixmap(sp, Q_NULLPTR, result);
+ QPixmap pixmap = result->style()->standardPixmap(sp, nullptr, result);
QLabel *descriptionLabel = new QLabel(pixmapDescription(sp, pixmap));
grid->addWidget(descriptionLabel, row, column++);
QLabel *displayLabel = new QLabel;
@@ -111,7 +111,7 @@ static QWidget *createMetricsPage(QWidget *parent)
for (int i = 0; i <= int(QStyle::PM_HeaderDefaultSectionSizeVertical); ++i) {
const QStyle::PixelMetric m = static_cast<QStyle::PixelMetric>(i);
str << formatEnumValue(m) << '(' << int(m) << ")="
- << result->style()->pixelMetric(m, Q_NULLPTR, result) << '\n';
+ << result->style()->pixelMetric(m, nullptr, result) << '\n';
}
result->setPlainText(text);
return result;
@@ -126,7 +126,7 @@ static QWidget *createHintsPage(QWidget *parent)
for (int i = 0; i <= int(QStyle::SH_Menu_SubMenuDontStartSloppyOnLeave); ++i) {
const QStyle::StyleHint h = static_cast<QStyle::StyleHint>(i);
str << formatEnumValue(h) << '(' << int(h) << ")="
- << result->style()->styleHint(h, Q_NULLPTR, result) << '\n';
+ << result->style()->styleHint(h, nullptr, result) << '\n';
}
result->setPlainText(text);
return result;