diff --git a/src/widgets/dialogs/qerrormessage.cpp b/src/widgets/dialogs/qerrormessage.cpp index bcfc00d982..8200135abe 100644 --- a/src/widgets/dialogs/qerrormessage.cpp +++ b/src/widgets/dialogs/qerrormessage.cpp @@ -62,6 +62,13 @@ QT_BEGIN_NAMESPACE +namespace { +struct Message { + QString content; + QString type; +}; +} + class QErrorMessagePrivate : public QDialogPrivate { Q_DECLARE_PUBLIC(QErrorMessage) @@ -70,7 +77,7 @@ public: QCheckBox * again; QTextEdit * errors; QLabel * icon; - std::queue > pending; + std::queue pending; QSet doNotShow; QSet doNotShowType; QString currentMessage; @@ -303,9 +310,8 @@ bool QErrorMessagePrivate::isMessageToBeShown(const QString &message, const QStr bool QErrorMessagePrivate::nextPending() { while (!pending.empty()) { - QPair &pendingMessage = pending.front(); - QString message = qMove(pendingMessage.first); - QString type = qMove(pendingMessage.second); + QString message = std::move(pending.front().content); + QString type = std::move(pending.front().type); pending.pop(); if (isMessageToBeShown(message, type)) { #ifndef QT_NO_TEXTHTMLPARSER @@ -355,7 +361,7 @@ void QErrorMessage::showMessage(const QString &message, const QString &type) Q_D(QErrorMessage); if (!d->isMessageToBeShown(message, type)) return; - d->pending.push(qMakePair(message, type)); + d->pending.push({message, type}); if (!isVisible() && d->nextPending()) show(); }