diff --git a/src/corelib/tools/qqueue.h b/src/corelib/tools/qqueue.h index d5a60ada56..8dddf05352 100644 --- a/src/corelib/tools/qqueue.h +++ b/src/corelib/tools/qqueue.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -51,10 +51,10 @@ class QQueue : public QList public: // compiler-generated special member functions are fine! inline void swap(QQueue &other) noexcept { QList::swap(other); } // prevent QList<->QQueue swaps -#ifndef Q_QDOC - // bring in QList::swap(int, int). We cannot say using QList::swap, - // because we don't want to make swap(QList&) available. - Q_DECL_DEPRECATED inline void swap(int i, int j) { QList::swapItemsAt(i, j); } +#if QT_DEPRECATED_SINCE(5, 14) && !defined(Q_QDOC) + // NOT using QList::swap; it would make swap(QList&) available. + QT_DEPRECATED_VERSION_X_5_14("Use swapItemsAt(i, j) instead") + inline void swap(int i, int j) { QList::swapItemsAt(i, j); } #endif inline void enqueue(const T &t) { QList::append(t); } inline T dequeue() { return QList::takeFirst(); }