diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-07-13 17:19:49 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-07-19 13:40:42 +0000 |
commit | 94cf203f36deb5b46d47197d31b780de5f464937 (patch) | |
tree | 7c66536f8fa075ed72b5aa3cf8fc208488a17779 /tests/auto/widgets/kernel | |
parent | ad68bf51e79f52c1ffa597b76edaecadafddbd06 (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/kernel')
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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 |