diff options
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | src/designer/src/lib/shared/qdesigner_propertysheet.cpp | 8 | ||||
-rw-r--r-- | src/macdeployqt/shared/shared.cpp | 9 | ||||
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 24 | ||||
-rw-r--r-- | src/shared/qtgradienteditor/qtgradientstopsmodel.cpp | 18 |
5 files changed, 33 insertions, 28 deletions
diff --git a/.qmake.conf b/.qmake.conf index db2e0b653..2c781f2ea 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -1,3 +1,5 @@ load(qt_build_config) +DEFINES += QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST + MODULE_VERSION = 5.14.0 diff --git a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp index 1293b689c..eafc0de4f 100644 --- a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -1657,16 +1657,16 @@ QObject *QDesignerAbstractPropertySheetFactory::extension(QObject *object, const void QDesignerAbstractPropertySheetFactory::objectDestroyed(QObject *object) { - QMutableMapIterator<QObject*, QObject*> it(m_impl->m_extensions); - while (it.hasNext()) { - it.next(); + for (auto it = m_impl->m_extensions.begin(), end = m_impl->m_extensions.end(); it != end; /*erasing*/) { if (it.key() == object || it.value() == object) { if (it.key() == object) { QObject *ext = it.value(); disconnect(ext, &QObject::destroyed, this, &QDesignerAbstractPropertySheetFactory::objectDestroyed); delete ext; } - it.remove(); + it = m_impl->m_extensions.erase(it); + } else { + ++it; } } } diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp index a248d8ccd..69d0ce8ca 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -530,12 +530,11 @@ QSet<QString> getBinaryRPaths(const QString &path, bool resolve = true, QString QString output = otool.readAllStandardOutput(); QStringList outputLines = output.split("\n"); - QStringListIterator i(outputLines); - while (i.hasNext()) { - if (i.next().contains("cmd LC_RPATH") && i.hasNext() && - i.next().contains("cmdsize") && i.hasNext()) { - const QString &rpathCmd = i.next(); + for (auto i = outputLines.cbegin(), end = outputLines.cend(); i != end; ++i) { + if (i->contains("cmd LC_RPATH") && ++i != end && + i->contains("cmdsize") && ++i != end) { + const QString &rpathCmd = *i; int pathStart = rpathCmd.indexOf("path "); int pathEnd = rpathCmd.indexOf(" ("); if (pathStart >= 0 && pathEnd >= 0 && pathStart < pathEnd) { diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 6d5ec5af0..a4ce5fa2e 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -39,6 +39,8 @@ #include <qdebug.h> #include "generator.h" +#include <algorithm> + QT_BEGIN_NAMESPACE /* qmake ignore Q_OBJECT */ @@ -886,18 +888,20 @@ void CppCodeParser::setExampleFileLists(PageNode *pn) if (!exampleFiles.isEmpty()) { // move main.cpp and to the end, if it exists QString mainCpp; - QMutableStringListIterator i(exampleFiles); - i.toBack(); - while (i.hasPrevious()) { - QString fileName = i.previous(); + + const auto isGeneratedOrMainCpp = [&mainCpp](const QString &fileName) { if (fileName.endsWith("/main.cpp")) { - mainCpp = fileName; - i.remove(); + if (mainCpp.isEmpty()) + mainCpp = fileName; + return true; } - else if (fileName.contains("/qrc_") || fileName.contains("/moc_") - || fileName.contains("/ui_")) - i.remove(); - } + return fileName.contains("/qrc_") || fileName.contains("/moc_") || fileName.contains("/ui_"); + }; + + exampleFiles.erase(std::remove_if(exampleFiles.begin(), exampleFiles.end(), + isGeneratedOrMainCpp), + exampleFiles.end()); + if (!mainCpp.isEmpty()) exampleFiles.append(mainCpp); diff --git a/src/shared/qtgradienteditor/qtgradientstopsmodel.cpp b/src/shared/qtgradienteditor/qtgradientstopsmodel.cpp index 0dac9b867..d35c1f025 100644 --- a/src/shared/qtgradienteditor/qtgradientstopsmodel.cpp +++ b/src/shared/qtgradienteditor/qtgradientstopsmodel.cpp @@ -418,21 +418,21 @@ void QtGradientStopsModel::clearSelection() selectStop(stop, false); } +namespace { + template <typename BidirectionalIterator> + std::reverse_iterator<BidirectionalIterator> rev(BidirectionalIterator it) + { return std::reverse_iterator<BidirectionalIterator>(it); } +} + void QtGradientStopsModel::flipAll() { QMap<qreal, QtGradientStop *> stopsMap = stops(); - QMapIterator<qreal, QtGradientStop *> itStop(stopsMap); - itStop.toBack(); - QMap<QtGradientStop *, bool> swappedList; - - while (itStop.hasPrevious()) { - itStop.previous(); - - QtGradientStop *stop = itStop.value(); + for (auto itStop = rev(stopsMap.keyValueEnd()), end = rev(stopsMap.keyValueBegin()); itStop != end; ++itStop) { + QtGradientStop *stop = (*itStop).second; if (swappedList.contains(stop)) continue; - const double newPos = 1.0 - itStop.key(); + const double newPos = 1.0 - (*itStop).first; if (stopsMap.contains(newPos)) { QtGradientStop *swapped = stopsMap.value(newPos); swappedList[swapped] = true; |