summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-07-13 17:19:49 +0200
committerMarc Mutz <marc.mutz@kdab.com>2017-07-19 13:40:42 +0000
commit94cf203f36deb5b46d47197d31b780de5f464937 (patch)
tree7c66536f8fa075ed72b5aa3cf8fc208488a17779 /tests/auto/widgets
parentad68bf51e79f52c1ffa597b76edaecadafddbd06 (diff)
Use QSharedPointer::create() more
This is the result of running the (experimental) clang-tidy check qt-modernize-qsharedpointer-create Discarded changes: - tst_qsharedpointer.cpp: not sure we want these replacements there (→ separate change) - tst_collations.cpp: hit in a template specialization that is instantiated with both QSharedPointer and QSharedDataPointer. Change-Id: I203c2646e91d026735d923473af3d151d19e3820 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp12
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp8
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
index c75c1dc87e..a27e0b6048 100644
--- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
+++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
@@ -3442,7 +3442,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_Right << Qt::Key_Down;
- model.reset(new QStandardItemModel(4, 2));
+ model = QSharedPointer<QStandardItemModel>::create(4, 2);
QTest::newRow("row span, top down")
<< keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1);
@@ -3455,7 +3455,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_End << Qt::Key_Down << Qt::Key_Left;
- model.reset(new QStandardItemModel(3, 3));
+ model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("row span, right to left")
<< keyPresses << model << 1 << 1 << 2 << 1 << model->index(1, 1) << model->index(1, 1);
@@ -3468,7 +3468,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_PageDown << Qt::Key_Right;
- model.reset(new QStandardItemModel(3, 3));
+ model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("row span, left to right")
<< keyPresses << model << 1 << 1 << 2 << 1 << model->index(2, 1) << model->index(1, 1);
@@ -3481,7 +3481,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_PageDown << Qt::Key_Up;
- model.reset(new QStandardItemModel(3, 3));
+ model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("col span, bottom up")
<< keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 0) << model->index(1, 0);
@@ -3494,7 +3494,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_PageDown << Qt::Key_Right << Qt::Key_Up;
- model.reset(new QStandardItemModel(3, 3));
+ model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("col span, bottom up #2")
<< keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 1) << model->index(1, 0);
@@ -3507,7 +3507,7 @@ void tst_QTableView::editSpanFromDirections_data()
+---+---+---+ */
keyPresses.clear();
keyPresses << Qt::Key_End << Qt::Key_Down;
- model.reset(new QStandardItemModel(3, 3));
+ model = QSharedPointer<QStandardItemModel>::create(3, 3);
QTest::newRow("col span, top down")
<< keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 2) << model->index(1, 0);
}
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index bd5d5fac79..918df275e9 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -5753,14 +5753,14 @@ void tst_QWidget::testWindowIconChangeEventPropagation()
QList <EventSpyPtr> applicationEventSpies;
QList <EventSpyPtr> widgetEventSpies;
foreach (QWidget *widget, widgets) {
- applicationEventSpies.append(EventSpyPtr(new EventSpy<QWidget>(widget, QEvent::ApplicationWindowIconChange)));
- widgetEventSpies.append(EventSpyPtr(new EventSpy<QWidget>(widget, QEvent::WindowIconChange)));
+ applicationEventSpies.append(EventSpyPtr::create(widget, QEvent::ApplicationWindowIconChange));
+ widgetEventSpies.append(EventSpyPtr::create(widget, QEvent::WindowIconChange));
}
QList <WindowEventSpyPtr> appWindowEventSpies;
QList <WindowEventSpyPtr> windowEventSpies;
foreach (QWindow *window, windows) {
- appWindowEventSpies.append(WindowEventSpyPtr(new EventSpy<QWindow>(window, QEvent::ApplicationWindowIconChange)));
- windowEventSpies.append(WindowEventSpyPtr(new EventSpy<QWindow>(window, QEvent::WindowIconChange)));
+ appWindowEventSpies.append(WindowEventSpyPtr::create(window, QEvent::ApplicationWindowIconChange));
+ windowEventSpies.append(WindowEventSpyPtr::create(window, QEvent::WindowIconChange));
}
// QApplication::setWindowIcon