summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
Commit message (Collapse)AuthorAgeFilesLines
* Q_STATIC_ASSERT: use __COUNTER__ instead of __LINE__ if the compiler supports itMarc Mutz2013-09-221-0/+5
| | | | | | | | | | | When using __LINE__ to construct unique names, use of Q_STATIC_ASSERT is limited to one instance per line of code. On compilers that support __COUNTER__ (GCC and MSVC, probably others), we can get around that limitation by using that one to always get a new unique number, so use it. Change-Id: I89bcfaa32376b7a665f03e4275e89b13fa3e650d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add Mac type conversion functions to QtCoreMorten Johan Sørvig2013-09-213-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New API: static QString QString::fromCFString(CFStringRef string); CFStringRef QString::toCFString() const; static QString QString::fromNSString(const NSString *string); NSString *QString::toNSString() const; static QUrl QUrl::fromCFURL(CFURLRef url); CFURLRef QUrl::toCFURL() const; static QUrl QUrl::fromNSURL(const NSURL *url); NSURL * QUrl::toNSURL() const; Add Q_OS_MAC-protected function declarations to header files, add implementation to _mm files. CF and NS types are forward-declared in the header files to avoid including the CoreFoundation and Foundation headers. This prevents accidental use of native types in application code. Add helper macros for forward- declaration to qglobal.h Add cf_returns_retained/ns_returns_autoreleased attributes to toCFString() and toNSURL(). These attributes assists the clang static analyzer. Add Q_DECL_ helper macros to qcompilerdetection.h. Add test functions (in _mac.mm files) to the QString and QUrl tests. Split out the test class declarations into a separate headers files. Change-Id: I60fd5e93f042316196284c3db0595835fe8c4ad4 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Added support for cover windows on BlackBerry platformBernd Weimer2013-09-202-0/+5
| | | | | | | | | | | | On the BlackBerry platform when an application is minimized an alternate cover window is shown. This patch allows Qt to render into those windows. A new window type "Qt::CoverWindow" has been introduced. Change-Id: If5e321f5cb00f6d3ed7a5dc0af425655d7a9253a Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Import qlogger frameworkKai Koehne2013-09-201-0/+11
| | | | | | | | | | | | | | | | Merge most parts of the qlogger framework from git://gitorious.org/qtplayground/qlogger.git The categorized logging feature is a replacement for qDebug, qWarning and friends. With logging statements in an app/library, a developer can turn on the statements they care about and turn off the ones they don't. Most work for this was done by Wolfgang Beck and Lincoln Ramsay. Task-number: QTBUG-25694 Change-Id: Ib0cdfbbf3694f86ad9ec553b2ea36f09a477cded Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QT_NO_PROCESS for WinRTOliver Wolff2013-09-201-0/+4
| | | | | | | | | | | As Windows Runtime does not really support the use of spawning processes QT_NO_PROCESS is defined for winrt builds and the corresponding sources are excluded from build. Change-Id: I79263417c985b23678c55ac44a5591a9a69d3c13 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* WinRT: Basic global supportAndrew Knight2013-09-205-11/+40
| | | | | | | | Various global changes, primarily preprocessor flow, to support the WinRT platform. Change-Id: I3fa9cf91d5fb24019362e88fcf205e31b4f810b5 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Add support for baseline alignmentJan Arve Saether2013-09-202-2/+8
| | | | | | | | This is a prerequisite for baseline support in Qt Quick Layouts Change-Id: I1f032106cd1e7248a7688b6b9ca59f062a596d49 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix name of argument in documentationKai Koehne2013-09-171-1/+1
| | | | | Change-Id: Ia137f75865390f4bbabd65c75ba81ac4bba93eba Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Add support for ARMv8/ARM64 to qprocessordetection.hTor Arne Vestbø2013-09-161-3/+13
| | | | | | | As used by the upcoming iPhone 5S' A7 SoC. Change-Id: I276dc739c2565bce23fb1a12c9470dcd311e67ba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* ICC 13.0 supports atomicsThiago Macieira2013-09-141-0/+1
| | | | | | | See http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler Change-Id: I45ba6aa640f82df4d06fd4412264892bfd58ffc3 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Remove the empty definition of Q_PACKEDThiago Macieira2013-09-131-3/+0
| | | | | | | | | | Structs defined with Q_PACKED *need* to be packed in all platforms. Having an empty define means errors might go unnoticed for a long time. Change-Id: I9c388358fed27a8e018465f05375e4bbbee3484c Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove Q_NO_PACKED_REFERENCEThiago Macieira2013-09-131-2/+0
| | | | | | | | Leftover. It's not used anywhere. Change-Id: I023a390d84c9ed5dacd2699145f183e8a2317153 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add assert if a global static is used after deletion.Jędrzej Nowacki2013-09-131-2/+10
| | | | | | | | | Q_GLOBAL_STATIC accessor is documented to return dangling pointer if called after destruction. Change-Id: Ieafd5619b20ad256d9d5ad007d939f1430ef681f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add detection for C++11 explicit conversion operators.Marcel Krems2013-09-091-0/+5
| | | | | Change-Id: Ib33049b538f072079c0f840bc10adf0899217199 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows logging: Fix check for console applications.Friedemann Kleint2013-09-091-13/+32
| | | | | | | | | | The old code used to check for usingWinMain, which is not set when Qt is used within a DLL. Try to check for presence of stderr by checking for a console window or a redirected stderr-handle. Task-number: QTBUG-32044 Change-Id: I87893c3438f5e92d73488e9c25b95cbfeaacc1f6 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix cross-compiling V4 for Android on WindowsEskil Abrahamsen Blomfeldt2013-09-091-0/+2
| | | | | | | | | | The QT_POINTER_SIZE is not detected on Windows. We can safely set this to 32 bit for Android since we only support 32 bit builds on Windows. Task-number: QTBUG-33397 Change-Id: I891cf01444d1ba9216ed2c3ba33ef40c61d50dd9 Reviewed-by: BogDan Vatra <bogdan@kde.org>
* Fix unused static function randTLS() warningEskil Abrahamsen Blomfeldt2013-09-091-1/+1
| | | | | | | | | Match the preprocessor conditions for using the randTLS() function in the place where it's defined, otherwise we will get a warning for this. Change-Id: I0fa20f2671da618e31f30a4536f55bc680131e4d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Fix QString(char*) warnings in qlogging.cppEskil Abrahamsen Blomfeldt2013-09-091-2/+3
| | | | | | | | | Both context.file and context.function are already char*, so using qPrintable() here would first convert them to QString() with the scary constructor and then back again. Change-Id: I822655c37fb8b9baaddc8f95d7c1842519859a0e Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Add C++11 features supported by the Intel Compiler 14.0Thiago Macieira2013-09-061-0/+9
| | | | | | Change-Id: Ib9789223d487c29c5ce0830afa1f74b66ea6adfe Reviewed-by: Guillermo A. Amaral <gamaral@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* ICC supports __builtin_unreachable(), so use itThiago Macieira2013-09-051-1/+1
| | | | | | | __assume(0) is not strong enough in some cases. Change-Id: Ifac42a58af891d636e3e0b2fa476da787bd0d1ce Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Added applicationState() to QGuiApplication.Yoann Lopes2013-09-021-0/+1
| | | | | | | | | | | We only had the QApplicationStateChangeEvent to know about the application state. Added a function and a signal to offer a more convenient way to query the current state. Change-Id: I926aac0b3b53bd285df5825aff5b4c37ae863d03 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-272-4/+7
|\ | | | | | | | | | | | | Conflicts: examples/widgets/doc/src/addressbook-fr.qdoc Change-Id: Id1196e8e0c6445f1616c3f29234c974d809f8e48
| * Revert "Fix compilation for Android ARMv5"Eskil Abrahamsen Blomfeldt2013-08-271-4/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit 9fa1bdeeb2bca6f9ba370fce594a47a066a7e81a which is no longer needed because the Android NDK now contains a toolchain without the bug for which it was a work-around. Task-number: QTBUG-31051 Change-Id: I601ba2fccb927ee7e818644de4474700e2eec8f1 Reviewed-by: BogDan Vatra <bogdan@kde.org>
| * Doc: Add Q_OS_ANDROID macroTakumi Asaki2013-08-231-0/+7
| | | | | | | | | | Change-Id: If428f0b7c1540e809f756f426a6d222acea5d310 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | Define Q_PROCESSOR_X86 to the x86 familyThiago Macieira2013-08-221-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are: 3 Intel 80386 or equivalent 4 Intel 80486 or equivalent 5 Intel Pentium, Pentium MMX, AMD K6 and a few others 6 everything since the Intel Pentium Pro and AMD Athlon By necessity, this means all 64-bit builds have a family of 6. That matches the family number that the CPUID instruction produces. Change-Id: I5dc7344976f8da65938f44310b89ade4fe3f1a28 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Thiago Macieira2013-08-221-1/+1
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-211-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/src.pro Change-Id: I0a560826c420e46988da3776bd8f9160c365459a
| | * add configure -extprefix optionOswald Buddenhagen2013-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this adds the possibility to put the actual qt installation outside the sysroot it is configured for. this makes it possible to install an x-built qt without "polluting" the sysroot, which makes it possible to have read-only sysroots, and multiple qt builds for one sysroot. -prefix is the location within the sysroot as seen by the target itself, and gets "burned" into QLibraryInfo in QtCore. -extprefix is the location in the host file system and gets "burned" into QLibraryInfo in qmake. if it is not specified, it defaults to the sysrootified prefix, which is the previous behavior. Task-number: QTBUG-26680 Change-Id: Ia43833c4e27733159afeb8c8b9b2d981378d0cd1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Mark qFuzzy* and qIsNull as Q_REQUIRED_RESULTGiuseppe D'Angelo2013-08-211-0/+6
|/ / | | | | | | | | | | | | | | | | | | Calling them and not using the return value makes no sense. And it's even worse -- in autotests people might call those functions without wrapping them in QVERIFY(), effectively not testing anything. Change-Id: I2c90d1c85963ff1f35f00653d536a9252c2fcc48 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-08-164-17/+20
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-144-17/+20
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-xcode/Info.plist.app mkspecs/macx-xcode/Info.plist.lib qmake/doc/qmake.qdocconf src/corelib/global/qglobal.h tests/auto/other/exceptionsafety/exceptionsafety.pro tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
| | * Remove OS X unsupported warning.Jake Petroules2013-08-101-4/+0
| | | | | | | | | | | | | | | | | | | | | No other platform has such a warning and it really is not important. Change-Id: Ib85a536b6fcf9d7f15cd8b0779db7f6cfaec339a Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
| | * Merge branch 'release' into stableSergio Ahumada2013-08-091-1/+1
| | |\ | | | | | | | | | | | | Change-Id: I5e94c4f01564df633c9925561ebb0b553bd31a2e
| | | * Enable qsrand() on builds without thread-safe posixEskil Abrahamsen Blomfeldt2013-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The #ifdef clause in qsrand() needs to be the same as in qrand(). Otherwise, we will store the seed in thread-local storage in qsrand(), never passing it into srand(), and then we'll use regular rand() because the rand_r() function is missing, thus always using a random seed of 1 in all applications. Task-number: QTBUG-32781 Change-Id: I00240a1954ae746b87b031f3a0470a6cbe747571 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Fix clang detection of thread_local variablesThiago Macieira2013-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "0" must have been added because there was no __has_feature for the feature back in the day. Now it exists. Change-Id: I50f0544ae82a8be54a8d26da400e31c1906dad9e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| | * | Add support for Q_OS_FREEBSD_KERNEL and documentThiago Macieira2013-07-301-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also clarify documentation for OSes with variants. Q_OS_ANDROID should have been called Q_OS_LINUX_ANDROID and Q_OS_BLACKBERRY should have been Q_OS_QNX_BLACKBERRY. Task-number: QTBUG-15402 Change-Id: I3a34d52a1c0ebb8eb73284bdf198443c209a5fd4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| | * | Merge remote-tracking branch 'origin/release' into stableSergio Ahumada2013-07-261-6/+2
| | |\| | | | | | | | | | | | | Change-Id: Ic5a232260a6c8ee71f9ff91e820f54c36ab6b15a
| | | * Doc: Update documentation of Qt::HANDLETopi Reinio2013-07-241-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt::HANDLE is always defined as 'void *' on Qt 5.0 Task-number: QTBUG-32469 Change-Id: I3f0f2b19e65d54c88604e1cb65b5791c456b3003 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| | * | Bump Qt version to 5.1.2Sergio Ahumada2013-07-231-2/+2
| | |/ | | | | | | | | | | | | Change-Id: Ibe3e6a37a874b75ea9a20e0a9ed8aa5f21bf6be2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | / Replace QWheelEvent::Phase with revised Qt::ScrollPhaseJ-P Nurmi2013-08-152-0/+22
|/ / | | | | | | | | Change-Id: I4d8e7d48497d0d96a297191976c0d99feb67b538 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Add the RFC2822Date formatKevin Ottens2013-07-242-1/+6
| | | | | | | | | | | | | | | | | | | | | | QDateTime can now be converted to strings compliant to RFC 2822. Additionally, it supports RFC 850 and RFC 1036 during parsing. By having them all together, all type of dates found in exchanged messages on the internet (including USENET) get supported. Change-Id: I771066c23f409d20b31b7d802f37852ea68ca2a0 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | Add a Mach-O decoder to the QPluginLoaderThiago Macieira2013-07-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already had an ELF decoder, which helped us greatly to find the metadata and that catches most Unix systems (Solaris, QNX, HP-UXi, and all of the free Unixes). On other Unix systems, aside from Mac OS X, we simply scanned the entire file for the signature. On Windows, even without a COFF-PE decoder, we use a LoadLibrary trick to load the plugin without loading the dependent libraries. In most cases, that works. Unfortunately, on Mac OS X we didn't have a decoder and nor could we do the file scan: because Mac OS X binaries could be fat binaries, we wouldn't know which architecture's signature we had found. No more. This adds a full Mach-O decoder to QtCore. It is also capable of finding the boundaries of the architecture's binary, but that functionality is disabled since all Qt 5 plugins have plugin metadata sections. Change-Id: I2d5c04c5ecf024864b8a43f31ab6b7e6c5eae9ce Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge branch 'stable' into devSergio Ahumada2013-07-113-5/+7
|\| | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/json/qjsonwriter.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm Change-Id: I24df576c4cbd18fa51b03122f71e32bb83b9028f
| * Clean up evaluation license logicTor Arne Vestbø2013-07-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of storing the application type as a uint, we use the enum provided by QCoreApplicationPrivate. The former resulted in a few cases of wrong logic where the values got mixed up, such as always printing the QtCore console warning, even for GUI applications. The qt_eval_is_supported function has been refactored to return enums instead of magic values, to make the logic easier to read. The same goes for qt_eval_days_left, which now only concerns itself with the number of days left. qt_eval_is_expired() has been added to use for easy checking of expiration date. Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: Ia0e85b2103f790a7e02e0d6e567a477b3145fcb9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| * Deal with unused functions, as found by the Intel compilerThiago Macieira2013-07-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use Q_DECL_UNUSED for the one that is possibly unused (we have two overloads so that one gets selected): qglobal.cpp(2069): warning #177: function "<unnamed>::fromstrerror_helper(int, const QByteArray &)" was declared but never referenced Remove functions really not used: qbezier.cpp(153): warning #177: function "findInflections" was declared but never referenced qbezier.cpp(534): warning #177: function "splitBezierAt" was declared but never referenced qpathclipper.cpp(1039): warning #177: function "midPoint" was declared but never referenced qpainter.cpp(119): warning #177: function "check_gradient" was declared but never referenced qdockarealayout.cpp(2580): warning #177: function "qMin(int, int, int)" was declared but never referenced qmainwindowlayout.cpp(1019): warning #177: function "validateDockWidgetArea" was declared but never referenced qgraphicsanchorlayout_p.cpp(670): warning #177: function "checkAdd" was declared but never referenced qcups.cpp(481): warning #177: function "paperSize2String" was declared but never referenced complexwidgets.cpp(373): warning #177: function "removeInvisibleWidgetsFromList" was declared but never referenced Change-Id: I1e5558e206b04edea381442030dc69536198d966 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-06-281-1/+1
| |\ | | | | | | | | | Change-Id: I53112e20a65b7d706755b4a22622979f3b91a2c2
| | * Fix win32-icc build: _CHAR16T is not an indication of C++11 supportThiago Macieira2013-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro comes from MSVC's yvals.h header and it actually indicates absence of C++11 support in MSVC. It is defined if _HAS_CHAR16_T_LANGUAGE_SUPPORT isn't defined, which is a C++11 feature. Task-number: QTBUG-31701 Change-Id: I155b8e764f786e95a08de660f70094b2bee38937 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* | | Key mappings for more remote-control keysAllan Sandfeld Jensen2013-07-052-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are missing a few key mappings to have support for remote control keys supported by Android and DirectFB. This patch adds the four color keys Red/Green/Yellow/Blue and ChannelUp and ChannelDown. Change-Id: I4d859c28e0d61c5362f1212ba1e577a47de86ec1 Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Add Q_OS_OSX and update the documentation to reflect usage intent.Jake Petroules2013-07-042-9/+12
| | | | | | | | | | | | | | | | | | Change-Id: I7f089109d7357995b65f6a012f705a6c3cac12ff Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-06-277-18/+35
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/features/create_cmake.prf Change-Id: I94aea83b83833395d5db399209e0e51b92ef23b5