summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
Commit message (Collapse)AuthorAgeFilesLines
* Remove QBool and use bool instead.David Faure2012-01-207-48/+48
| | | | | | | | | | | | QBool was introduced with Qt-4.0, to detect Qt3-like code like if (c.contains(d) == 2) and break compilation on such constructs. This isn't necessary anymore, given that such code couldn't possibly compile in Qt4 times. And QBool was confusing developers, and creating compile errors (e.g. QVariant doesn't have support for it), so better remove it for Qt 5. Change-Id: I6642f43f5e12b872f98abb56600186179f072b09 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove Q_CC_MWERKS.Robin Burchell2012-01-191-7/+0
| | | | | | | | This is no longer supported. Change-Id: I3914f5007595fd699fa1e9a565a0a3f59a0e135e Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Remove Q_CC_NOKIAX86.Robin Burchell2012-01-192-15/+1
| | | | | | | | This is no longer supported. Change-Id: Ic393bc48c4c842514da69b6696cfb62b54360070 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
* Add a constructor that explicitly takes a size to QLatin1StringLars Knoll2012-01-182-0/+14
| | | | | | | | | | This is useful in a couple of situations where the size is known at runtime and one wants to avoid a call to strlen. Change-Id: Ic20587b0d365a4573d4636c5853c206b571b8d6b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Remove unused variableLars Knoll2012-01-161-2/+1
| | | | | | Change-Id: Ib8725e89e40d6e12172b1da687da2e4d559444f3 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Fix ###'es in qrect.hLars Knoll2012-01-161-37/+14
| | | | | | Change-Id: Id9635b6faeaf12ba2f7a0f70055b0df01cd16587 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Fix ### comments in QSetLars Knoll2012-01-161-14/+2
| | | | | | Change-Id: I302be7dc4cd7a9c2b9e35e8142ca100d6f86da7c Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Improve the documentation of QStringLiteralOlivier Goffart2012-01-161-3/+27
| | | | | | Change-Id: I4bbe18ecc342f034fbc8e9fd14b700ee5272076f Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Build fix for WINCE to qlocale_tools.cppJanne Anttila2012-01-131-0/+4
| | | | | | | Task-number: QTBUG-22500 Change-Id: If530799cf8ef971f5caf78d0c6dbeeda719d148f Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Update year in Nokia copyright headers.Jason McDonald2012-01-106-6/+6
| | | | | | | | The previous change missed some headers from years prior to 2011, and a few new files were merged after the previous change. Change-Id: Ib7d1a2b7062228c2a5373da64242b2ee1f0981e1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Implement QDebug stream operators for builtin classesJędrzej Nowacki2012-01-106-0/+50
| | | | | | | | | | | QDebug stream operator was added for: QPixmap, QImage, QUuid, QBitArray, QLocale, QRegExp, QCursor, QPalette, QTextFormat, QTextLength, QIcon and QSizePolicy Change-Id: Ibcf5c9b599ba322d53cb106d8e5e157427ebe757 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
* Clean-up the interface for QDate.Xizhi Zhu2012-01-092-94/+4
| | | | | | | | | | | | | | | | Four overload functions removed while keeping source compatibility: - shortMonthName() - shortDayName() - longMonthName() - longDayName() Two functions removed since they have confusing names: - gregorianToJulian() - julianToGregorian() Change-Id: Iaaea066a3fb77b1ee3499d3049fcec5563054cdf Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: John Layt <jlayt@kde.org>
* Remove the Q_TYPENAME define.Stephen Kelly2012-01-081-2/+2
| | | | | | | | | | | | | It is mostly not used (most places in Qt use typename directly), so is already not very useful. For example typename is used in: QDataStream& operator<<(QDataStream& s, const QVector<T>& v) Change-Id: I85337ad7d8d4ebbb424bfa2ab9a356456ff3e90f Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Move keyboard locale and input direction to QInputPanelPekka Vuorela2012-01-071-2/+2
| | | | | | | | | | Deprecated QGuiApplication::keyboardInputLocale() and keyboardInputDirection(), introduced QInputPanel::locale() and inputDirection(). Change-Id: Ic48c77f10821a949751c73c73f22bd78e2192b9c Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove all non-inline of qMalloc/qFree/qRealloc.Robin Burchell2012-01-066-42/+46
| | | | | | | | | | | | 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-05106-106/+106
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Deinlined QLocale::operator==Denis Dzyubenko2012-01-042-6/+12
| | | | | | | | | Some time ago this was a blocker that didn't allow to refactor QLocale implementation due without making binary incompatible changes. Deinlining those functions for Qt5, it shouldn't be performance critical code path. Change-Id: I6cb19e32188a2df223d04be0c613a6176ad8d118 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Implement (and unit test) simple QVarLengthArray::first()/last().Robin Burchell2012-01-022-0/+34
| | | | | | | | | Pure syntactical sugar, to match up with what the other container classes offer. Change-Id: I0f97de011923d9d204cca0fa906b059dc5054a89 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QCryptographicHash: allow to hash the content of a QIODeviceSune Vuorela2011-12-222-0/+25
| | | | | | | | | | | This adds a new function (and tests) to give the possibility of doing a QCryptographicHash of a QIODevice, like a QFile or whatever people needs. It is a quite handy overload in many cases. Change-Id: I22fd272f05571844641b3daefcc6746be4e5c7c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QT_NO_STL_WCHAR hackHarald Fernengel2011-12-221-18/+3
| | | | | | | We don't support gcc 2.95 any more. Change-Id: I842f1f8ac64b9006516c104add0991830ac9a46a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use strlen() inline whenever possibleHarald Fernengel2011-12-222-48/+55
| | | | | | | This allows us to benefit from compile-time optimization Change-Id: I63dfde3758fcb0ff919fdc0418df1b7586da0b2f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* make QString::fromLatin1 partially inlineHarald Fernengel2011-12-202-6/+6
| | | | | | | | This allows us to benefit from compile time optimizations when calling strlen() Change-Id: If6694117e613a012fce97f8664e6b43005d255de Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QVarLengthArray::length().Robin Burchell2011-12-122-0/+8
| | | | | | | | | | | This also adds a unit test for length()/count()/size(), since there wasn't one testing it explicitly. Change-Id: Ifb7f113aa97beef5f76e5fb246eb38495344b0ad Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Marco Schmidt <Marco.Schmidt@Taugamma.de> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove unused QMapData::createData()/node_create() overloads.Robin Burchell2011-12-082-12/+0
| | | | | | | Change-Id: I79010e1ecfdfe579d996db65681ab1559598f3ce Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QByteArray: Fix MSVC warning.Friedemann Kleint2011-11-291-2/+2
| | | | | | | | Warning C4308: negative integral constant converted to unsigned type. Change-Id: Ibdb14ad2ceebd56715fda861151e92f6dc10f955 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Give better error message when using unsupported lookbehinds in QRegExpKjell Rune Skaaraas2011-11-181-0/+4
| | | | | | | Merge-request: 1456 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> (cherry picked from commit e0383c9b8bd6f4e3d445d69690f84209cad42bb5) Change-Id: Ie0383c9b8bd6f4e3d445d69690f84209cad42bb5
* adding a getter cubicBezierSpline() to QEasingCurveThomas Hartmann2011-11-182-0/+13
| | | | | Change-Id: Ida722f013613d8633867a902660da30d28aeb918 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Windows: Adapt mkspec for MinGW / gcc 4.6.Friedemann Kleint2011-11-181-0/+7
| | | | | | | | | | | gcc 4.6 becomes the minimum required version in Qt 5. See also d4150975af620e2889cc58bd476bac6b4d101db3 in Qt 4.8. Change-Id: If66ce0be755263c20b0a4371523c6590592d962d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Fix tst_Moc::oldStyleCastsOlivier Goffart2011-11-171-2/+2
| | | | | | | | | This tests that the moc generated file produces no warnings with very pedentic compilation flags. In that case, there was a warning because of the use of the C casts Change-Id: Ie79c6d053ff35c55276a07212c5d60f759f693ee Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* avoid type aliasingThomas Hartmann2011-11-111-9/+30
| | | | | | | | | | | | | | | | | For -O2 gcc activates -fstrict-aliasing. As a result the compiler is allowed to assume that pt[1]=px[1]/3+B1 does not affect t. Therefore the result of _fast_cbrt() was always 0. Using a union for casting avoids this issue. For more details see: http://labs.qt.nokia.com/2011/06/10/type-punning-and-strict-aliasing Also the updated code respect endianness. Change-Id: Id4bed16efac52e494e7357dc2f23f94e8c525df1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "Use standard spelling for two languages"Lars Knoll2011-11-042-49/+49
| | | | | | | | | | | This reverts commit 9358f7eaa4b773bdbfa45b08ab92a89096954881. The change is source incompatible and hasn't been agreed upon. Revert it even though it's correct in principle. It's simple to keep the old enums around for compatibility. Change-Id: I8d9d33868e44d0299a3f081833b06cedf0ed4345 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use standard spelling for two languagesJiang Jiang2011-11-042-49/+49
| | | | | | | | Singhalese -> Sinhalese Divehi -> Dhivehi Change-Id: I3faa7163202a4a9be14e3cf857da60aa4dd3196f Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Adding custom bezier easing curves to QEasingCurveThomas Hartmann2011-11-022-6/+541
| | | | | | | | | | | | | | | | | | | | | | | | | I added the possibilty to define Bezier/TCB splines and use them as custom easing curves. Note: Splines have a parametric definition. This means we have a function/polynom of t that evalutes to x and y. x/y = f(t). For our purpose we actually need the function y = f(x). So as a first step we have to solve the solution x = f(t) for a given t and then in a second step we evaluate y = f(t). f(t) is a cubic polynom so we use cardanos formula to solve this equation directly. For the casus irreducibilis we need 3 functions that are a combination of arcos and cos. Instead of evaluating arcos and cos we approximate these functions directly. TCB splines are converted into the corresponding cubic bezier spline. Change-Id: Id2afc15efac92e494d6358dc2e11f94e8c524da1 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Replace implicit QAtomic* casts with explicit load()/store()Bradley T. Hughes2011-10-272-6/+7
| | | | | Change-Id: Ia7ef1a8e01001f203e409c710c977d6f4686342e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QDataStream operators to QMargins, so it can be streamedSteven Ceuppens2011-10-272-0/+49
| | | | | | | | | | * QDataStream format documented * Added Unit test for QDataStream operators * Updated Unit test Change-Id: Idbcfcb0b927e6369e8d31b57693c7aa0d1a154e7 Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* replace 'const QChar &' with 'QChar ' for QChar and QStringRitt Konstantin2011-10-265-50/+50
| | | | | | | | Merge-request: 69 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Change-Id: I61f5a54b783252029fcad95677958fa6a2130d01 Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Revert "Use memmove in QListData::append(int) as regions overlap."Oswald Buddenhagen2011-10-261-1/+1
| | | | | | | | | | We have proven that the regions cannot overlap. The root problem must be somewhere else. This reverts commit d96b7b809e614dd416709acec768529457120b9f. Change-Id: I3446487f2a1a5bd322379b8adb788c26ff3e08e2 Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* Silence warning from clangBradley T. Hughes2011-10-251-2/+2
| | | | | | | | | | | | | | | ../../corelib/tools/qlocale_mac.mm:78:13: warning: '&&' within '||' [-Wlogical-op-parentheses] ...&& !qt_splitLocaleName(QString::fromLocal8Bit(result), lang, script, cntry)... ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../corelib/tools/qlocale_mac.mm:78:13: note: place parentheses around the '&&' expression to silence this warning && !qt_splitLocaleName(QString::fromLocal8Bit(result), ... ^ Change-Id: I64f745e7dfa64f28f264667372ed64f9e34ca3b7 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira (Intel) <thiago.macieira@intel.com>
* corelib: Remove Q_WS-macros.Friedemann Kleint2011-10-243-5/+2
| | | | | | | | | | | | | | | | | | | | Q_WS_QPA is the only active code path after merging refactor, other Q_WS-macros are no longer used. Enable compilation without -qpa. - Remove Q_OS_MSDOS, Q_OS_OS2 - Remove Q_WS_QWS - Remove/replace definitions/conditionals of Q_WS_XX - Remove qpa branches from profiles - Replace Q_WS_MAC by Q_OS_MAC - Replace Q_WS_MAC && !Q_WS_QPA by Q_OS_MAC && !QT_NO_CORESERVICES - Similarly in profiles: mac:contains(QT_CONFIG, coreservices) - Replace Q_FS_FAT by Q_OS_WIN Change-Id: Icce5a6c55b052c8f72b3b979ddf31a4f388ea9c9 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Add Q_DECL_CONSTEXPR to a QChar, QLatin1Char and QLatin1String constructorsThiago Macieira2011-10-222-26/+19
| | | | | | | | These types now technically are trivially-constructible and standard-layout in C++0x. Change-Id: I455bd905fd6e237a1dff517b86dcbe59d571266f Reviewed-by: Olivier Goffart <ogoffart@kde.org>
* Fix "may be used uninitialized" compiler warning.Morten Sorvig2011-10-191-1/+1
| | | | | Change-Id: I96e9dbf0f3df527785e03661b9c25bd2d214cd44 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* make fromWCharArray() and toWCharArray() inlinedKonstantin Ritt2011-10-182-27/+25
| | | | | | | | | because we may have the size of wchar_t varying, we need to know which is the correct encoding: UTF-16 or UCS-4 Merge-request: 49 Change-Id: Ib5a1e7dea51d0cd8394e686634a36aae984fa072 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove stale documentation.Casper van Donderen2011-10-183-29/+0
| | | | | Change-Id: I85139e0334b648bee0d18129cef9387dcc6c3222 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Remove stale documentation and fix qdoc errors.Casper van Donderen2011-10-111-6/+0
| | | | | | | Change-Id: I51bb0c52eb32d9d672d115f31b16d414f81708e2 Reviewed-on: http://codereview.qt-project.org/6433 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* fix QChar::isSpace() to handle codepoint U+0085Konstantin Ritt2011-10-062-2/+4
| | | | | | | | | | | according to the Unicode specs, code point U+0085 should be treated like a white space character (an exceptional Cc one) Change-Id: Ib17ae0c4d3cdafe667cafa38b645138ef24c238c Merge-request: 32 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> Reviewed-on: http://codereview.qt-project.org/6158 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Don't use implicit QAtomic* casts in QFreeListBradley T. Hughes2011-10-051-9/+9
| | | | | | | | | | | | | | | Pair the _next.testAndSetRelease() call in QFreeList<T>::release() with _next.loadAcquire(), to ensure that the update to the bucket being released is properly fenced. QFreeList<T>:next() does not need a release fence, only an acquire fence, which is placed on the memory bucket address load. Change-Id: Ib5b9d6ef6107f87aa8e3ea2dd3a7f9116c75da70 Reviewed-by: Thiago Macieira Reviewed-on: http://codereview.qt-project.org/5802 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Don't crash by modifying read-only shared_nullBradley T. Hughes2011-10-045-6/+6
| | | | | | | | | | | | | | | | | | | Functions that modify the d-pointer must detach or otherwise take measures to not modify the const, read-only shared_null. The setSharable(bool) function takes care to detach when setting sharable to false, but should avoid setting the sharable data member unless d is not the shared null. Similarly, QMap<Key, T>::setInsertInOrder() needs to detach if it is shared with the shared_null (the logic has been updated to be the same as setSharable()). Change-Id: Ida5cb9818b86695f1b9f0264418b955c56424898 Reviewed-on: http://codereview.qt-project.org/5929 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Prevent QPixmapCache potentially growing indefinitely.Samuel Rødal2011-10-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPixmapCache has until now refused to throw out shared pixmaps, i.e. ones that still have shallow copies lying around. This leads to problems when someone inserts two shallow copies using different keys, causing the cache itself containing multiple shallow copies and thus forever refusing to throw out those entries. It's rather easy for this to accidentally happen in a user application since QPixmap::load() or QPixmap(const QString &fileName, ...) automatically cache the pixmap in the QPixmapCache, thus if the user then calls QPixmapCache::insert() on the same pixmap or a shallow copy it is locked in the QPixmapCache forever. The only reason for not throwing out a pixmap that's shared would be to prevent re-loading a pixmap from file when a user has a direct reference to it in his application, but in that case the user is unlikely to re-load the pixmap from file in any case. Therefore it seems the best fix is to get rid of this limitation. Task-number: QTBUG-21359 Reviewed-by: John Brooks Reviewed-by: Olivier Goffart (cherry picked from commit 7ab0bed3a56d46c386e65abc381264c57137cb43) Change-Id: I46dce19227e19a25e0287cf7372177430da15a66 Reviewed-on: http://codereview.qt-project.org/4563 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* Make all uses of QBasicAtomicInt and Pointer use load() and store()Thiago Macieira2011-10-036-31/+33
| | | | | | | | | | | | | | Most of these changes are search-and-replace of d->ref ==, d->ref != and d->ref =. The QBasicAtomicPointer in QObjectPrivate::Connection didn't need to be basic, so I made it QAtomicPointer. Change-Id: Ie3271abd1728af599f9ab17c6f4868e475f17bb6 Reviewed-on: http://codereview.qt-project.org/5030 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Rename Qt::escape to QString::toHtmlEscaped, add compat methodDavid Faure2011-09-292-14/+24
| | | | | | | | | Merge-request: 56 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Change-Id: I46bbb2df10968e88b5eb5ef8dae182a651b622b8 Reviewed-on: http://codereview.qt-project.org/5793 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>