diff options
author | Sérgio Martins <sergio.martins@kdab.com> | 2015-07-19 21:07:42 +0100 |
---|---|---|
committer | Sérgio Martins <sergio.martins@kdab.com> | 2015-12-12 20:35:56 +0000 |
commit | d6c2dea7da1b726d5d074bb2505b89b5e849fac5 (patch) | |
tree | 379558f6209e55030ac0f693be39c3b2de620a0a /src/widgets/kernel | |
parent | 6cc79ad9947bc353dbc7decd91c462c9b104cf92 (diff) |
widgets: Pass non-trivially-copyable or large types by const-ref
Change-Id: I912c6a9ee7b27350ac3d1fe147b697338e76f53c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 6 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 66f68766cd..2f436b11af 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -3326,7 +3326,11 @@ void QWidget::insertAction(QAction *before, QAction *action) \sa removeAction(), QMenu, insertAction(), contextMenuPolicy */ +#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) +void QWidget::insertActions(QAction *before, const QList<QAction*> &actions) +#else void QWidget::insertActions(QAction *before, QList<QAction*> actions) +#endif { for(int i = 0; i < actions.count(); ++i) insertAction(before, actions.at(i)); @@ -5018,7 +5022,7 @@ void QWidgetPrivate::unsetCursor_sys() qt_qpa_set_cursor(q, false); } -static inline void applyCursor(QWidget *w, QCursor c) +static inline void applyCursor(QWidget *w, const QCursor &c) { if (QWindow *window = w->windowHandle()) window->setCursor(c); diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index a56f6e1133..638c962e68 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -541,11 +541,12 @@ public: void addAction(QAction *action); #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) void addActions(const QList<QAction*> &actions); + void insertActions(const QAction *before, const QList<QAction*> &actions); #else void addActions(QList<QAction*> actions); + void insertActions(QAction *before, QList<QAction*> actions); #endif void insertAction(QAction *before, QAction *action); - void insertActions(QAction *before, QList<QAction*> actions); void removeAction(QAction *action); QList<QAction*> actions() const; #endif |