Pass params of shareable type by const-ref rather than by value
Instead of leaving a note for Qt6 and then forget to do the actual change once again, change APIs now inside QT_VERSION >= QT_VERSION_CHECK(6,0,0) blocks. Change-Id: Ifa769904e304358a9c2accfd6c9f86eeb342f9dc Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
9b67d89c24
commit
651329adb5
@ -457,7 +457,11 @@ 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.
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
QDBusMessage QDBusMessage::createErrorReply(const QString &name, const QString &msg) const
|
||||
#else
|
||||
QDBusMessage QDBusMessage::createErrorReply(const QString name, const QString &msg) const
|
||||
#endif
|
||||
{
|
||||
QDBusMessage reply = QDBusMessage::createError(name, msg);
|
||||
if (d_ptr->msg)
|
||||
|
@ -79,7 +79,11 @@ public:
|
||||
inline QDBusMessage createReply(const QVariant &argument) const
|
||||
{ return createReply(QList<QVariant>() << argument); }
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
QDBusMessage createErrorReply(const QString &name, const QString &msg) const;
|
||||
#else
|
||||
QDBusMessage createErrorReply(const QString name, const QString &msg) const;
|
||||
#endif
|
||||
inline QDBusMessage createErrorReply(const QDBusError &err) const
|
||||
{ return createErrorReply(err.name(), err.message()); }
|
||||
QDBusMessage createErrorReply(QDBusError::ErrorType type, const QString &msg) const;
|
||||
|
@ -1351,7 +1351,11 @@ int QImage::colorCount() const
|
||||
\sa colorTable(), setColor(), {QImage#Image Transformations}{Image
|
||||
Transformations}
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
void QImage::setColorTable(const QVector<QRgb> &colors)
|
||||
#else
|
||||
void QImage::setColorTable(const QVector<QRgb> colors)
|
||||
#endif
|
||||
{
|
||||
if (!d)
|
||||
return;
|
||||
@ -1361,7 +1365,11 @@ void QImage::setColorTable(const QVector<QRgb> colors)
|
||||
if (!d)
|
||||
return;
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
d->colortable = colors;
|
||||
#else
|
||||
d->colortable = qMove(const_cast<QVector<QRgb>&>(colors));
|
||||
#endif
|
||||
d->has_alpha_clut = false;
|
||||
for (int i = 0; i < d->colortable.size(); ++i) {
|
||||
if (qAlpha(d->colortable.at(i)) != 255) {
|
||||
|
@ -220,7 +220,11 @@ public:
|
||||
void setPixel(const QPoint &pt, uint index_or_rgb);
|
||||
|
||||
QVector<QRgb> colorTable() const;
|
||||
void setColorTable(const QVector<QRgb> colors); // ### Qt 6: remove const
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
void setColorTable(const QVector<QRgb> &colors);
|
||||
#else
|
||||
void setColorTable(const QVector<QRgb> colors);
|
||||
#endif
|
||||
|
||||
qreal devicePixelRatio() const;
|
||||
void setDevicePixelRatio(qreal scaleFactor);
|
||||
|
@ -1994,7 +1994,11 @@ void QGraphicsWidget::addAction(QAction *action)
|
||||
|
||||
\sa removeAction(), QMenu, addAction(), QWidget::addActions()
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
void QGraphicsWidget::addActions(const QList<QAction *> &actions)
|
||||
#else
|
||||
void QGraphicsWidget::addActions(QList<QAction *> actions)
|
||||
#endif
|
||||
{
|
||||
for (int i = 0; i < actions.count(); ++i)
|
||||
insertAction(0, actions.at(i));
|
||||
|
@ -137,7 +137,11 @@ public:
|
||||
#ifndef QT_NO_ACTION
|
||||
//actions
|
||||
void addAction(QAction *action);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
void addActions(const QList<QAction*> &actions);
|
||||
#else
|
||||
void addActions(QList<QAction*> actions);
|
||||
#endif
|
||||
void insertAction(QAction *before, QAction *action);
|
||||
void insertActions(QAction *before, QList<QAction*> actions);
|
||||
void removeAction(QAction *action);
|
||||
|
@ -1783,7 +1783,11 @@ QStringList QListWidget::mimeTypes() const
|
||||
If the list of items is empty, 0 is returned instead of a serialized empty
|
||||
list.
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
QMimeData *QListWidget::mimeData(const QList<QListWidgetItem *> &items) const
|
||||
#else
|
||||
QMimeData *QListWidget::mimeData(const QList<QListWidgetItem*> items) const
|
||||
#endif
|
||||
{
|
||||
Q_D(const QListWidget);
|
||||
|
||||
|
@ -266,7 +266,11 @@ Q_SIGNALS:
|
||||
protected:
|
||||
bool event(QEvent *e) Q_DECL_OVERRIDE;
|
||||
virtual QStringList mimeTypes() const;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
virtual QMimeData *mimeData(const QList<QListWidgetItem *> &items) const;
|
||||
#else
|
||||
virtual QMimeData *mimeData(const QList<QListWidgetItem*> items) const;
|
||||
#endif
|
||||
#ifndef QT_NO_DRAGANDDROP
|
||||
virtual bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action);
|
||||
virtual Qt::DropActions supportedDropActions() const;
|
||||
|
@ -2553,7 +2553,11 @@ QStringList QTableWidget::mimeTypes() const
|
||||
If the list of items is empty, 0 is returned rather than a serialized
|
||||
empty list.
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
QMimeData *QTableWidget::mimeData(const QList<QTableWidgetItem *> &items) const
|
||||
#else
|
||||
QMimeData *QTableWidget::mimeData(const QList<QTableWidgetItem*> items) const
|
||||
#endif
|
||||
{
|
||||
Q_D(const QTableWidget);
|
||||
|
||||
|
@ -313,7 +313,11 @@ Q_SIGNALS:
|
||||
protected:
|
||||
bool event(QEvent *e) Q_DECL_OVERRIDE;
|
||||
virtual QStringList mimeTypes() const;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
virtual QMimeData *mimeData(const QList<QTableWidgetItem *> &items) const;
|
||||
#else
|
||||
virtual QMimeData *mimeData(const QList<QTableWidgetItem*> items) const;
|
||||
#endif
|
||||
virtual bool dropMimeData(int row, int column, const QMimeData *data, Qt::DropAction action);
|
||||
virtual Qt::DropActions supportedDropActions() const;
|
||||
QList<QTableWidgetItem*> items(const QMimeData *data) const;
|
||||
|
@ -3267,7 +3267,11 @@ QStringList QTreeWidget::mimeTypes() const
|
||||
If the list of items is empty, 0 is returned rather than a serialized
|
||||
empty list.
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
QMimeData *QTreeWidget::mimeData(const QList<QTreeWidgetItem *> &items) const
|
||||
#else
|
||||
QMimeData *QTreeWidget::mimeData(const QList<QTreeWidgetItem*> items) const
|
||||
#endif
|
||||
{
|
||||
Q_D(const QTreeWidget);
|
||||
if (d->treeModel()->cachedIndexes.isEmpty()) {
|
||||
|
@ -340,7 +340,11 @@ Q_SIGNALS:
|
||||
protected:
|
||||
bool event(QEvent *e) Q_DECL_OVERRIDE;
|
||||
virtual QStringList mimeTypes() const;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
virtual QMimeData *mimeData(const QList<QTreeWidgetItem *> &items) const;
|
||||
#else
|
||||
virtual QMimeData *mimeData(const QList<QTreeWidgetItem*> items) const;
|
||||
#endif
|
||||
virtual bool dropMimeData(QTreeWidgetItem *parent, int index,
|
||||
const QMimeData *data, Qt::DropAction action);
|
||||
virtual Qt::DropActions supportedDropActions() const;
|
||||
|
@ -3227,7 +3227,11 @@ void QWidget::addAction(QAction *action)
|
||||
|
||||
\sa removeAction(), QMenu, addAction()
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
void QWidget::addActions(const QList<QAction *> &actions)
|
||||
#else
|
||||
void QWidget::addActions(QList<QAction*> actions)
|
||||
#endif
|
||||
{
|
||||
for(int i = 0; i < actions.count(); i++)
|
||||
insertAction(0, actions.at(i));
|
||||
|
@ -536,7 +536,11 @@ public:
|
||||
#ifndef QT_NO_ACTION
|
||||
//actions
|
||||
void addAction(QAction *action);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
void addActions(const QList<QAction*> &actions);
|
||||
#else
|
||||
void addActions(QList<QAction*> actions);
|
||||
#endif
|
||||
void insertAction(QAction *before, QAction *action);
|
||||
void insertActions(QAction *before, QList<QAction*> actions);
|
||||
void removeAction(QAction *action);
|
||||
|
@ -2336,7 +2336,11 @@ QAction *QMenu::exec(const QPoint &p, QAction *action)
|
||||
|
||||
\sa popup(), QWidget::mapToGlobal()
|
||||
*/
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
QAction *QMenu::exec(const QList<QAction *> &actions, const QPoint &pos, QAction *at, QWidget *parent)
|
||||
#else
|
||||
QAction *QMenu::exec(QList<QAction*> actions, const QPoint &pos, QAction *at, QWidget *parent)
|
||||
#endif
|
||||
{
|
||||
QMenu menu(parent);
|
||||
menu.addActions(actions);
|
||||
|
@ -111,7 +111,11 @@ public:
|
||||
QAction *exec();
|
||||
QAction *exec(const QPoint &pos, QAction *at=0);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||
static QAction *exec(const QList<QAction *> &actions, const QPoint &pos, QAction *at = 0, QWidget *parent = 0);
|
||||
#else
|
||||
static QAction *exec(QList<QAction*> actions, const QPoint &pos, QAction *at=0, QWidget *parent=0);
|
||||
#endif
|
||||
|
||||
QSize sizeHint() const Q_DECL_OVERRIDE;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user