From 94cf203f36deb5b46d47197d31b780de5f464937 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 13 Jul 2017 17:19:49 +0200 Subject: Use QSharedPointer::create() more MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/auto/widgets/itemviews/qtableview') 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::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::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::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::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::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::create(3, 3); QTest::newRow("col span, top down") << keyPresses << model << 1 << 0 << 1 << 3 << model->index(1, 2) << model->index(1, 0); } -- cgit v1.2.3