summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-23142-11/+235
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Fix snippet and example referencing widget examplesAndy Nichols2012-08-236-12/+12
| | | | | | | | Widget examples were moved into a widgets subfolder, but qdoc references were not updated. Change-Id: Id2a4573e723745b9827c664c852807d6116f8f6d Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* ICU: Fix crash in codecForMib(2107)Kai Koehne2012-08-231-0/+4
| | | | | | | | | | | | availableMibs() unconditionally adds 2107 to the list of mibs. The patch ensures that codecForMib() also knows about this special TSCII codec. (Note that the autotest only really checks this code path if only this test case is run. The other tests already fill the internal codec cache otherwise). Change-Id: Id987d7cecd5f5700cca75e9b85b37011f8e5c622 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* A few more random documentation fixesShawn Rutledge2012-08-232-5/+16
| | | | | | | @p replaced by \a, \QD replaced by {Qt Designer}, couple of enums etc. Change-Id: I315510690bf52e42db519292b4122fa24c73bbc9 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* De-inline QVariant(float)Harald Fernengel2012-08-232-1/+4
| | | | | | | | | All QVariant constructors are not inline, so change QVariant(float) as well. This allows for refactoring of QVariant during lifetime of Qt 5 without breaking QVariant(float) case. Change-Id: Icd1fc331a1ef8a2872be811aa7d1160406038f06 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Move Qt::CursorMoveStyle docs to the right file.Frederik Gladhorn2012-08-231-0/+15
| | | | | | Change-Id: I26cc7336b33495a2649285cfeddeadec62e94d83 Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com> Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Logging: make qEmergencyOut() not allocate from the heapMarc Mutz2012-08-231-11/+38
| | | | | | | | | | | | | | | | | | | | | Commit 6e6b74c0 introduced heap allocation in the form of QString::fromLatin1().utf16() into qEmergencyOut(), a function that's called in OOM situations and in cases where another exception is still in flight. Luckily, QString::fromLatin1().utf16() is just a funny way of copying an array of chars into an array of wchar_ts, so we do that manually now and use a static wchar_t buffer. While at it, also throw text elision into the mix. This commit also fixes the message passed to _CrtDbgReportW(). What should be displayed is the emergency_buf, not the format string. Also remove a similar allocation in qt_message_output(). Change-Id: I2c44a298fc0927bb992de4977a7e4a7b47b16b26 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Simple optimisation in toLocal8Bit(): call codecForLocale once onlyThiago Macieira2012-08-231-6/+9
| | | | | | | | | The function is only slow the first time we call it, but there's no reason we can't do this simple optimisation anyway. Change-Id: Icacbbeb340838b32f5278b76d1860ad22dc9f7b7 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Optimize QAbstractItemModel::sibling a bit.Stephen Kelly2012-08-221-1/+1
| | | | | | | | QModelIndex::sibling has a simliar optimization. Change-Id: Ic0717d480ba0d46a4c0c88064bc9eda4c4ffe6f6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Doc: Fix snippet bug in State Machine overview.Geir Vattekar2012-08-221-0/+1
| | | | | | Task-number: QTBUG-24719 Change-Id: Ia0c802f275eaf009e42ffef4cc538f3b3d7561d0 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Do not consider sign in qIsNull.Mitch Curtis2012-08-221-4/+4
| | | | | | | | | | | | | | | The current implementation of qIsNull only returns true if the value is positive zero. This behaviour is not useful for use cases like QPointF::isNull, where QPointF(-0, -0).isNull() will return false. There doesn't seem to be a reason why the function exhibits this behaviour (-0.0 is not accounted for in the unit tests), and for the case of QSizeF::scale it causes a bug: qIsNull is used to check for division by 0.0 before it proceeds, which fails in the case of -0.0. Task-number: QTBUG-7303 Change-Id: I767e5280bd26614e8e78ae62b274eb9bc4ade385 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Try to work around GCC 4.6's noexcept bugs, againThiago Macieira2012-08-211-6/+3
| | | | | | | | | | | | | | | | Commit 7315296e9c94c38c842728aed199ac286a3ef174 blacklisted GCC 4.6.0 and 4.6.1 on the grounds that the bug regarding noexcept was fixed in 4.6.2. However, we have evidence of the issue remaining in 4.6.3, so it looks like it was not the issue that the GCC team fixed. For that reason, declare noexcept support in GCC 4.6 fatally broken and enable it only for 4.7. It has been working fine for a month for me on 4.7.1. Change-Id: Ic5a542235867f20657db12e0e809b83522dc7d23 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Disregard milliseconds in QTime::secsTo().Mitch Curtis2012-08-211-1/+4
| | | | | | | | | | | | | | | | "The documentation states that "secsTo() does not take into account any milliseconds", however, this is not the case. Given times 12:30:01.500 and 12:30:02.400 secsTo returns 0. If milliseconds are not taken into account, I would expect this to return 1 (i.e. interprets the times as 12:30:01 and 12:30:02 thus truncating the milliseconds)." Note that tests were also written for QDateTime::secsTo(), as it uses QTime::secsTo internally. This addresses Javier's issue in the comments of QTBUG-9304. Task-number: QTBUG-9304 Change-Id: I9efe0c8f710db859c1d086d67ba3e5b349a56c4e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Serialise QDateTime as UTC and timeSpec() instead of private spec.Mitch Curtis2012-08-211-6/+27
| | | | | | | | | | | | | | | | | | | | | | | QDateTime currently serialises its private Spec enum. If a user was to deserialise the individual components of a QDateTime separately, the resulting timeSpec may be invalid when cast to the Qt::TimeSpec enum. E.g.: QDateTime dateTime(QDate(2012, 8, 14), QTime(8, 0, 0), Qt::UTC); // ... serialise // ... deserialise date, time, spec separately. // spec == 2, the value of QDateTimePrivate::UTC. // spec != UTC, will be set to LocalUnknown. QDateTime deserialised(date, time, spec); This patch serialises QDateTime objects in UTC and the value of timeSpec() as opposed to QDateTimePrivate's spec. This changes the serialisation behaviour of QDateTime for version 13 of QDataStream. Task-number: QTBUG-4057 Change-Id: If650e7960dca7b6ab44b8233410a6369c41df73a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* doc: Added \relates command to some function qdoc commentsMartin Smith2012-08-213-1/+12
| | | | | | | | | | | | | When a documented function is global, it must be related to a namespace or class, or its documentation won't be included anywhere. When a documented function is a class member, the function signature in the \fn command must include the class name qualifier, e.g. QImage::isValid(), not just isValid() Change-Id: I53e2230fa9468f94d51aec8cc76781d7ab755a13 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Fix decoding of QByteArray in the deprecated "encoded" setters in QUrlThiago Macieira2012-08-205-14/+78
| | | | | | | | | | | | | | The asymmetry is intentional: the getters can use toLatin1() because the called functions, with a QUrl::FullyEncoded parameter, return ASCII only. This gives a small performance improvement over the need to run the UTF-8 encoder. However, the data passed to setters could contain non-ASCII binary data, in addition to the percent-encoded data. We can't use fromUtf8 because it's binary and we can't use toPercentEncoded because it already encoded. Change-Id: I5ecdb49be5af51ac86fd9764eb3a6aa96385f512 Reviewed-by: David Faure <faure@kde.org>
* tst_qurlinternal: use qurl_p.h instead of declaring the functionsThiago Macieira2012-08-201-1/+1
| | | | | | | | Just in case someone (like me) changes the function signatures or adds new functions. Change-Id: I1025fea012d95ffe89acaf799aa58fd2b0babc80 Reviewed-by: David Faure <faure@kde.org>
* Add Q_DECL_NOTHROW to some qHash functionsThiago Macieira2012-08-209-38/+43
| | | | | | | | | | | | The hashing functions for QDateTime and QHostAddress did not get the noexcept keyword because they might allocate memory. QDateTime doesn't do it now, but it could in the future. QHostAddress does allocate memory today. Change-Id: Ia5f80942944bfc2b8c405306c467bfd88ef0e48c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix the doc errors in itemmodels and itemviews.Stephen Kelly2012-08-203-3/+51
| | | | | | | | | Other errors remain, but they appear to be due to missing links to QtCore documentation (a generic error not specific to itemviews). Change-Id: I7b83380c3754c26d3d42be9ef0c0721ce3127562 Reviewed-by: Shawn Rutledge <shawn.rutledge@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove QProxyModel from qtbase.Stephen Kelly2012-08-201-1/+0
| | | | | | | A copy is placed in uihelpers for anyone who might be using it. Change-Id: I175f7bc5dcbf25a910d28bfd8985579866392938 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Disable C++11 noexcept support in GCC 4.6.0 and 4.6.1Thiago Macieira2012-08-201-0/+5
| | | | | | | | See report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50309 Change-Id: I5ab3ab1dea42b03ea22dbfbe5f7039c537dabd33 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QAtomic: make ctors constexpr, if possibleMarc Mutz2012-08-201-0/+12
| | | | | | | | | | | | This requires using the same chain of conditions that QBasicAtomic* uses in order to provide constructors, so we're using the newly-added macro QT_BASIC_ATOMIC_HAS_CONSTRUCTORS to check. Even though QAtomic<> is a template, we can't just use Q_DECL_CONSTEXPR since the body of the constructors needs to change, too. Change-Id: I462a80ed175040f7709c30d07d34036c6c5507d8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QBasicAtomic: add QT_BASIC_ATOMIC_HAS_CONSTRUCTORS macroMarc Mutz2012-08-201-2/+6
| | | | | | | | | | This macro is defined when the QBasicAtomic* types have constructors. It will be used to simplify maintenance of QBasicAtomic subclasses, as well as classes that aggregate Q(Basic)Atomics and wish to be literal types if possible. Change-Id: I7ab181c58a13ec2195449bbae5b3476b9017a8f2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix processor detection for MSVC ARM compiler (WEC7).Janne Anttila2012-08-201-4/+7
| | | | | | | | | | | | | Visual Studio compiler defines _M_ARM preprocessor variable when compiling for ARM and the value of preprocessor variable indicates the supported instruction set. For more information see: http://msdn.microsoft.com/en-us/library/gg155713.aspx Change-Id: I54137257b83f64fdf03bf7df9995e08d16dff4df Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Misc documentation fixes triggered by qdoc errors/warningsShawn Rutledge2012-08-202-8/+7
| | | | | Change-Id: I6ca3b138114fe957a09e8ec2f22273865635fc8b Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Speed up sorting of dir entries when sorted by dateRobin Burchell2012-08-201-2/+13
| | | | | | | | | | | | | | | | | | | | | | QDateTime will attempt to convert unknown types of date to UTC time, which isn't exactly a fast process. As we don't care about local timezones in the process of sorting (as this is purely for ordering, not display to the end user), we can force the dates to use UTC time, avoiding the unnecessary local timezone lookup. This also adds a benchmark covering this case. Benchmark results, Qt 5: - before: 11, 489ms - after: 273ms Qt 4.8: - before: 20, 848ms - after: 278ms Change-Id: I87fa6260e820b5b172d3306ff395dafe767c33ff Reported-by: Thomas Perl <m@thp.io> Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Work on QVariant's equality operator.Geir Vattekar2012-08-201-2/+13
| | | | | | Task-number: QTBUG-26018 Change-Id: I6627456d166bc0a036cadeee7bd51aa8e576a818 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Fix documented QMetaType::UserType value.Aaron McCarthy2012-08-201-1/+1
| | | | | | | | | QMetaType::UserType was changed from 256 to 1024, this was not reflected in the code parsed by qdoc. Change-Id: I0a02e8b020d495fbf2508d84b690adae1b677125 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Use QThread instead of QPushButton as an example in the docsLars Knoll2012-08-202-3/+3
| | | | | | | This keeps links local and inside the module. Change-Id: I5e267197c6356a2c4e231c1941ed4be33b96a16e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix more qdoc errorsLars Knoll2012-08-209-37/+53
| | | | | Change-Id: Ieed340068327f37ea0f549d24ea49235994118f4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix qdoc errors in qcoreevent.Lars Knoll2012-08-201-4/+9
| | | | | Change-Id: Ic6cb963a7df643819dfdd93c7300d054e11cd0d4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix qdoc errors in the QAbstractEventDispatcher documentation.Lars Knoll2012-08-201-4/+32
| | | | | Change-Id: I7de48286f05b14c831f1290e009a25630504a76e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix some qdoc errors in the QJson* classesLars Knoll2012-08-202-0/+16
| | | | | Change-Id: If475655445afdba307508c5a3863c4bc8d87ebe6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix snippet bug in State Machine OverviewLars Knoll2012-08-201-1/+3
| | | | | | | | | Cherry-pick of b0facd481a2fc119d87c85481d97357d814a5fd2 from the qtdoc repository. Task-number: QTBUG-25314 Change-Id: I2166db46399ea6da8cadf02a7f65738c0c252142 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a couple of qdoc errors.Lars Knoll2012-08-202-3/+10
| | | | | Change-Id: I0770fc61e265face4fa061be9e110814effee181 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Refactor the automatic metatype templates into preprocessor lists.Stephen Kelly2012-08-201-24/+40
| | | | | | | This will allow re-use in moc. Change-Id: I99c5f8f0756fccf0fb2bb845c29255c14d4d703e Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Enable QAtomicInteger for char16_t and char32_tThiago Macieira2012-08-187-0/+47
| | | | | | | | | | | Those are regular, integer types, of 16- and 32-bit width, respectively. C++11's std::atomic supports them, so we should too. C++11 also supports wchar_t, but since that type's size can change, I don't feel like support for it in Qt is pressing. Change-Id: I945b641c91a8a98be82715f878c382dee58ac98b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add Q_DECL_CONSTEXPR to the isXXX functions in the new atomics.Thiago Macieira2012-08-1812-96/+96
| | | | | | | | | This allows one to write code that depends on these values at compile-time. Change-Id: I7d78524ed9c70d4141360496d1d764dcbfa92e62 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Modernise, update and fix errors in the QUrl documentationThiago Macieira2012-08-181-44/+65
| | | | | | | | | | | | | | Update the documentation of the deprecated API to match the current behaviour. Notably, the current behaviour is to check the correctness of the percent-encoding even in the "encoded" functions. Also, the use of QUrlQuery makes the matching work on canonical forms, so "%73earch" does match "search". Elsewhere, make sure we do not refer to the deprecated API in the documentation of non-deprecated functions. Change-Id: If3505ac3c6121177ad6ab18199e143775bef44b9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Bring back the documentation on QUrl deprecated methodsThiago Macieira2012-08-181-0/+433
| | | | | | | | | | | | | | | | The deprecated query methods were removed along with their documentation in commit 1c2144c39fa0069bf496e8f77389a9c2f8a31acf, so restore it from before that commit. The rest of the encoded methods were removed along with their documentation in commit 1372d60bde04a31c8036601076d1093a67c6bd46. Restore their documentation from the previous commit to that one. All the documentation from this commit is brought back unchanged, except for the addition of \deprecated. Change-Id: I1851b0dc922c681e1623359b35dfd0f505d258d2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix a couple of qdoc errorsLars Knoll2012-08-188-22/+7
| | | | | Change-Id: I79f689e08ed4a496052529af38fca72c3d4e04cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QWidgetStar.Stephen Kelly2012-08-183-23/+4
| | | | | | | | | | | | This allows us to remove the odd hacks to get the static metaobject for the QWidget* metatype. The QWidget* is still an automatic metatype thanks to the QObject partial template specialization. It is registered as a metatype at runtime automatically in qwidgetsvariant.cpp. Change-Id: Ie01b69eadf2cbe87af1a86c3284550f60dcf9e94 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix most qdoc errors for QMapLars Knoll2012-08-181-18/+10
| | | | | Change-Id: I8cac3b63cab32c655f722aca467489730c3f0a42 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move the statemachine documentation into qtcoreLars Knoll2012-08-1816-0/+1163
| | | | | | | | | Moved the documentation from qtdoc to here, so the statemachine class docs can link to it. Change-Id: I49a10cc7c418d415c64ea538376eb9bd7b031c27 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Move the animation overview doc into QtCoreLars Knoll2012-08-182-0/+364
| | | | | | | Moved here from the qtdoc module. Change-Id: Ib263848e0637204ec3b0cba973076ca79a25a953 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix qdoc erros in qfile and related classesLars Knoll2012-08-185-9/+8
| | | | | Change-Id: I56b66e6eeb06c84e1157a701a814aebb1ddf4845 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mark simple static methods in QThread as Q_DECL_NOTHROWThiago Macieira2012-08-183-6/+6
| | | | | | | | | | These methods aren't often used, but currentThreadId() gets used in the recursive mutex code to store the identity of the thread with multiple locks. Change-Id: I031cf3893aa6e7fd7a53733fc1088d295bdb9079 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMessageLogger: mark noDebug() as nothrowMarc Mutz2012-08-182-2/+2
| | | | | Change-Id: Ib01ad955844e8da376c687876141ad8f21776613 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMessageLogger: make member functions constMarc Mutz2012-08-182-17/+17
| | | | | | | | | | Just because we can :) It looks a bit weird that QMessageLogger has a constexpr constructor, but no const methods... Change-Id: I794dd2b3326c45be17b29decb47c9cac4778d397 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Doc: Fix spelling errorsSergio Ahumada2012-08-171-1/+1
| | | | | Change-Id: Ibae8d10183f6b15a16b1499daa2df8802dbb014e Reviewed-by: Geir Vattekar <geir.vattekar@nokia.com>