Qt 4.8
Namespaces | Functions
qalgorithms.h File Reference
#include <QtCore/qglobal.h>

Go to the source code of this file.

Namespaces

 QAlgorithmsPrivate
 

Functions

template<typename RandomAccessIterator , typename T >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind (RandomAccessIterator begin, RandomAccessIterator end, const T &value)
 
template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
 
template<typename Container , typename T >
Q_OUTOFLINE_TEMPLATE Container::const_iterator qBinaryFind (const Container &container, const T &value)
 
template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator QAlgorithmsPrivate::qBinaryFindHelper (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
 
template<typename InputIterator , typename OutputIterator >
OutputIterator qCopy (InputIterator begin, InputIterator end, OutputIterator dest)
 
template<typename BiIterator1 , typename BiIterator2 >
BiIterator2 qCopyBackward (BiIterator1 begin, BiIterator1 end, BiIterator2 dest)
 
template<typename InputIterator , typename T , typename Size >
void qCount (InputIterator first, InputIterator last, const T &value, Size &n)
 
template<typename Container , typename T , typename Size >
void qCount (const Container &container, const T &value, Size &n)
 
template<typename ForwardIterator >
Q_OUTOFLINE_TEMPLATE void qDeleteAll (ForwardIterator begin, ForwardIterator end)
 
template<typename Container >
void qDeleteAll (const Container &c)
 
template<typename InputIterator1 , typename InputIterator2 >
bool qEqual (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2)
 
template<typename ForwardIterator , typename T >
void qFill (ForwardIterator first, ForwardIterator last, const T &val)
 
template<typename Container , typename T >
void qFill (Container &container, const T &val)
 
template<typename InputIterator , typename T >
InputIterator qFind (InputIterator first, InputIterator last, const T &val)
 
template<typename Container , typename T >
Container::const_iterator qFind (const Container &container, const T &val)
 
template<typename T >
LessThan qGreater ()
 
template<typename T >
LessThan qLess ()
 
template<typename RandomAccessIterator , typename T >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound (RandomAccessIterator begin, RandomAccessIterator end, const T &value)
 
template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
 
template<typename Container , typename T >
Q_OUTOFLINE_TEMPLATE Container::const_iterator qLowerBound (const Container &container, const T &value)
 
template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator QAlgorithmsPrivate::qLowerBoundHelper (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
 
template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE void QAlgorithmsPrivate::qMerge (RandomAccessIterator begin, RandomAccessIterator pivot, RandomAccessIterator end, T &t, LessThan lessThan)
 
template<typename RandomAccessIterator >
Q_OUTOFLINE_TEMPLATE void QAlgorithmsPrivate::qReverse (RandomAccessIterator begin, RandomAccessIterator end)
 
template<typename RandomAccessIterator >
Q_OUTOFLINE_TEMPLATE void QAlgorithmsPrivate::qRotate (RandomAccessIterator begin, RandomAccessIterator middle, RandomAccessIterator end)
 
template<typename RandomAccessIterator >
void qSort (RandomAccessIterator start, RandomAccessIterator end)
 
template<typename RandomAccessIterator , typename LessThan >
void qSort (RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan)
 
template<typename Container >
void qSort (Container &c)
 
template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE void QAlgorithmsPrivate::qSortHelper (RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan)
 
template<typename RandomAccessIterator , typename T >
void QAlgorithmsPrivate::qSortHelper (RandomAccessIterator begin, RandomAccessIterator end, const T &dummy)
 
template<typename RandomAccessIterator >
void qStableSort (RandomAccessIterator start, RandomAccessIterator end)
 
template<typename RandomAccessIterator , typename LessThan >
void qStableSort (RandomAccessIterator start, RandomAccessIterator end, LessThan lessThan)
 
template<typename Container >
void qStableSort (Container &c)
 
template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE void QAlgorithmsPrivate::qStableSortHelper (RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan)
 
template<typename RandomAccessIterator , typename T >
void QAlgorithmsPrivate::qStableSortHelper (RandomAccessIterator, RandomAccessIterator, const T &)
 
template<typename RandomAccessIterator , typename T >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound (RandomAccessIterator begin, RandomAccessIterator end, const T &value)
 
template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
 
template<typename Container , typename T >
Q_OUTOFLINE_TEMPLATE Container::const_iterator qUpperBound (const Container &container, const T &value)
 
template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator QAlgorithmsPrivate::qUpperBoundHelper (RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
 

Function Documentation

◆ qBinaryFind() [1/3]

template<typename RandomAccessIterator , typename T >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind ( RandomAccessIterator  begin,
RandomAccessIterator  end,
const T &  value 
)

Definition at line 295 of file qalgorithms.h.

Referenced by QFileSystemModelPrivate::_q_directoryChanged(), QRegExpEngine::addPlusTransitions(), QCP949Codec::convertFromUnicode(), QTextTablePrivate::findCellIndex(), findKnownValue(), get_named_rgb(), QGraphicsItemAnimationPrivate::insertUniquePair(), isKeyword(), ligatureHelper(), lookupElementHelper(), mapToLowerCase(), QTextTable::mergeCells(), qt_get_named_xpm_rgb(), qt_macSymbolForQtKey(), qtKey2CocoaKey(), resolveEntity(), string2PaperSize(), and QVariantAnimationPrivate::valueAt().

296 {
297  // Implementation is duplicated from QAlgorithmsPrivate.
298  RandomAccessIterator it = qLowerBound(begin, end, value);
299 
300  if (it == end || value < *it)
301  return end;
302 
303  return it;
304 }
#define it(className, varName)
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
Definition: qalgorithms.h:227
static const KeyPair *const end

◆ qBinaryFind() [2/3]

template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind ( RandomAccessIterator  begin,
RandomAccessIterator  end,
const T &  value,
LessThan  lessThan 
)

Definition at line 307 of file qalgorithms.h.

308 {
309  return QAlgorithmsPrivate::qBinaryFindHelper(begin, end, value, lessThan);
310 }
static bool lessThan(const QChar *a, int l, const char *c)
Definition: qurl.cpp:3253
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
Definition: qalgorithms.h:510
static const KeyPair *const end

◆ qBinaryFind() [3/3]

template<typename Container , typename T >
Q_OUTOFLINE_TEMPLATE Container::const_iterator qBinaryFind ( const Container &  container,
const T &  value 
)

Definition at line 313 of file qalgorithms.h.

314 {
315  return QAlgorithmsPrivate::qBinaryFindHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
316 }
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFindHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
Definition: qalgorithms.h:510

◆ qCopy()

template<typename InputIterator , typename OutputIterator >
OutputIterator qCopy ( InputIterator  begin,
InputIterator  end,
OutputIterator  dest 
)
inline

◆ qCopyBackward()

template<typename BiIterator1 , typename BiIterator2 >
BiIterator2 qCopyBackward ( BiIterator1  begin,
BiIterator1  end,
BiIterator2  dest 
)
inline

Definition at line 87 of file qalgorithms.h.

88 {
89  while (begin != end)
90  *--dest = *--end;
91  return dest;
92 }
static const KeyPair *const end

◆ qCount() [1/2]

template<typename InputIterator , typename T , typename Size >
void qCount ( InputIterator  first,
InputIterator  last,
const T &  value,
Size &  n 
)
inline

Definition at line 131 of file qalgorithms.h.

Referenced by qCount().

132 {
133  for (; first != last; ++first)
134  if (*first == value)
135  ++n;
136 }

◆ qCount() [2/2]

template<typename Container , typename T , typename Size >
void qCount ( const Container &  container,
const T &  value,
Size &  n 
)
inline

Definition at line 139 of file qalgorithms.h.

140 {
141  qCount(container.constBegin(), container.constEnd(), value, n);
142 }
void qCount(InputIterator first, InputIterator last, const T &value, Size &n)
Definition: qalgorithms.h:131

◆ qDeleteAll() [1/2]

template<typename ForwardIterator >
Q_OUTOFLINE_TEMPLATE void qDeleteAll ( ForwardIterator  begin,
ForwardIterator  end 
)

Definition at line 319 of file qalgorithms.h.

Referenced by QSortFilterProxyModelPrivate::_q_clearMapping(), QWSServerPrivate::_q_deleteWindowsLater(), QSortFilterProxyModelPrivate::_q_sourceLayoutChanged(), QStateMachinePrivate::_q_start(), QPreviewPaintEngine::abort(), QPreviewPaintEngine::begin(), QGraphicsAnchorLayoutPrivate::calculateGraphs(), QGraphicsAnchorLayoutPrivate::calculateTrunk(), QGLGlyphCache::cleanCache(), cleanDriverDict(), cleanup(), QGestureManager::cleanupGesturesForRemovedRecognizer(), QAnimationGroup::clear(), QDeclarativeIntegerCache::clear(), QDeclarativeTypeNameCache::clear(), FlatListModel::clear(), QUndoStack::clear(), QSpanCollection::clear(), QDeclarativeScriptParser::clear(), QDeclarativeCompiledData::clear(), QDialogButtonBox::clear(), QTestEventList::clear(), QFontEngineFT::QGlyphSet::clear(), QHostInfoLookupManager::clear(), ModelNode::clear(), QStandardItemModel::clear(), QDeclarativePaintedItem::clearCache(), QDeclarativeTypeLoader::clearCache(), QTcpServer::close(), QLocalServer::close(), QWSPcMouseHandlerPrivate::closeDevices(), QWSServer::closeKeyboard(), QWSServer::closeMouse(), QScriptDebuggerLocalsModelPrivate::depopulate(), QBBIntegration::destroyDisplays(), QScriptDebuggerBackend::detach(), QFutureWatcherBase::disconnectOutputInterface(), QPdfBaseEngine::end(), QWindowSurface::endPaint(), QFutureWatcherBase::event(), QGestureManager::filterEventThroughContexts(), QPrintPreviewWidgetPrivate::populateScene(), QWaitConditionPrivate::post(), qDeleteAll(), qt_cleanup(), qt_delete_glyph_hash(), QFactoryLoader::refreshAll(), QDeclarativeWatcher::removeWatch(), QAccessibleHierarchyManager::reset(), QGraphicsAnchorLayoutPrivate::restoreVertices(), QDialogButtonBox::setStandardButtons(), QTextDocumentWithImageResources::setText(), QGraphicsAnchorLayoutPrivate::solvePreferred(), QDeclarativeParentAnimation::transition(), QSpanCollection::updateRemovedColumns(), QSpanCollection::updateRemovedRows(), QMYSQLResult::virtual_hook(), QWSDisplay::windowList(), QWSDisplay::Data::~Data(), FlatListModel::~FlatListModel(), QAxBasePrivate::~QAxBasePrivate(), QDBusConnectionPrivate::~QDBusConnectionPrivate(), QDeclarativeCompiledData::~QDeclarativeCompiledData(), QDeclarativeWorkerScriptEngine::~QDeclarativeWorkerScriptEngine(), QDirIteratorPrivateIteratorStack< QFileSystemIterator >::~QDirIteratorPrivateIteratorStack(), QDockWidgetLayout::~QDockWidgetLayout(), QEventDispatcherGlib::~QEventDispatcherGlib(), QEventDispatcherUNIXPrivate::~QEventDispatcherUNIXPrivate(), QFormLayout::~QFormLayout(), QGestureManager::~QGestureManager(), QGLEngineSharedShaders::~QGLEngineSharedShaders(), QGridLayoutEngine::~QGridLayoutEngine(), QItemEditorFactory::~QItemEditorFactory(), QNetworkAccessManager::~QNetworkAccessManager(), QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate(), QNetworkManagerEngine::~QNetworkManagerEngine(), QObjectPrivate::~QObjectPrivate(), QPdfBaseEnginePrivate::~QPdfBaseEnginePrivate(), QPreviewPaintEngine::~QPreviewPaintEngine(), QProcessManager::~QProcessManager(), QRegExpEngine::~QRegExpEngine(), QScriptDebuggerBackendPrivate::~QScriptDebuggerBackendPrivate(), QScriptDebuggerConsoleCommandManagerPrivate::~QScriptDebuggerConsoleCommandManagerPrivate(), QScriptDebuggerLocalsModelNode::~QScriptDebuggerLocalsModelNode(), QScriptDebuggerPrivate::~QScriptDebuggerPrivate(), QScriptDebuggerScriptsModelPrivate::~QScriptDebuggerScriptsModelPrivate(), QScriptEnginePrivate::~QScriptEnginePrivate(), QSortFilterProxyModel::~QSortFilterProxyModel(), QSpanCollection::~QSpanCollection(), QStackedLayout::~QStackedLayout(), QStandardItemModelPrivate::~QStandardItemModelPrivate(), QStateMachinePrivate::~QStateMachinePrivate(), QSvgStructureNode::~QSvgStructureNode(), QTextDocumentWithImageResources::~QTextDocumentWithImageResources(), QUndoCommand::~QUndoCommand(), QWaylandClipboard::~QWaylandClipboard(), QWidgetAction::~QWidgetAction(), QWindowsVistaStylePrivate::~QWindowsVistaStylePrivate(), QWSClient::~QWSClient(), QWSServerPrivate::~QWSServerPrivate(), QWSSoundServerPrivate::~QWSSoundServerPrivate(), and QXcbConnection::~QXcbConnection().

320 {
321  while (begin != end) {
322  delete *begin;
323  ++begin;
324  }
325 }
static const KeyPair *const end

◆ qDeleteAll() [2/2]

template<typename Container >
void qDeleteAll ( const Container &  c)
inline

Definition at line 328 of file qalgorithms.h.

329 {
330  qDeleteAll(c.begin(), c.end());
331 }
unsigned char c[8]
Definition: qnumeric_p.h:62
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319

◆ qEqual()

template<typename InputIterator1 , typename InputIterator2 >
bool qEqual ( InputIterator1  first1,
InputIterator1  last1,
InputIterator2  first2 
)
inline

Definition at line 95 of file qalgorithms.h.

96 {
97  for (; first1 != last1; ++first1, ++first2)
98  if (!(*first1 == *first2))
99  return false;
100  return true;
101 }

◆ qFill() [1/2]

template<typename ForwardIterator , typename T >
void qFill ( ForwardIterator  first,
ForwardIterator  last,
const T &  val 
)
inline

Definition at line 104 of file qalgorithms.h.

Referenced by qFill().

105 {
106  for (; first != last; ++first)
107  *first = val;
108 }

◆ qFill() [2/2]

template<typename Container , typename T >
void qFill ( Container &  container,
const T &  val 
)
inline

Definition at line 111 of file qalgorithms.h.

112 {
113  qFill(container.begin(), container.end(), val);
114 }
void qFill(ForwardIterator first, ForwardIterator last, const T &val)
Definition: qalgorithms.h:104

◆ qFind() [1/2]

template<typename InputIterator , typename T >
InputIterator qFind ( InputIterator  first,
InputIterator  last,
const T &  val 
)
inline

Definition at line 117 of file qalgorithms.h.

Referenced by qFind(), and QLinkedList< JSC::Identifier >::removeOne().

118 {
119  while (first != last && !(*first == val))
120  ++first;
121  return first;
122 }

◆ qFind() [2/2]

template<typename Container , typename T >
Container::const_iterator qFind ( const Container &  container,
const T &  val 
)
inline

Definition at line 125 of file qalgorithms.h.

126 {
127  return qFind(container.constBegin(), container.constEnd(), val);
128 }
InputIterator qFind(InputIterator first, InputIterator last, const T &val)
Definition: qalgorithms.h:117

◆ qGreater()

template<typename T >
LessThan qGreater ( )

Definition at line 151 of file qalgorithms.h.

152 {
153 }

◆ qLess()

template<typename T >
LessThan qLess ( )

Definition at line 146 of file qalgorithms.h.

Referenced by qGreater().

147 {
148 }

◆ qLowerBound() [1/3]

template<typename RandomAccessIterator , typename T >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound ( RandomAccessIterator  begin,
RandomAccessIterator  end,
const T &  value 
)

Definition at line 227 of file qalgorithms.h.

Referenced by QDBusConnectionPrivate::activateObject(), QDBusAdaptorConnector::addAdaptor(), QTextBlockGroup::blockInserted(), boundingRectOfFloatsInSelection(), QTextTable::cellAt(), QTextDocumentLayoutPrivate::drawFlow(), QTextDocumentLayoutPrivate::drawFrame(), QShortcutMap::find(), QNetworkAuthenticationCache::findClosestMatch(), findObject(), QTextTablePrivate::fragmentAdded(), QTextDocumentLayoutPrivate::frameIteratorForYPosition(), QShortcutMap::hasShortcutForKeySequence(), QTextDocumentLayoutPrivate::hitTest(), QTextDocumentLayoutPrivate::layoutFlow(), QDBusConnection::objectRegisteredAt(), qBinaryFind(), qDBusPropertyGet(), qDBusPropertyGetAll(), qDBusPropertySet(), QAlgorithmsPrivate::qMerge(), QVariantAnimationPrivate::recalculateCurrentInterval(), QDBusConnection::registerObject(), QVariantAnimationPrivate::setValueAt(), QListModel::sortedInsertionIterator(), QTreeModel::sortedInsertionIterator(), QTableModel::sortedInsertionIterator(), and QDBusConnection::unregisterObject().

228 {
229  // Implementation is duplicated from QAlgorithmsPrivate to keep existing code
230  // compiling. We have to allow using *begin and value with different types,
231  // and then implementing operator< for those types.
232  RandomAccessIterator middle;
233  int n = end - begin;
234  int half;
235 
236  while (n > 0) {
237  half = n >> 1;
238  middle = begin + half;
239  if (*middle < value) {
240  begin = middle + 1;
241  n -= half + 1;
242  } else {
243  n = half;
244  }
245  }
246  return begin;
247 }
static const KeyPair *const end

◆ qLowerBound() [2/3]

template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound ( RandomAccessIterator  begin,
RandomAccessIterator  end,
const T &  value,
LessThan  lessThan 
)

Definition at line 250 of file qalgorithms.h.

251 {
252  return QAlgorithmsPrivate::qLowerBoundHelper(begin, end, value, lessThan);
253 }
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
Definition: qalgorithms.h:469
static bool lessThan(const QChar *a, int l, const char *c)
Definition: qurl.cpp:3253
static const KeyPair *const end

◆ qLowerBound() [3/3]

template<typename Container , typename T >
Q_OUTOFLINE_TEMPLATE Container::const_iterator qLowerBound ( const Container &  container,
const T &  value 
)

Definition at line 256 of file qalgorithms.h.

257 {
258  return QAlgorithmsPrivate::qLowerBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
259 }
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
Definition: qalgorithms.h:469

◆ qSort() [1/3]

template<typename RandomAccessIterator >
void qSort ( RandomAccessIterator  start,
RandomAccessIterator  end 
)
inline

Definition at line 177 of file qalgorithms.h.

Referenced by QFileSystemModelPrivate::_q_directoryChanged(), QFileSystemModelPrivate::_q_fileSystemChanged(), QScriptDebuggerConsoleWidgetPrivate::_q_onCompletionTaskFinished(), QGraphicsSceneBspTreeIndexPrivate::_q_updateSortCache(), QButtonGroup::addButton(), QDeclarativeTimeLinePrivate::advance(), QScriptEngine::availableExtensions(), bindFont(), QDeclarativeCompiler::buildObject(), QTessellatorPrivate::cancelCoincidingEdges(), QGraphicsSceneBspTreeIndexPrivate::climbTree(), QTessellatorPrivate::collectAndSortVertices(), QTreeViewPrivate::columnRanges(), QPathClipper::doClip(), QListWidget::dropEvent(), QGraphicsItemPrivate::ensureSequentialSiblingIndex(), QGraphicsScenePrivate::ensureSequentialTopLevelSiblingIndexes(), QListModel::ensureSorted(), QGraphicsItemPrivate::ensureSortedChildren(), QGraphicsScenePrivate::ensureSortedTopLevelItems(), QStateMachinePrivate::enterStates(), QPatternist::NodeSortExpression::evaluateSequence(), QPatternist::OrderBy::evaluateSequence(), QStateMachinePrivate::exitStates(), QPatternist::TemplateMode::finalize(), findAllLibCrypto(), findAllLibSsl(), generateGlyphTables(), QGraphicsScenePrivate::gestureEventHandler(), QMdi::MinOverlapPlacer::getCandidatePlacements(), QPathClipper::handleCrossingEdges(), QmlJSDebugger::BoundingRectHighlighter::highlight(), QScriptEngine::importedExtensions(), QPictureIO::inputFormats(), QGraphicsItemAnimationPrivate::insertUniquePair(), QWingedEdge::intersectAndAdd(), QFontEngine::loadKerningPairs(), operator<<(), QFontDatabase::pointSizes(), QDBusAdaptorConnector::polish(), QDeclarativeBasePositioner::prePositioning(), QTessellatorPrivate::processIntersections(), qGeomCalc(), QTest::qMedian(), qScanConvert(), QtPrivate::QStringList_sort(), qtKey2CocoaKey(), QWindowsXPStyle::QWindowsXPStyle(), QSortFilterProxyModel::removeRows(), QDeclarativeImportsPrivate::resolvedUri(), QVariantAnimation::setKeyValues(), QFontDatabase::smoothSizes(), QStringListModel::sort(), QListModel::sort(), QDirPrivate::sortFileList(), QGraphicsSceneBspTreeIndexPrivate::sortItems(), splitPolygon(), QTextDocumentWriter::supportedDocumentFormats(), QImageWriter::supportedImageFormats(), QImageReader::supportedImageFormats(), QConfFileSettingsPrivate::writeIniFile(), and QFontDatabase::writingSystems().

178 {
179  if (start != end)
180  QAlgorithmsPrivate::qSortHelper(start, end, *start);
181 }
static const KeyPair *const end
Q_OUTOFLINE_TEMPLATE void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan)
Definition: qalgorithms.h:340

◆ qSort() [2/3]

template<typename RandomAccessIterator , typename LessThan >
void qSort ( RandomAccessIterator  start,
RandomAccessIterator  end,
LessThan  lessThan 
)
inline

Definition at line 184 of file qalgorithms.h.

185 {
186  if (start != end)
188 }
static bool lessThan(const QChar *a, int l, const char *c)
Definition: qurl.cpp:3253
static const KeyPair *const end
Q_OUTOFLINE_TEMPLATE void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan)
Definition: qalgorithms.h:340

◆ qSort() [3/3]

template<typename Container >
void qSort ( Container &  c)
inline

Definition at line 191 of file qalgorithms.h.

192 {
193 #ifdef Q_CC_BOR
194  // Work around Borland 5.5 optimizer bug
195  c.detach();
196 #endif
197  if (!c.empty())
198  QAlgorithmsPrivate::qSortHelper(c.begin(), c.end(), *c.begin());
199 }
unsigned char c[8]
Definition: qnumeric_p.h:62
Q_OUTOFLINE_TEMPLATE void qSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan)
Definition: qalgorithms.h:340

◆ qStableSort() [1/3]

template<typename RandomAccessIterator >
void qStableSort ( RandomAccessIterator  start,
RandomAccessIterator  end 
)
inline

◆ qStableSort() [2/3]

template<typename RandomAccessIterator , typename LessThan >
void qStableSort ( RandomAccessIterator  start,
RandomAccessIterator  end,
LessThan  lessThan 
)
inline

Definition at line 209 of file qalgorithms.h.

210 {
211  if (start != end)
213 }
Q_OUTOFLINE_TEMPLATE void qStableSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan)
Definition: qalgorithms.h:450
static bool lessThan(const QChar *a, int l, const char *c)
Definition: qurl.cpp:3253
static const KeyPair *const end

◆ qStableSort() [3/3]

template<typename Container >
void qStableSort ( Container &  c)
inline

Definition at line 216 of file qalgorithms.h.

217 {
218 #ifdef Q_CC_BOR
219  // Work around Borland 5.5 optimizer bug
220  c.detach();
221 #endif
222  if (!c.empty())
223  QAlgorithmsPrivate::qStableSortHelper(c.begin(), c.end(), *c.begin());
224 }
unsigned char c[8]
Definition: qnumeric_p.h:62
Q_OUTOFLINE_TEMPLATE void qStableSortHelper(RandomAccessIterator start, RandomAccessIterator end, const T &t, LessThan lessThan)
Definition: qalgorithms.h:450

◆ qUpperBound() [1/3]

template<typename RandomAccessIterator , typename T >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound ( RandomAccessIterator  begin,
RandomAccessIterator  end,
const T &  value 
)

Definition at line 262 of file qalgorithms.h.

Referenced by QPostEventList::addEvent(), QShortcutMap::addShortcut(), boundingRectOfFloatsInSelection(), QTextDocumentLayoutPrivate::drawFrame(), QThreadPoolPrivate::enqueueTask(), QAlgorithmsPrivate::qMerge(), QTextEngine::setBoundary(), and QTextTable::splitCell().

263 {
264  // Implementation is duplicated from QAlgorithmsPrivate.
265  RandomAccessIterator middle;
266  int n = end - begin;
267  int half;
268 
269  while (n > 0) {
270  half = n >> 1;
271  middle = begin + half;
272  if (value < *middle) {
273  n = half;
274  } else {
275  begin = middle + 1;
276  n -= half + 1;
277  }
278  }
279  return begin;
280 }
static const KeyPair *const end

◆ qUpperBound() [2/3]

template<typename RandomAccessIterator , typename T , typename LessThan >
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBound ( RandomAccessIterator  begin,
RandomAccessIterator  end,
const T &  value,
LessThan  lessThan 
)

Definition at line 283 of file qalgorithms.h.

284 {
285  return QAlgorithmsPrivate::qUpperBoundHelper(begin, end, value, lessThan);
286 }
static bool lessThan(const QChar *a, int l, const char *c)
Definition: qurl.cpp:3253
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
Definition: qalgorithms.h:490
static const KeyPair *const end

◆ qUpperBound() [3/3]

template<typename Container , typename T >
Q_OUTOFLINE_TEMPLATE Container::const_iterator qUpperBound ( const Container &  container,
const T &  value 
)

Definition at line 289 of file qalgorithms.h.

290 {
291  return QAlgorithmsPrivate::qUpperBoundHelper(container.constBegin(), container.constEnd(), value, qLess<T>());
292 }
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qUpperBoundHelper(RandomAccessIterator begin, RandomAccessIterator end, const T &value, LessThan lessThan)
Definition: qalgorithms.h:490