#include "QtCore/qcoreapplication.h"
#include "private/qobject_p.h"
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
// insert event in descending priority order, using upper
// bound for a given priority (to ensure proper ordering
// of events with the same priority)
- QPostEventList::iterator at = qUpperBound(begin() + insertionOffset, end(), priority);
+ QPostEventList::iterator at = std::upper_bound(begin() + insertionOffset, end(), priority);
insert(at, ev);
}
}
#include "qthreadpool_p.h"
#include "qelapsedtimer.h"
+#include <algorithm>
+
#ifndef QT_NO_THREAD
QT_BEGIN_NAMESPACE
QList<QPair<QRunnable *, int> >::const_iterator begin = queue.constBegin();
QList<QPair<QRunnable *, int> >::const_iterator it = queue.constEnd();
if (it != begin && priority < (*(it - 1)).second)
- it = qUpperBound(begin, --it, priority);
+ it = std::upper_bound(begin, --it, priority);
queue.insert(it - begin, qMakePair(runnable, priority));
runnableReady.wakeOne();
}
Example:
\snippet code/src_corelib_tools_qmap.cpp 17
- \sa qUpperBound(), lowerBound(), find()
+ \sa lowerBound(), find()
*/
/*! \fn QMap::const_iterator QMap::upperBound(const Key &key) const
Q_D(QShortcutMap);
QShortcutEntry newEntry(owner, key, context, --(d->currentId), true, matcher);
- QList<QShortcutEntry>::iterator it = qUpperBound(d->sequences.begin(), d->sequences.end(), newEntry);
+ QList<QShortcutEntry>::iterator it = std::upper_bound(d->sequences.begin(), d->sequences.end(), newEntry);
d->sequences.insert(it, newEntry); // Insert sorted
#if defined(DEBUG_QSHORTCUTMAP)
qDebug().nospace()
firstRow = rowIt - td->rowPositions.constBegin();
}
- rowIt = qUpperBound(td->rowPositions.constBegin(), td->rowPositions.constEnd(), QFixed::fromReal(context.clip.bottom() - off.y()));
+ rowIt = std::upper_bound(td->rowPositions.constBegin(), td->rowPositions.constEnd(), QFixed::fromReal(context.clip.bottom() - off.y()));
if (rowIt != td->rowPositions.constEnd()) {
++rowIt;
lastRow = rowIt - td->rowPositions.constBegin();
#include "qrawfont_p.h"
#include <qguiapplication.h>
#include <qinputmethod.h>
+#include <algorithm>
#include <stdlib.h>
#include "qfontengine_qpa_p.h"
if (strPos <= 0 || strPos >= layoutData->string.length())
return;
- const QScriptItem* it = qUpperBound(layoutData->items.constBegin(), layoutData->items.constEnd(),
- strPos, QScriptItemComparator());
+ const QScriptItem* it = std::upper_bound(layoutData->items.constBegin(), layoutData->items.constEnd(),
+ strPos, QScriptItemComparator());
Q_ASSERT(it > layoutData->items.constBegin());
--it;
if (it->position == strPos) {
while (startIt != addFormatSortedByStart.end() &&
specialData->addFormats.at(*startIt).start <= si->position) {
- currentFormats.insert(qUpperBound(currentFormats.begin(), currentFormats.end(), *startIt),
+ currentFormats.insert(std::upper_bound(currentFormats.begin(), currentFormats.end(), *startIt),
*startIt);
++startIt;
}
for (int r = row + 1; r < row + rowSpan; ++r) {
// find the cell before which to insert the new cell markers
int gridIndex = r * d->nCols + column;
- QVector<int>::iterator it = qUpperBound(d->cellIndices.begin(), d->cellIndices.end(), gridIndex);
+ QVector<int>::iterator it = std::upper_bound(d->cellIndices.begin(), d->cellIndices.end(), gridIndex);
int cellIndex = it - d->cellIndices.begin();
int fragment = d->cells.value(cellIndex, d->fragment_end);
rowPositions[r - row] = p->fragmentMap().position(fragment);
const QList<QTextFrame *>::ConstIterator firstFrame = std::lower_bound(children.constBegin(), children.constEnd(),
cursor.selectionStart(), firstFramePosLessThanCursorPos);
- const QList<QTextFrame *>::ConstIterator lastFrame = qUpperBound(children.constBegin(), children.constEnd(),
- cursor.selectionEnd(), cursorPosLessThanLastFramePos);
+ const QList<QTextFrame *>::ConstIterator lastFrame = std::upper_bound(children.constBegin(), children.constEnd(),
+ cursor.selectionEnd(), cursorPosLessThanLastFramePos);
for (QList<QTextFrame *>::ConstIterator it = firstFrame; it != lastFrame; ++it) {
if ((*it)->frameFormat().position() != QTextFrameFormat::InFlow)
r |= frame->document()->documentLayout()->frameBoundingRect(*it);