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,
|
Constructs a new DBus message representing an error reply message,
|
||||||
with the given \a name and \a msg.
|
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
|
QDBusMessage QDBusMessage::createErrorReply(const QString name, const QString &msg) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
QDBusMessage reply = QDBusMessage::createError(name, msg);
|
QDBusMessage reply = QDBusMessage::createError(name, msg);
|
||||||
if (d_ptr->msg)
|
if (d_ptr->msg)
|
||||||
|
@ -79,7 +79,11 @@ public:
|
|||||||
inline QDBusMessage createReply(const QVariant &argument) const
|
inline QDBusMessage createReply(const QVariant &argument) const
|
||||||
{ return createReply(QList<QVariant>() << argument); }
|
{ 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;
|
QDBusMessage createErrorReply(const QString name, const QString &msg) const;
|
||||||
|
#endif
|
||||||
inline QDBusMessage createErrorReply(const QDBusError &err) const
|
inline QDBusMessage createErrorReply(const QDBusError &err) const
|
||||||
{ return createErrorReply(err.name(), err.message()); }
|
{ return createErrorReply(err.name(), err.message()); }
|
||||||
QDBusMessage createErrorReply(QDBusError::ErrorType type, const QString &msg) const;
|
QDBusMessage createErrorReply(QDBusError::ErrorType type, const QString &msg) const;
|
||||||
|
@ -1351,7 +1351,11 @@ int QImage::colorCount() const
|
|||||||
\sa colorTable(), setColor(), {QImage#Image Transformations}{Image
|
\sa colorTable(), setColor(), {QImage#Image Transformations}{Image
|
||||||
Transformations}
|
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)
|
void QImage::setColorTable(const QVector<QRgb> colors)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (!d)
|
if (!d)
|
||||||
return;
|
return;
|
||||||
@ -1361,7 +1365,11 @@ void QImage::setColorTable(const QVector<QRgb> colors)
|
|||||||
if (!d)
|
if (!d)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
|
||||||
|
d->colortable = colors;
|
||||||
|
#else
|
||||||
d->colortable = qMove(const_cast<QVector<QRgb>&>(colors));
|
d->colortable = qMove(const_cast<QVector<QRgb>&>(colors));
|
||||||
|
#endif
|
||||||
d->has_alpha_clut = false;
|
d->has_alpha_clut = false;
|
||||||
for (int i = 0; i < d->colortable.size(); ++i) {
|
for (int i = 0; i < d->colortable.size(); ++i) {
|
||||||
if (qAlpha(d->colortable.at(i)) != 255) {
|
if (qAlpha(d->colortable.at(i)) != 255) {
|
||||||
|
@ -220,7 +220,11 @@ public:
|
|||||||
void setPixel(const QPoint &pt, uint index_or_rgb);
|
void setPixel(const QPoint &pt, uint index_or_rgb);
|
||||||
|
|
||||||
QVector<QRgb> colorTable() const;
|
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;
|
qreal devicePixelRatio() const;
|
||||||
void setDevicePixelRatio(qreal scaleFactor);
|
void setDevicePixelRatio(qreal scaleFactor);
|
||||||
|
@ -1994,7 +1994,11 @@ void QGraphicsWidget::addAction(QAction *action)
|
|||||||
|
|
||||||
\sa removeAction(), QMenu, addAction(), QWidget::addActions()
|
\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)
|
void QGraphicsWidget::addActions(QList<QAction *> actions)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
for (int i = 0; i < actions.count(); ++i)
|
for (int i = 0; i < actions.count(); ++i)
|
||||||
insertAction(0, actions.at(i));
|
insertAction(0, actions.at(i));
|
||||||
|
@ -137,7 +137,11 @@ public:
|
|||||||
#ifndef QT_NO_ACTION
|
#ifndef QT_NO_ACTION
|
||||||
//actions
|
//actions
|
||||||
void addAction(QAction *action);
|
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);
|
void addActions(QList<QAction*> actions);
|
||||||
|
#endif
|
||||||
void insertAction(QAction *before, QAction *action);
|
void insertAction(QAction *before, QAction *action);
|
||||||
void insertActions(QAction *before, QList<QAction*> actions);
|
void insertActions(QAction *before, QList<QAction*> actions);
|
||||||
void removeAction(QAction *action);
|
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
|
If the list of items is empty, 0 is returned instead of a serialized empty
|
||||||
list.
|
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
|
QMimeData *QListWidget::mimeData(const QList<QListWidgetItem*> items) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
Q_D(const QListWidget);
|
Q_D(const QListWidget);
|
||||||
|
|
||||||
|
@ -266,7 +266,11 @@ Q_SIGNALS:
|
|||||||
protected:
|
protected:
|
||||||
bool event(QEvent *e) Q_DECL_OVERRIDE;
|
bool event(QEvent *e) Q_DECL_OVERRIDE;
|
||||||
virtual QStringList mimeTypes() const;
|
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;
|
virtual QMimeData *mimeData(const QList<QListWidgetItem*> items) const;
|
||||||
|
#endif
|
||||||
#ifndef QT_NO_DRAGANDDROP
|
#ifndef QT_NO_DRAGANDDROP
|
||||||
virtual bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action);
|
virtual bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action);
|
||||||
virtual Qt::DropActions supportedDropActions() const;
|
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
|
If the list of items is empty, 0 is returned rather than a serialized
|
||||||
empty list.
|
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
|
QMimeData *QTableWidget::mimeData(const QList<QTableWidgetItem*> items) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
Q_D(const QTableWidget);
|
Q_D(const QTableWidget);
|
||||||
|
|
||||||
|
@ -313,7 +313,11 @@ Q_SIGNALS:
|
|||||||
protected:
|
protected:
|
||||||
bool event(QEvent *e) Q_DECL_OVERRIDE;
|
bool event(QEvent *e) Q_DECL_OVERRIDE;
|
||||||
virtual QStringList mimeTypes() const;
|
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;
|
virtual QMimeData *mimeData(const QList<QTableWidgetItem*> items) const;
|
||||||
|
#endif
|
||||||
virtual bool dropMimeData(int row, int column, const QMimeData *data, Qt::DropAction action);
|
virtual bool dropMimeData(int row, int column, const QMimeData *data, Qt::DropAction action);
|
||||||
virtual Qt::DropActions supportedDropActions() const;
|
virtual Qt::DropActions supportedDropActions() const;
|
||||||
QList<QTableWidgetItem*> items(const QMimeData *data) 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
|
If the list of items is empty, 0 is returned rather than a serialized
|
||||||
empty list.
|
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
|
QMimeData *QTreeWidget::mimeData(const QList<QTreeWidgetItem*> items) const
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
Q_D(const QTreeWidget);
|
Q_D(const QTreeWidget);
|
||||||
if (d->treeModel()->cachedIndexes.isEmpty()) {
|
if (d->treeModel()->cachedIndexes.isEmpty()) {
|
||||||
|
@ -340,7 +340,11 @@ Q_SIGNALS:
|
|||||||
protected:
|
protected:
|
||||||
bool event(QEvent *e) Q_DECL_OVERRIDE;
|
bool event(QEvent *e) Q_DECL_OVERRIDE;
|
||||||
virtual QStringList mimeTypes() const;
|
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;
|
virtual QMimeData *mimeData(const QList<QTreeWidgetItem*> items) const;
|
||||||
|
#endif
|
||||||
virtual bool dropMimeData(QTreeWidgetItem *parent, int index,
|
virtual bool dropMimeData(QTreeWidgetItem *parent, int index,
|
||||||
const QMimeData *data, Qt::DropAction action);
|
const QMimeData *data, Qt::DropAction action);
|
||||||
virtual Qt::DropActions supportedDropActions() const;
|
virtual Qt::DropActions supportedDropActions() const;
|
||||||
|
@ -3227,7 +3227,11 @@ void QWidget::addAction(QAction *action)
|
|||||||
|
|
||||||
\sa removeAction(), QMenu, addAction()
|
\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)
|
void QWidget::addActions(QList<QAction*> actions)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
for(int i = 0; i < actions.count(); i++)
|
for(int i = 0; i < actions.count(); i++)
|
||||||
insertAction(0, actions.at(i));
|
insertAction(0, actions.at(i));
|
||||||
|
@ -536,7 +536,11 @@ public:
|
|||||||
#ifndef QT_NO_ACTION
|
#ifndef QT_NO_ACTION
|
||||||
//actions
|
//actions
|
||||||
void addAction(QAction *action);
|
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);
|
void addActions(QList<QAction*> actions);
|
||||||
|
#endif
|
||||||
void insertAction(QAction *before, QAction *action);
|
void insertAction(QAction *before, QAction *action);
|
||||||
void insertActions(QAction *before, QList<QAction*> actions);
|
void insertActions(QAction *before, QList<QAction*> actions);
|
||||||
void removeAction(QAction *action);
|
void removeAction(QAction *action);
|
||||||
|
@ -2336,7 +2336,11 @@ QAction *QMenu::exec(const QPoint &p, QAction *action)
|
|||||||
|
|
||||||
\sa popup(), QWidget::mapToGlobal()
|
\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)
|
QAction *QMenu::exec(QList<QAction*> actions, const QPoint &pos, QAction *at, QWidget *parent)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
QMenu menu(parent);
|
QMenu menu(parent);
|
||||||
menu.addActions(actions);
|
menu.addActions(actions);
|
||||||
|
@ -111,7 +111,11 @@ public:
|
|||||||
QAction *exec();
|
QAction *exec();
|
||||||
QAction *exec(const QPoint &pos, QAction *at=0);
|
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);
|
static QAction *exec(QList<QAction*> actions, const QPoint &pos, QAction *at=0, QWidget *parent=0);
|
||||||
|
#endif
|
||||||
|
|
||||||
QSize sizeHint() const Q_DECL_OVERRIDE;
|
QSize sizeHint() const Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user