summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Simon Hausmann2016-03-242-1/+2
|\ | | | | | | Change-Id: I13c7ea6a74eb98606cf45702ae068101943bec6a
| * Add a write buffer to QLocalSocket/WinJoerg Bornemann2016-03-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0307c008 removed the buffering of data-to-be-written from QWindowsPipeWriter, because it was assumed that users of this class (QProcess and QLocalSocket) already buffer data internally. This assumption was wrong for QLocalSocket. The following sequence localSocket->write(someData); localSocket->write(someMoreData); would not write anything on the second write. Add a write buffer to the Windows implementation of QLocalSocket. Task-number: QTBUG-52073 Change-Id: I6d0f03a722ec48138cbde3e2f69aae7dafe790d3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * Hide mixed comparisons with QT_RESTRICTED_CAST_FROM_ASCIIhjk2016-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While the implementation of the QByteArray::operatorX(const QString &s2) for X \in { ==, !=, <, <=, >, >=} was already inavailable when QT_RESTRICTED_CAST_FROM_ASCII was defined, the declaration was still visible, leading effectively to a linking error. This change hides the declaration, too, creating a compiler error as intended, and as present with the QString::operatorX(const QByteArray &s2) functions. Change-Id: Ifdb0b85b7423b3b9c69212639b1512b0808a7983 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | qNonConstOverload(): Fix documentation typo.Friedemann Kleint2016-03-241-1/+1
| | | | | | | | | | | | | | Amends change 14b79ae2b3d81ed344e7ae7dd0a2159c9f9e33e9. Change-Id: I4e17965e877002be1fe3cad25001d5d164d1c128 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Fix some documentation warnings.Friedemann Kleint2016-03-246-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/io/qnoncontiguousbytedevice.cpp:87: warning: Cannot find 'atEnd(...)' in '\fn' virtual bool QNonContiguousByteDevice::atEnd() qtbase/src/corelib/io/qnoncontiguousbytedevice.cpp:107: warning: Cannot find 'size(...)' in '\fn' virtual qint64 QNonContiguousByteDevice::size() qtbase/src/corelib/io/qsettings.cpp:2387: warning: Unexpected '\endlist' qtbase/src/corelib/kernel/qcoreevent.cpp:90: warning: Undocumented enum item 'Pointer' in QEvent::Type qtbase/src/corelib/kernel/qmetaobject.cpp:346: warning: No documentation for 'QMetaObject::inherits(const QMetaObject *metaObject)' qtbase/src/corelib/statemachine/qsignaltransition.cpp:154: warning: No such parameter 'sourceSate' in QSignalTransition::QSignalTransition() qtbase/src/corelib/global/qglobal.cpp:945: warning: Undocumented parameter 'memberFunctionPointer' in qConstOverload() qtbase/src/corelib/global/qglobal.cpp:956: warning: Undocumented parameter 'memberFunctionPointer' in qNonConstOverload() qtbase/src/widgets/doc/src/widgets-and-layouts/stylesheet.qdoc:519: warning: Command '\snippet (//! [96])' failed at end of file 'code/doc_src_stylesheet.cpp' Change-Id: I7da69b9b535f484e10ca030dbf64b6007dce0df3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Simon Hausmann2016-03-235-209/+6
|\| | | | | | | Change-Id: I9a10e1f3c9506ec8554d8f59b6300825ac730939
| * Remove QPROCESS_USE_SPAWN and all that it surroundsJames McDonnell2016-03-224-207/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The spawn code was only used to make QProcess work on QNX 6.5.0. Fork works on QNX 6.6.0. The QNX spawn implementation has a flaw that causes a deadlock in certain situations. When a working directory is specified for the process, the QNX spawn implementation stops all threads except the one doing the spawn so that it can temporarily change the process' working directory. This can lead to a deadlock if the thread does anything that conficts with something being done in a stopped thread. QNX 6.5.0 is no longer supported in Qt 5.6.0 so we can just switch QNX to the fork implementation and get rid of the spawn implementation. Made a QNX specific adjustment to the hardExit test. There's a bug in the OS that the test can run into because it does something that normal applications wouldn't. Task-number: QTBUG-47250 Change-Id: Ib32567d2c15ce651815858000035ac5aa6f35224 Reviewed-by: Dan Cape <dcape@qnx.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
| * QVersionNumber: compile with -Wzero-as-null-pointer-constantMarc Mutz2016-03-221-1/+1
| | | | | | | | | | | | (backport of qtbase/f43885f8d14e045e5ec47857d62a140d99d16cfa) Change-Id: I9735c04d90353372cf9b32828ed839f80c31a88a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Docs of qSetMessagePattern missing relation to qCDebug and co.M. Moellney2016-03-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | The documentation of qSetMessagePattern was missing links to qInfo() and the category logging siblings: qCDebug, qCInfo, qCWarning, and qCCritical. This patch adds the links and adds a link to QLoggingCatergory class. Task-number: QTBUG-51943 Change-Id: I85c1a205bfcd555cb0516f8cbdd157d8f20185b4 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* | Do not use forkfd for INTEGRITY.Rolland Dudemaine2016-03-221-6/+8
| | | | | | | | | | | | | | | | unix is defined for the integrity target. Remove the general |integrity and only special-case forkfd. Change-Id: I8752e62659c28261b2309013fad6e8a82b9397d1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Do not use timezone at all for Q_OS_INTEGRITY.Rolland Dudemaine2016-03-221-0/+2
| | | | | | | | | | Change-Id: I3674b86b65a6ec47c89cc4f49e00361e9b87a7c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-2115-234/+441
|\| | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qgtkstyle_p.cpp tests/auto/corelib/io/qtextstream/test/test.pro tests/auto/corelib/plugin/plugin.pro Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
| * QTypeInfoQuery: Add public inheritance specifiersGabriel de Dietrich2016-03-171-2/+2
| | | | | | | | | | | | | | | | | | Their absence offends PySide's shiboken. Change-Id: I137d17e280276f7ffadba6d16b7c230a6880cf05 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
| * Make QWindowsPipeWriter thread-free.Joerg Bornemann2016-03-174-141/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-work QWindowsPipeWriter to not use a thread anymore but the WriteFileEx API, similar to QWindowsPipeReader. This saves us a lot of thread synchronization code and enables us to directly write data without yet another buffering layer. Also, this fixes the dreaded deadlocks in the QWindowsPipeWriter destructor that could occur when the reading end was closed before the write was finished. Task-number: QTBUG-23378 Task-number: QTBUG-38185 Change-Id: If0ae96dcd756f716ddf6fa38016080095bf3bd4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * Rework QWindowsPipeReaderJoerg Bornemann2016-03-172-67/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of QWinOverlappedIoNotifier in QWindowsPipeReader restricts us in the following ways: - The handle that gets assigned to QWinOverlappedIoNotifier is forever tied to an I/O completion port. - Other notification mechanisms like I/O completion routines of WriteFileEx do not work with such a handle. - No other QWinOverlappedIoNotifier can be registered for this handle. To achieve the ultimate goal of making QWindowsPipeWriter thread-free (to fix QTBUG-23378 and QTBUG-38185) we remove the usage of QWinOverlappedIoNotifier from QWindowsPipeReader and use the ReadFileEx API instead. This has the additional advantage of removing the need for any thread synchronization, as the I/O completion routine runs in the thread that ReadFileEx was called on, leading to simpler and faster code. Change-Id: I05c983e1f1e49d7dd27e3b77a47f87cae9c3f4c6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * Android: Fix compilation with NDK r11BogDan Vatra2016-03-171-0/+5
| | | | | | | | | | | | Task-number: QTBUG-51859 Change-Id: Id8bbcc9f0503ab2742e8da7f3b5de03fd46714b2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| * Introduce separate mapping of QStandardPaths's CLSIDs for Windows CE.Friedemann Kleint2016-03-171-0/+22
| | | | | | | | | | | | | | | | | | | | CSIDL_APPDATA should be used instead of CSIDL_LOCAL_APPDATA on Windows CE. Amends 910f719bd111813f37278b67d07f9d12cb03a4ff . Task-number: QTBUG-50570 Change-Id: I0cc310ef5fe3fbaefae9c84dd9db8cf48ff48499 Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
| * Fix link to sched_setscheduler in QThread documentationMitch Curtis2016-03-161-2/+3
| | | | | | | | | | Change-Id: I38412a119d2a91685b3fd2e4a459d33a60b154b0 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| * WinRT: Fix QTimeZone transitions by switching backendMaurice Kalinowski2016-03-163-5/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously WinRT was using the UTC backend which fails on all platforms for some QDateTime autotests related to timezone items. Hence switch to the Windows implementation for WinRT as well. However, the windows backend does query the registry heavily, which is not supported on WinRT. Instead use the API version provided by the SDK. Long-term we might want to switch to this version on desktop windows as well, as direct registry access would not be required and we could harmonize the codepaths for both platforms. Change-Id: I620b614e9994aa77b531e5c34c9be1da7e272a30 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| * winrt: process all triggered timers in processEventsOliver Wolff2016-03-161-5/+5
| | | | | | | | | | | | | | | | | | | | | | If only one timer is processed in there it is possible that a reoccuring timer which has a very low timeout blocks all the other timers from being triggered. This high frequency timer might be the only one to be triggered in every processEvents call. Task-number: QTBUG-51888 Change-Id: I8a0026d1e8519171ab60d1b47c494a15d30328b3 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
| * Remove handle duplication code from QWindowsPipeWriterJoerg Bornemann2016-03-151-4/+1
| | | | | | | | | | | | | | There is no apparent reason why the handle should be duplicated. Change-Id: I8ff2cde2f050934ed0dd9ab2d39a1b1efa327a17 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * QRect: fix UB (int overflow) in center()Marc Mutz2016-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QRect::center() should be defined for any QRect(x1,y1,x2,x2), INT_MIN <= x1, x2, y1, y2 <= INT_MAX because the average of two signed integers is always representable as a signed integer. But not when it's calculated as (x1+x2)/2, since that expression overflows when x1 > INT_MAX - x2. Instead of playing games with Hacker's Delight-style expressions, or use Google's patented algorithm, which requires two divisions, take advantage of the fact that int is not intmax_t and perform the calculation in the qint64 domain. The cast back to int is always well- defined since, as mentioned, the result is always representable in an int. Fix a test-case that expected a nonsensical result due to overflow. [ChangeLog][QtCore][QRect] Fixed integer overflow in center(). This fixes the result for some corner-cases like a 1x1 rectangle at (INT_MIN, INT_MIN), for which the previous implementation could return anything (due to invoking undefined behavior), but commonly returned (0, 0). Change-Id: I1a885ca6dff770327dd31655c3eb473fcfeb8878 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * Add argument names to the function signatures in headersOlivier Goffart2016-03-101-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, in the .cpp, the declaration has the argument name in comments because it is not used (instead of using Q_UNUSED). The old qdoc could parse that, but once clang is used, these comments are not seen anymore. So add the argument names to the headers. This is also good for things like auto completion, which uses only the header to know what the argument name is. I grepped for " */)" and made sure all the functions that are documented have the right arguments. I also added the name to all the function around for consistency. Change-Id: I1aaa37e25a1985f7f51653f047a1ac2633242b56 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* | QWheelEvent: Make NoScrollPhase publicGabriel de Dietrich2016-03-212-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts d5fde514106f5479f9c929c8a165aced4a1b2c84 and makes that enum value the default for QWheelEvent::phase() with non phase-aware mice. [ChangeLog][QtGui] QWheelEvent::phase() returns NoScrollPhase with non phase-aware mice. This is most mice and input devices except, for now, Apple's trackpads and Magic Mouse. Change-Id: I929fb39889cf116e89dcd134c1b1ec6587b8f05e Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Add GHS pretty print for compiler versionRolland Dudemaine2016-03-181-0/+2
| | | | | | | | | | Change-Id: I6376de7c33b73f5efcfc7ffc7ac6ad3a260fc3a4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Remove inclusion of -lm for INTEGRITY.Rolland Dudemaine2016-03-181-1/+1
| | | | | | | | | | | | | | Math functions are linked in by default on INTEGRITY. Change-Id: I737ae87c02b2321caca3975f69525731e839d1a7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Add GHS toolchain supportRolland Dudemaine2016-03-181-2/+48
| | | | | | | | | | | | | | | | | | Note that while GHS C/C++ is using EDG as a frontend, _BOOL is only defined when using the C++ driver, and not when building third-party C code like libpng and friends. Change-Id: Ife19bd09e4c9f3efea6383c0eede9e0947265ca2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Disable some features for INTEGRITYRolland Dudemaine2016-03-171-0/+7
| | | | | | | | | | | | | | Specifically, this is a single-process build. Change-Id: I1b2cc33641df0ef73f1f26f388c1af3d954ce6e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Dedupe QMetaObject::castSean Harmer2016-03-151-8/+1
| | | | | | | | | | | | | | | | By implementing in terms of QMetaObject::inherits(). Change-Id: I39a039539b05a20bc1713bd450d8a998c78433aa Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Add a function to QMetaObject to check for inheritanceSean Harmer2016-03-152-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | This is analogous to QObject::inherits() but only requires the metaobjects rather than pointers to a QObject instances. This is needed for type checking on the backend of Qt 3D where we do not have access to QObject pointers. Change-Id: I14d26c4cbb5cc3fbecb57725f2c14ee0ffda4a11 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QMimeTypeParser: replace a QString::arg() chain with QString::asprintf()Marc Mutz2016-03-151-2/+6
| | | | | | | | | | | | | | Saves ~250b in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: Ic92c4ac1bb20230cfbb929bdf5c7f385d7b604e5 Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Liang Qi2016-03-1325-106/+163
|\ \
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-1125-106/+163
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change partially reverts 1bfc7f68 about QT_HAS_BUILTIN define and undef in src/corelib/tools/qsimd_p.h. This change is also squashed with "Fall back to c++11 standard compiler flag for host builds" which is done by Peter Seiderer. Conflicts: mkspecs/features/default_post.prf src/3rdparty/sqlite/0001-Fixing-the-SQLite3-build-for-WEC2013-again.patch src/3rdparty/sqlite/sqlite3.c src/corelib/tools/qsimd_p.h src/gui/kernel/qevent.cpp src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface_p.h src/plugins/bearer/blackberry/blackberry.pro src/plugins/platforms/cocoa/qcocoasystemsettings.mm src/plugins/platformthemes/gtk2/gtk2.pro src/plugins/styles/bb10style/bb10style.pro src/sql/drivers/sqlite2/qsql_sqlite2.cpp tools/configure/configureapp.cpp Task-number: QTBUG-51644 Done-with: Peter Seiderer <ps.report@gmx.net> Change-Id: I6100d6ace31b2e8d41a95f0b5d5ebf8f1fd88b44
| | * QMimeMagicRule: fix UB (misaligned load) in matchNumber<T>()Marc Mutz2016-03-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by UBSan: qmimemagicrule.cpp:166:53: runtime error: load of misaligned address 0x00000124bcb9 for type 'const short unsigned int', which requires 2 byte alignment qmimemagicrule.cpp:166:53: runtime error: load of misaligned address 0x00000124bcb9 for type 'const unsigned int', which requires 4 byte alignment Fix by using new qUnalignedLoad<T>() instead of a load through a type-punned pointer and misaligned pointer. Change-Id: I6b876f1ce7e01369fbb25a51263d1ad04be07d52 Reviewed-by: David Faure <david.faure@kdab.com>
| | * QJsonParser: fix UB (misaligned store) in Parser::parseNumber()Marc Mutz2016-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by UBSan: qjsonparser.cpp:741:30: runtime error: store to misaligned address 0x0000019b1e94 for type 'quint64', which requires 8 byte alignment Fix by using the qToLittleEndian() overload that can store to misaligned memory. Change-Id: Ib84bd30b13c68f7fdb8870c9fbbfac15cff0112d Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QObject: fix GCC 6 warning about qt_static_metacall's 'hidden' attribute useMarc Mutz2016-03-091-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This warning is triggered when we try to apply the Q_DECL_HIDDEN attribute to a class in an unnamed namespace. Such classes are already not exported. qobjectdefs.h:175:108: warning: ‘visibility’ attribute ignored [-Wattributes] qobjectdefs.h:198:108: warning: ‘visibility’ attribute ignored [-Wattributes] Added a test on gadgets (and QObjects) in unnamed namespaces, because qtbase currently does not contain such Q_GADGETs. Done-with: Thiago Macieira <thiago.macieira@intel.com> Change-Id: Ic747cc2ab45e4dc6bb70ffff1438c747b05c5672 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * QString::vasprintf(): Use quintptr when casting pointer for %p.Friedemann Kleint2016-03-091-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the macro Q_OS_WIN64 was checked, causing warnings: tools\qstring.cpp(6183): warning C4311: 'reinterpret_cast': pointer truncation from 'void *' to 'unsigned long' tools\qstring.cpp(6183): warning C4302: 'reinterpret_cast': truncation from 'void *' to 'unsigned long' when compiling WinRT/64bit, where it is not defined. Change-Id: Ib9d8405108c85170aba18b13f9c64083136bc5ee Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * QString, QJson, QHash: Fix UBs involving unaligned loadsMarc Mutz2016-03-095-6/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by UBSan: src/corelib/tools/qstring.cpp:587:42: runtime error: load of misaligned address 0x2acbf4b7551b for type 'const long long int', which requires 8 byte alignment src/corelib/json/qjson_p.h:405:30: runtime error: store to misaligned address 0x0000019b1e52 for type 'quint64', which requires 8 byte alignment src/corelib/tools/qhash.cpp:116:27: runtime error: load of misaligned address 0x2b8f9ce80e85 for type 'const qlonglong', which requires 8 byte alignment src/corelib/tools/qhash.cpp:133:26: runtime error: load of misaligned address 0x2b8f9ce80e8d for type 'const ushort', which requires 2 byte alignment Fix by memcpy()ing into a local variable. Wrap this trick in template functions in qsimd_p.h. These are marked as always- inline and use __builtin_memcpy() where available in an attempt to avoid the memcpy() function call overhead in debug builds. While this looks prohibitively expensive, from the pov of the C++ abstract machine, it is 100% equivalent, except for the absence of undefined behavior. In one case, the cast produces a local temporary which is then copied into the function, and in the other case, that local variable comes from return value of qUnalignedLoad(). Consequently, GCC compiles these two versions into identical assembler code (only verfied for ucstrncmp, but there's no reason to believe that it wouldn't hold for the other cases, too). Task-number: QTBUG-51651 Change-Id: Ia50d4a1d7580b6f803e0895c9f3d89c7da37840c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| | * Q*Application: fix UB caused by accessing QGuiApplication from ↵Marc Mutz2016-03-093-26/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCoreApplication ctor As reported by ubsan: src/gui/kernel/qplatformintegration.cpp:463:10: runtime error: downcast of address 0x7ffdc2942490 which does not point to an object of type 'QGuiApplication' 0x7ffdc2942490: note: object is of type 'QCoreApplication' src/gui/kernel/qplatformintegration.cpp:466:14: runtime error: downcast of address 0x7ffdc2942490 which does not point to an object of type 'QGuiApplication' 0x7ffdc2942490: note: object is of type 'QCoreApplication' src/gui/kernel/qplatformintegration.cpp:466:43: runtime error: member call on address 0x7ffdc2942490 which does not point to an object of type 'QGuiApplication' 0x7ffdc2942490: note: object is of type 'QCoreApplication' to name just a few which are reported when running gui and widget auto-tests; there're definitely more where these came from. This is caused by QCoreApplication::init() being called from the QCoreApplication ctor, calling virtual functions on Q*AppPrivate, which happen to attempt, in this case, to emit QGuiApp signals. At that point in time, the QGuiApplication ctor has not entered the constructor body, ergo the object is still a QCoreApplication, and calling the signal, as a member function on the derived class, invokes UB. Fix by cleaning up the wild mix of initialization functions used in this hierarchy. The cleanup restores the 1. Q*ApplicationPrivate::Q*ApplicationPrivate() 2. Q*ApplicationPrivate::init(), calling each base class' init() as the first thing two-stage construction pattern commonly used elsewhere in Qt to make sure that the public class' object is fully constructed by the time each level's Private::init() is called. Change-Id: I290402b3232315d7ed687c97e740bfbdbd3ecd1a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| | * Ensure QTextStream doesn't modify the Text flag on the underlying iodeviceLars Knoll2016-03-081-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An empty read or a failed write on the underlying QIODevice of the text stream would lead to an early return where we wouldn't correctly restore the QIODevice::Text flag of the io device. Change-Id: I5b632f45dea6ede3f408113556c3dad1b96574e2 Task-number: QTBUG-47176 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| | * Clean up WINVER, _WIN32_WINNT macros for MinGW.Friedemann Kleint2016-03-073-27/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define WINVER, _WIN32_WINNT as 0x501 (Windows XP) in qt_windows.h. Remove definitions of the same/lower versions and unneeded definitions in other places. Remove definition for Borland compiler. Task-number: QTBUG-51673 Change-Id: I2a344a7f7cf78b2afbf45dcdf8bf2a19b93f0a07 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * QtTest: fix UB in QSpontaneKeyEvent::setSpontaneous()Marc Mutz2016-03-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by UBSan: src/testlib/qtestspontaneevent.h:95:38: runtime error: member call on address 0x7ffc33019650 which does not point to an object of type 'QSpontaneKeyEvent' 0x7ffc33019650: note: object is of type 'QMouseEvent' 83 2b 00 00 98 e8 fa 8e 83 2b 00 00 00 00 00 00 00 00 00 00 02 00 04 00 00 00 00 00 00 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QMouseEvent' src/testlib/qtestspontaneevent.h:95:38: runtime error: member call on address 0x7ffc330196e0 which does not point to an object of type 'QSpontaneKeyEvent' 0x7ffc330196e0: note: object is of type 'QKeyEvent' 00 00 00 00 f8 e8 fa 8e 83 2b 00 00 00 00 00 00 00 00 00 00 07 00 04 00 00 00 00 00 00 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QKeyEvent' Fix by providing setSpontaneous() on QEvent as a private function and befriending QSpontaneKeyEvent. Make setSpontaneous() always-inline to avoid BiC between 5.6.0 and 5.6.1. Change-Id: Ic60d82ed6a858f4f13f41fa3d2d1db6e808896b7 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| | * QNX: Fix logging of QtDebugMsg in slog2 backendKai Koehne2016-03-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the introduction of QtInfoMsg in commit ef6279fd we also changed the mapping of Qt to slog2 levels: QtInfoMsg now ends up as SLOG2_DEBUG1, instead of SLOG2_INFO. Anyhow, we didn't change the default buffer verbosity level accordingly. Task-number: QTBUG-51378 Change-Id: Ia464f9e5a31e19413902e877d4f2be0ba6d340db Reviewed-by: Dan Cape <dcape@qnx.com> Reviewed-by: Janne Koskinen <janne.p.koskinen@theqtcompany.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
| | * consistently put {qt,qml}_{module,plugin} at the end of project filesOswald Buddenhagen2016-03-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: Icbce502dcbcb4d4b4d922c42679f44e2cc930bf3 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | * Revert "Don't add qmutex_xxx.cpp to SOURCES, as qmutex.cpp #include's them"Oswald Buddenhagen2016-03-071-19/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 40cbf1927bdd2fa9f531a047d1ba66f68c35d170 - the qmake parser bug this worked around has been fixed. As a side effect, the platform conditionals were simplified. Change-Id: Ibfc1253e3c2252ab954c725a9effd6e719cb691c Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | * Check if WINAPI_FAMILY_PC_APP is defined before using itOliver Wolff2016-03-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all Windows compilers (e.g. MinGW 4.9.2) have WINAPI_FAMILY_PC_APP defined in their headers and report build failures in several Qt modules including QtActiveQt. This is fixed by defining the needed values before they are used. Task-number: QTBUG-49971 Change-Id: Ib7bac1fe07eb76c64d66fa152427918ee39a2eef Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
| | * Remove QT_MOC_COMPAT from deprecated QProcess::error signalKai Koehne2016-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QT_MOC_COMPAT has the unfortunate behavior that it generates a warning at runtime, which also cannot be disabled. This is too draconic. Task-number: QTBUG-51517 Change-Id: I80af8b8b482671e4c9567281c3b1c504d737e202 Reviewed-by: hjk <hjk@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * QMimeBinaryProvider::loadMimeTypePrivate(): Make name check case insensitive.Friedemann Kleint2016-03-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 2045 mandates case-insensitive comparison for MIME type and subtype. Fixes numerous warnings appearing when dumping the database on Ubuntu 14.04.1 LTS: Got name "application/vnd.ms-excel.sheet.binary.macroenabled.12" in file "application/vnd.ms-excel.sheet.binary.macroEnabled.12.xml" expected "application/vnd.ms-excel.sheet.binary.macroEnabled.12" Got name "application/vnd.ms-excel.sheet.macroenabled.12" in file "application/vnd.ms-excel.sheet.macroEnabled.12.xml" expected "application/vnd.ms-excel.sheet.macroEnabled.12" Got name "application/vnd.ms-excel.template.macroenabled.12" in file "application/vnd.ms-excel.template.macroEnabled.12.xml" expected "application/vnd.ms-excel.template.macroEnabled.12" Got name "application/vnd.ms-powerpoint.presentation.macroenabled.12" in file "application/vnd.ms-powerpoint.presentation.macroEnabled.12.xml" expected "application/vnd.ms-powerpoint.presentation.macroEnabled.12" Got name "application/vnd.ms-powerpoint.template.macroenabled.12" in file "application/vnd.ms-powerpoint.template.macroEnabled.12.xml" expected "application/vnd.ms-powerpoint.template.macroEnabled.12" Got name "application/vnd.ms-word.document.macroenabled.12" in file "application/vnd.ms-word.document.macroEnabled.12.xml" expected "application/vnd.ms-word.document.macroEnabled.12" Got name "application/vnd.ms-word.template.macroenabled.12" in file "application/vnd.ms-word.template.macroEnabled.12.xml" expected "application/vnd.ms-word.template.macroEnabled.12" Change-Id: Ie2a427069024080302a95ac46a456288787542c4 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
| | * Fixed reading REG_SZ without terminating \0 delivers garbageDavid Weisgerber2016-03-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When reading from the registry, sometimes the string is not null terminated. In order to fix this, the preallocated QByteArray size is increased, so that there are guaranteed enough terminating \0 [Windows] Not null terminated strings are now read properly from the registry Change-Id: I95fdf42cbbb7074fcf010dd14d0241f02d3c412b Task-number: QTBUG-51382 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | * Doc: Add the missing \l command and the target section titleVenugopal Shivashankar2016-03-011-1/+2
| | | | | | | | | | | | | | | | | | | | | Change-Id: I8478467a074ecff9834850c36961ae8e218cea02 Task-number: QTBUG-51290 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>