OSDN Git Service

pass arguments by const-ref
authorIvailo Monev <xakepa10@laimg.moc>
Tue, 28 May 2019 00:34:54 +0000 (00:34 +0000)
committerIvailo Monev <xakepa10@laimg.moc>
Tue, 28 May 2019 00:34:54 +0000 (00:34 +0000)
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
src/dbus/qdbusmessage.cpp
src/dbus/qdbusmessage.h
src/gui/graphicsview/qgraphicswidget.cpp
src/gui/graphicsview/qgraphicswidget.h
src/gui/image/qimage.cpp
src/gui/image/qimage.h
src/gui/kernel/qwidget.cpp
src/gui/kernel/qwidget.h
src/gui/widgets/qmenu.cpp
src/gui/widgets/qmenu.h

index 339b61a..b81783b 100644 (file)
@@ -455,7 +455,7 @@ QDBusMessage QDBusMessage::createReply(const QVariantList &arguments) const
     Constructs a new DBus message representing an error reply message,
     with the given \a name and \a msg.
 */
-QDBusMessage QDBusMessage::createErrorReply(const QString name, const QString &msg) const
+QDBusMessage QDBusMessage::createErrorReply(const QString &name, const QString &msg) const
 {
     QDBusMessage reply = QDBusMessage::createError(name, msg);
     if (d_ptr->msg)
index f4317b0..5dafac9 100644 (file)
@@ -83,7 +83,7 @@ public:
     inline QDBusMessage createReply(const QVariant &argument) const
     { return createReply(QList<QVariant>() << argument); }
 
-    QDBusMessage createErrorReply(const QString name, const QString &msg) const;
+    QDBusMessage createErrorReply(const QString &name, const QString &msg) const;
     inline QDBusMessage createErrorReply(const QDBusError &err) const
     { return createErrorReply(err.name(), err.message()); }
     QDBusMessage createErrorReply(QDBusError::ErrorType type, const QString &msg) const;
index 45746b5..f1d0741 100644 (file)
@@ -1976,7 +1976,7 @@ void QGraphicsWidget::addAction(QAction *action)
 
     \sa removeAction(), QMenu, addAction(), QWidget::addActions()
 */
-void QGraphicsWidget::addActions(QList<QAction *> actions)
+void QGraphicsWidget::addActions(const QList<QAction *> &actions)
 {
     for (int i = 0; i < actions.count(); ++i)
         insertAction(0, actions.at(i));
@@ -2033,7 +2033,7 @@ void QGraphicsWidget::insertAction(QAction *before, QAction *action)
 
     \sa removeAction(), QMenu, insertAction(), QWidget::insertActions()
 */
-void QGraphicsWidget::insertActions(QAction *before, QList<QAction *> actions)
+void QGraphicsWidget::insertActions(QAction *before, const QList<QAction *> &actions)
 {
     for (int i = 0; i < actions.count(); ++i)
         insertAction(before, actions.at(i));
index 12812d2..9de1f1d 100644 (file)
@@ -147,9 +147,9 @@ public:
 #ifndef QT_NO_ACTION
     //actions
     void addAction(QAction *action);
-    void addActions(QList<QAction*> actions);
+    void addActions(const QList<QAction*> &actions);
     void insertAction(QAction *before, QAction *action);
-    void insertActions(QAction *before, QList<QAction*> actions);
+    void insertActions(QAction *before, const QList<QAction*> &actions);
     void removeAction(QAction *action);
     QList<QAction*> actions() const;
 #endif
index c41271b..9a00c6b 100644 (file)
@@ -1374,7 +1374,7 @@ int QImage::colorCount() const
     \sa colorTable(), setColor(), {QImage#Image Transformations}{Image
     Transformations}
 */
-void QImage::setColorTable(const QVector<QRgb> colors)
+void QImage::setColorTable(const QVector<QRgb> &colors)
 {
     if (!d)
         return;
index 8372207..6072b58 100644 (file)
@@ -184,7 +184,7 @@ public:
         { setPixel(pt.x(), pt.y(), index_or_rgb); }
 
     QVector<QRgb> colorTable() const;
-    void setColorTable(const QVector<QRgb> colors);
+    void setColorTable(const QVector<QRgb> &colors);
 
     void fill(uint pixel);
     void fill(const QColor &color);
index a896f5b..c5e4c5c 100644 (file)
@@ -2724,7 +2724,7 @@ void QWidget::addAction(QAction *action)
 
     \sa removeAction(), QMenu, addAction()
 */
-void QWidget::addActions(QList<QAction*> actions)
+void QWidget::addActions(const QList<QAction*> &actions)
 {
     for(int i = 0; i < actions.count(); i++)
         insertAction(0, actions.at(i));
@@ -2773,7 +2773,7 @@ void QWidget::insertAction(QAction *before, QAction *action)
 
     \sa removeAction(), QMenu, insertAction(), contextMenuPolicy
 */
-void QWidget::insertActions(QAction *before, QList<QAction*> actions)
+void QWidget::insertActions(QAction *before, const QList<QAction*> &actions)
 {
     for(int i = 0; i < actions.count(); ++i)
         insertAction(before, actions.at(i));
index a2c1419..3e95220 100644 (file)
@@ -520,9 +520,9 @@ public:
 #ifndef QT_NO_ACTION
     //actions
     void addAction(QAction *action);
-    void addActions(QList<QAction*> actions);
+    void addActions(const QList<QAction*> &actions);
     void insertAction(QAction *before, QAction *action);
-    void insertActions(QAction *before, QList<QAction*> actions);
+    void insertActions(QAction *before, const QList<QAction*> &actions);
     void removeAction(QAction *action);
     QList<QAction*> actions() const;
 #endif
index 336f3bb..506c9b7 100644 (file)
@@ -2026,7 +2026,7 @@ QAction *QMenu::exec(const QPoint &p, QAction *action)
 
     \sa popup(), QWidget::mapToGlobal()
 */
-QAction *QMenu::exec(QList<QAction*> actions, const QPoint &pos, QAction *at, QWidget *parent)
+QAction *QMenu::exec(const QList<QAction*> &actions, const QPoint &pos, QAction *at, QWidget *parent)
 {
     QMenu menu(parent);
     menu.addActions(actions);
index fc69978..439e1f8 100644 (file)
@@ -111,7 +111,7 @@ public:
     QAction *exec();
     QAction *exec(const QPoint &pos, QAction *at = Q_NULLPTR);
 
-    static QAction *exec(QList<QAction*> actions, const QPoint &pos,
+    static QAction *exec(const QList<QAction*> &actions, const QPoint &pos,
             QAction *at = Q_NULLPTR, QWidget *parent = Q_NULLPTR);
 
     QSize sizeHint() const;