summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qvector.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'dev' into stableOswald Buddenhagen2013-03-201-3/+45
|\ | | | | | | | | | | | | | | | | | | | | | | This starts Qt 5.1 release cycle Conflicts: src/gui/text/qfontdatabase.cpp src/gui/text/qharfbuzz_copy_p.h src/widgets/kernel/qapplication.cpp src/widgets/kernel/qcoreapplication.cpp Change-Id: I72fbf83ab3c2206aeea1b089428b0fc2a89bd62b
| * Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| * QVector - add functions takeFirst and takeLastThorbjørn Martsum2013-03-071-2/+24
| | | | | | | | | | | | | | | | This patch adds takeFirst and takeLast which are functions that QList also has. Change-Id: I761f90b529774edc8fa96e07c6fcf76226123b20 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QVector - add remove functionsThorbjørn Martsum2013-03-071-2/+22
| | | | | | | | | | | | | | | | | | | | | | This patch adds the functions removeFirst() and removeLast(). Functions that QList has. Beside making these functions, pop_back and pop_front are redirected to these rather than calling erase. Change-Id: Ifc5f8a78e33f436f06f21095a920ec5d4311fd6f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Update the documentation for C++11 initializer lists supportLaszlo Papp2013-03-071-1/+2
|/ | | | | | | | The documentation was written for 4.8 when the C++11 standard did not have the name yet. Change-Id: I08640a5ae62385b09e181eefafd4cc831e4de456 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QtBase: Doc: Fix links to STL-style iteratorsDavid Schulz2012-12-061-6/+6
| | | | | Change-Id: I2822c2a7e9bfc1949c20ff81e08961f641e961fb Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-231-0/+1
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Remove unneeded #includes and namespace wrappersJoão Abecasis2012-06-141-10/+0
| | | | | | | | qvector.cpp no longer contains any code, now that inline functionality has been deferred to QArrayData. Change-Id: I000ef8507e5b8438edd32a762750e4ceaa8aa8ee Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Implement QVector with QArrayData interface.Jędrzej Nowacki2012-05-301-34/+0
| | | | | Change-Id: I109f46892aed2f6024459812d24922b12358814d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtCore: remove \link usagesGiuseppe D'Angelo2012-05-291-2/+2
| | | | | Change-Id: I0de764b51a972de0b6eb2bf3c04d2b190f581f52 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Prepare for building modular QtCore docs.Casper van Donderen2012-04-191-18/+18
| | | | | | | | | | | | This change fixes most qdoc errors in QtCore. There are about 900 left. The main thing this change does is moving documentation from qtcore from /doc/src to /src/corelib/doc. Other issues resolved are mis-use of qdoc commands. Change-Id: I002d01edfb13575e8bf27ce91596a577a92562d1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Merge master into api_changesKent Hansen2012-03-191-0/+18
|\ | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvector.h tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp Change-Id: I877256e95f3788e617437f4e9661a88047f38cd6
| * containers: add C++11-style c{begin,end}() as alias for const{Begin,End}()Marc Mutz2012-03-171-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++11 adds cbegin()/cend() functions for the same reason Qt has constBegin()/constEnd(). This patch adds these functions to the Qt containers with the same implementation as constBegin()/constEnd(). It also fixes the return types in the documentation of existing constFind() functions (documentation only). C++11 only adds cbegin()/cend() (and crbegin()/crend(), which Qt doesn't have). In particular, it doesn't add cfind(), so I didn't supply these, even though Qt comes with constFind(). This is a forward-port of https://qt.gitorious.org/qt/qt/merge_requests/1365. Change-Id: Ida086b64246b24e25254eafbcb06c8e33388502b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/api_changes' into containtersJoão Abecasis2012-03-081-4/+4
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qmetaobject.cpp src/corelib/kernel/qvariant.cpp src/tools/moc/moc.h Change-Id: I2cd3d95b41d2636738c6b98064864941e3b0b4e6
| * Remove the usage of deprecated qdoc macros.Casper van Donderen2012-03-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | QDoc now has support for Doxygen style commands for italics, bold and list items. This change applies that change in QDoc to the actual documentation. Task-number: QTBUG-24578 Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5 Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Have QVectorData::grow, take size of header w/ paddingJoão Abecasis2012-02-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes padding necessary to align the data array, but excludes the first element as was done before. Size of header is the interesting piece of information, anyway. This simplifies calculations in a couple of places, harmonizes code with the QRawVector fork and paves the way for further changes in QVector, namely the memory layout. When Q_ALIGNOF is not available, default to pointer-size alignment. This should be honoured by malloc and won't trigger use of more expensive aligned allocation. Change-Id: I504022ac7595f69089cafd96e47a91b874d5771e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QVector: always grow exponentiallyJoão Abecasis2012-02-171-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For non-movable types (QTypeInfo<T>::isStatic), QVector would grow the array linearly, and defer to qAllocMore otherwise. That property, however, gives no indication as to how the vector will grow. By forcing additional allocations for growing containers of such types, this penalized exactly those objects which are more expensive to move. We now let qAllocMore reign in growth decisions. Change-Id: I843a89dcdc21d09868c6b62a846a7e1e4548e399 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Merge remote-tracking branch 'gerrit/master' into containersJoão Abecasis2012-02-051-2/+2
|\| | | | | | | | | | | | | Conflicts: src/corelib/tools/qstring.cpp Change-Id: I23d214bf33c2badfae1876da3cc7d6d8f6e635fb
| * Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | Remove obsolete functionJoão Abecasis2012-01-191-8/+0
| | | | | | | | | | | | | | | | | | | | QVectorData::allocate is able to handle higher alignment that QVectorData::malloc didn't. This was kept for BC issues in the 4.x series, we can drop it now. Change-Id: I7782bd2910de6b9c8dee3e63e621629dc3889d33 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* | Merge remote-tracking branch 'gerrit/master' into containersJoão Abecasis2012-01-161-5/+7
|\| | | | | | | Change-Id: I2d358b912f1055ee6021d13de2f66fd459aaa355
| * Remove all non-inline of qMalloc/qFree/qRealloc.Robin Burchell2012-01-061-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | We're trying to deprecate these, so don't use them anymore. The inline uses of these have been left intact, for the moment. Inline code will need to create their own non-inline allocation methods (for future-proofing to allow alterations in how e.g. individual containers allocate) Change-Id: I1071a487c25e95b7bb81a3327b20c5481fb5ed22 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
| * Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | | | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* | Use RefCount::setSharable feature in QVectorJoão Abecasis2012-01-101-1/+1
| | | | | | | | | | | | | | Note: This constitutes a break in Binary Compatibility. Change-Id: I050587901725b701f20dd46475ae48aec28aa54d Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* | Retire the generic Q_REFCOUNT_INITIALIZER macroJoão Abecasis2012-01-041-1/+1
|/ | | | | | | | | | | | | This was only being used to initialize static read-only RefCount instances, where the value is hard-wired to -1. Instead of allowing initialization with arbitrary values (which for a reference count can be error prone) the intent of the macro is made explicit with its replacement Q_REFCOUNT_INITIALIZE_STATIC. Change-Id: I5b0f3f1eb58c3d010e49e9259ff4d06cbab2fd35 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make QVectorData::shared_null constBradley T. Hughes2011-09-261-1/+1
| | | | | | | | | | | | | Similar to QByteArray and QString, keep the shared_null in shareable memory and never modify it. Since QRegion uses the internals of QVector, we need to make sure that QRegion also never modifies the shared_null. Change-Id: I809e5873fe414138f97d501e05458b73c04b18fb Reviewed-on: http://codereview.qt-project.org/4529 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Doc: Applied pending fixes to API documentation.David Boddie2011-05-231-1/+1
|
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+1017
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12