summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
Commit message (Collapse)AuthorAgeFilesLines
* qcompilerdetection.h: set Q_DECL_OVERRIDE/Q_DECL_FINAL for 2005 <= MSVC <= 2010Marc Mutz2012-08-271-3/+18
| | | | | | | | | This enables Q_DECL_FINAL and Q_DECL_OVERRIDE backed by VC's non-standard extensions from VC 2005 on. VC 2012 will support the standard-compliant version, so use that there. Change-Id: I96874fe3d36fcaa283d2d1f53d5eb6825e55f259 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QtGlobal: document Q_DECL_FINAL and Q_DECL_OVERRIDEMarc Mutz2012-08-261-0/+56
| | | | | | Change-Id: I9b292ae3319c30ad878aade4416fb88155465a54 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QtGlobal: remove Q_DECL_FINAL_CLASSMarc Mutz2012-08-261-6/+0
| | | | | | | | | | | Now that qvariant_p.h's HasIsNullMethod check is fixed so that it doesn't require Q_COMPILER_DECLTYPE anymore to be able to deal with final classes, there's no point in distinguishing Q_DECL_FINAL and Q_DECL_FINAL_CLASS anymore, so remove the latter. Change-Id: I31de5b63e7d2e44171a13e928997c946d93e05c9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* qcompilerdetection.h: add MSVC 2012 featuresMarc Mutz2012-08-261-0/+7
| | | | | | | | These are taken from the table at http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx Change-Id: Ifd2f88ca5d92092a6a025bef3da36fde0a802a66 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* qcompilerdetection.h: stream-line MSVC feature detectionMarc Mutz2012-08-261-6/+9
| | | | | | | | | | | | | | | | | Reformat the MSVC feature detection to be similar to other compilers, ie. 1. Inside the C++11 features section instead of where the compilers are detected 2. In one block for the compiler, with sub-blocks for the version. However, it's now not 100% compatible with the previous version, since Q_CC_INTEL is now explicitly excluded while before it was implicitly included in the MSVC case. I have no idea whether that matters, since Q_CC_INTEL is handled for itself further up already. Change-Id: Id9e8da0a5394ad5643bcb29493f14bc6e8264c13 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* doc: Fix some qdoc warningsEskil Abrahamsen Blomfeldt2012-08-231-1/+1
| | | | | | | | | | | QDoc doesn't supported nested tags, and there doesn't seem to be any way to trick it into thinking you've mentioned the argument (\omit didn't work), so actually rephrasing is the only way to kill the warning. Also add a const modifier to a signature to make it match the declaration. Change-Id: Ie02a488c42565205e827602959111c53e2d05a83 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-234-0/+7
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* A few more random documentation fixesShawn Rutledge2012-08-231-0/+10
| | | | | | | @p replaced by \a, \QD replaced by {Qt Designer}, couple of enums etc. Change-Id: I315510690bf52e42db519292b4122fa24c73bbc9 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@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>
* 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>
* doc: Added \relates command to some function qdoc commentsMartin Smith2012-08-211-0/+9
| | | | | | | | | | | | | 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>
* 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>
* 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>
* Fix more qdoc errorsLars Knoll2012-08-201-0/+3
| | | | | Change-Id: Ieed340068327f37ea0f549d24ea49235994118f4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix a couple of qdoc errorsLars Knoll2012-08-181-1/+1
| | | | | Change-Id: I79f689e08ed4a496052529af38fca72c3d4e04cb 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>
* Fix QMessageLogger and associated qdoc errorsJeremy Katz2012-08-151-5/+100
| | | | | Change-Id: I4b9555c8a15a698ef5ce270288c88a0aa88e0033 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Make the "\internal" qdoc command stand on its own lineLaszlo Papp2012-08-152-3/+6
| | | | | | | | | | The qdoc manual currently claims that the command must stand on its own line. The change follows the consistency with the rest and how the example looks like inside the qdoc manual for this command. Change-Id: I6b653dc95cf9d84e4adf32220dace5d313678419 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QtCore: use new qEnvironmentVariableIs{Set,Empty}()Marc Mutz2012-08-141-2/+2
| | | | | | | | | | | | In particular, qEmergencyOut() is now completely exception-free. Incidentally, this patch shows that Qt isn't consistent in how it treats empty environment variables used as flags, but that is something for a separate commit. This patch aims to be behaviour-preserving, except in exceptional circumstances, of course. Change-Id: Ie106e7b430e1ab086c40c81cc1e56cd0e5400cb4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate Qt::WFlags.Stephen Kelly2012-08-142-0/+4
| | | | | | | | | It seems to date from the Qt 1 days, and such abbreviations are not current Qt style. Change-Id: Iea7259bd7ba78b2c0863e3f6675e10826712ffd9 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* QtGlobal: (new) qEnvironmentVariableIs{Set,Empty}()Marc Mutz2012-08-092-0/+59
| | | | | | | | | | | | | These functions are a faster version of {,!}qgetenv().is{Null,Empty}(), a common pattern in Qt code. Their main advantage is that they don't need to allocate memory, so they can be used in noexcept functions, or dynamic initialisation of namespace-scope statics, because throwing in these contexts invokes std::terminate(). Change-Id: I651c5bd72f450b5d7df76590f8791572fe992af5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Logging: mark qt_assert()/qt_assert_x()/qFatal() as nothrowMarc Mutz2012-08-094-7/+55
| | | | | | | | | | | | | | | | | | | | | | These functions are not supposed to return, not even by exception. qt_message() _can_ throw, but we're fine with the compiler calling std::terminate() then, since the backtrace will still include the assertion location. This behaviour is ensured by a new macro, QT_TERMINATE_ON_EXCEPTION, which expands to something like try { expr; } catch(...) { std::terminate(); } if the compiler doesn't support Q_DECL_NOEXCEPT (but maybe Q_DECL_NOTHROW), and to something like just expr; otherwise (including in the QT_NO_EXCEPTION case). The real macro preserves scopes in all cases, and aims to work even if <exception> isn't included in the TU it's used in, so is a little bit more complex than that. Change-Id: Ie6a2b7776e6aa77e57bd9aea6e184e5fa1cec81c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unnecessary extra indentation in the EXPORT macrosThiago Macieira2012-08-091-23/+22
| | | | | Change-Id: I54585fa7e38ea1984018c5cbff9bc4626016bace Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove the Q_xxx_EXPORT macros of other modules from qglobal.hThiago Macieira2012-08-091-31/+0
| | | | | | | The macros have been moved to their respective modules. Change-Id: I653668b608cd3b79824a25b0e7b1c238330c0007 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Q_DECL_NOTHROW: stronger and more widely available version of Q_DECL_NOEXCEPTMarc Mutz2012-08-072-4/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 1adca807 defined Q_DECL_NOEXCEPT to be the same as throw() for the Microsoft compiler. However, the two are not equivalent: - C++11 noexcept is defined to call std::terminate() if a noexcept function nevertheless encounters an exception. - MSVC throw() has essentially undefined behaviour in this situation: http://msdn.microsoft.com/en-us/library/wfa0edys%28v=vs.100%29 "Due to code optimizations that might be performed by the C++ compiler [...] if a function does throw an exception, the program may not execute correctly." So define two macros: 1. Q_DECL_NOEXCEPT/Q_DECL_NOEXCEPT_EXPR always have C++11 behaviour. This is expected to be the more efficient implementation if the function can actually throw. 2. Q_DECL_NOTHROW means that the function gives the nothrow guarantee. It is stronger than noexcept, but not all functions that can be marked Q_DECL_NOEXCEPT can be marked Q_DECL_NOTHROW. In general Q_DECL_NOTHROW functions need to use a try/catch block in order to prevent exceptions from leaving the functions, unless you can proove that none of the operations can throw. For the caller, both macros are equivalent: it can be relied on that no exception leaves the function. Change-Id: I32f822a82e06a31cb71d38db438387aee5ec3334 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* QMessageLogger: mark default ctor as constexpr, tooMarc Mutz2012-08-071-2/+2
| | | | | | Change-Id: I6f92f4a01e43dbe811b11b3e8d9b8a02a31463c5 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove extra Q_COMPILER_xxx defines from the MSVC section.Thiago Macieira2012-08-061-11/+0
| | | | | | | | Those are defined below, after the list that describes the macros and the papers. Change-Id: I1f2df0e33c84eb17ebbb0147662f560defed182c Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* MSVC's throw() behaviour matches the C++11 noexcept, so use itThiago Macieira2012-08-061-1/+5
| | | | | | | | | | | | This allows code using methods marked Q_DECL_NOEXCEPT to benefit from optimisations before MSVC supports the C++11 keyword. Even MSVC 2012 doesn't have it yet. Using throw() in other compilers is not a good idea because they might actually be implementing the C++ standard -- which is broken. Change-Id: Id07ab4fe40a641583d5285d5abb536998bc419ba Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Logging: mark qEmergencyOut() noexceptMarc Mutz2012-08-061-1/+1
| | | | | | | | This function is called in OOM situations and when other exceptions are still in flight, so it really shouldn't throw, indeed. Change-Id: I50cda699ffd74f3710c3bafd15af356ff410bc47 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix order of QT_END_NAMESPACE and QT_END_HEADER macrosSergio Ahumada2012-08-031-1/+1
| | | | | Change-Id: I798311bdacaac341210626489410740c130f8724 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* string.h is needed for memcpy()Oswald Buddenhagen2012-08-021-0/+2
| | | | | | | | ... which is used by some template code. apparently, the glibc on my rather recent system removed some implicit includes again. Change-Id: I9f85362e54a42cccc1e743f2b27bcdb6a90162e3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix some syncqt warnings.Lars Knoll2012-08-011-0/+6
| | | | | Change-Id: I6f432ee991f4bde217fa27d4004ef318f1d480e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mark the QFlag and QIncompatibleFlag as primitive.Stephen Kelly2012-07-281-0/+3
| | | | | | Change-Id: I7dab4d029e7840fe4778a750a8dd7367675d7a27 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introduce QTypeInfoMerger.Jędrzej Nowacki2012-07-271-0/+32
| | | | | | | | | | | | QTypeInfoMerger class was created to allow "inheriting" QTypeInfo traits. The class implementation was based on the QTypeInfo<QPair<>> specialization, therefore the specialization was refactored to use the new class. Change-Id: I4ff3e5eac1d55da086dad84274cce2b2c0a721be Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix q_check_ptr typo in QtGlobal documentation.Mitch Curtis2012-07-231-1/+1
| | | | | | Task-number: QTBUG-24093 Change-Id: Ia6b4ef49e07910ceddd826b3b7cc81ca41f33d01 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Logging: Simplify message handler logic for windowsKai Koehne2012-07-211-24/+13
| | | | | | | Incorporate the functionality of qWinMessageHandler in qDefaultMessageHandler. Change-Id: Iec5b19e187c0d2e3d8d0874280ba57f6fb21d7b4 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* QFlags: complete constexpr'ifcationMarc Mutz2012-07-211-4/+4
| | | | | | Change-Id: Ie7c33bc1e3abaa9100093a84e65bee5f3b80fe0f Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix "No such ..." doc error for Qt::WindowType WindowOverridesSystemGesturesJeremy Katz2012-07-191-1/+1
| | | | | | | Is this a typo in the documentation, or in the enum? Change-Id: I58ba12d74694b26ec0bf76226b56337a12e0756e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* fix "No such ..." error in qnamespace.qdocJeremy Katz2012-07-191-3/+0
| | | | | | | | RIP Qt::ClipOperation UniteClip See 01b72952c38b9193138eabdab6bdab632cd75ebd for details Change-Id: I8cfd5f6d008374741bea4f6a85827545ddb8ae86 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Make the QIncompatibleFlag constexpr.Stephen Kelly2012-07-181-3/+3
| | | | | | Change-Id: If99b43b45cc667449dbe7c487b56885c6ce9b1c7 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* undocument enums as part of Qt3Support removalJeremy Katz2012-07-161-124/+1
| | | | | | | | | Lots of enums in the Qt namespace used to be hidden or documented as obsolete. These have been removed entirely, as they result in qdoc errors. Change-Id: I67726d7358f4e71a0c8fc5181388b1cf8fd4e4bd Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Undocument Qt::AnchorAttributeJeremy Katz2012-07-161-12/+0
| | | | | | | AnchorAttribute was removed as part of the Qt3Support cleanup. Change-Id: I58d8e471d4bc1af420ec8eaab6d34c1718b30382 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* remove QT_NO_SIGNALMAPPER from featuresTasuku Suzuki2012-07-122-10/+0
| | | | | | | QSignalMapper is a small and extremely low-level interface. Change-Id: I7e799673c6fe559178739fbc58385141ae3f0789 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix some spelling errorsSergio Ahumada2012-07-111-1/+1
| | | | | | Change-Id: I19d3b2e9a5180b13deb828b55195404ef20be295 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Use Q_DECL_CONSTEXPR for the QFlag's inline constructorLaszlo Papp2012-07-101-2/+2
| | | | | Change-Id: I8f9c7bf0fddb79c6c0937e415c427a0547a5cab0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Speed up QCoreApplication construction a bitHarald Fernengel2012-07-101-1/+1
| | | | | | | | Remove all QString conversions during QCoreApplication construction on Linux. Saves multiple mallocs. Change-Id: Ia8ba071a750dd6a08dcf14ef3ecc424f70a3098d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Q_DECLARE_SHARED: mark the type movableMarc Mutz2012-07-101-0/+1
| | | | | | | | | | All implicitly shared classes are by definition movable, so this patch adds Q_DECLARE_TYPEINFO(Type, Q_MOVABLE_TYPE) to Q_DECLARE_SHARED. Change-Id: Idf8989ae1a7ed6d1ac13fccb7eaef7395a875350 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>