summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Accept LFCRLF to mark end of HTTP HeadersDyami Caliri2016-03-092-4/+3
| | | | | | | | | | Some embedded servers use LF to mark the end of an individual header, but use CRLF to mark the end of all the headers. The GoPro WiFi interface does this, as an example. Change-Id: I227ab73622c84f439a6cf8703d020393c4d8bf69 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* xcb: mark mouse events from tablet devices as synthesizedShawn Rutledge2016-03-094-22/+32
| | | | | | Task-number: QTBUG-51617 Change-Id: Ic1d258c56165947ff821b1bf4d044bcf29b41a3b Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Generate QVariant::fromValue(enum_value) for enum valuesJarek Kobus2016-03-091-1/+4
| | | | | | | | Instead of just QVariant(enum_value). Task-number: QTBUG-49383 Change-Id: Id57c65b68d4328816046bc35301dc6afba47b727 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.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>
* QGestureManager: fix UB in filterEvent()Marc Mutz2016-03-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code infers from the presence of an address in a QHash<QGesture *, ...> that the address belongs to a QGesture. So far that is fine enough. But in order to perform the lookup, it static_cast<>s the QObject* argument to a QGesture* for the QHash:: contains() call. Even though the pointer is not dereferenced, the cast is UB. Says UBSan: qgesturemanager.cpp:558:73: runtime error: downcast of address 0x2ab83364f3a0 which does not point to an object of type 'QGesture' 0x2ab83364f3a0: note: object is of type 'QDBusConnectionManager' which is a particularly hideous error message because of the constantly-changing completely-unrelated actual type in the second line of the message: 52 QDBusConnectionManager 19 QSocketNotifier 14 QFusionStyle 13 QAction 6 QApplication 3 QGraphicsWidget 1 Window 1 TestRunnable 1 RectWidget 1 QTimer 1 QSingleShotTimer 1 QOffscreenSurface 1 QGraphicsProxyWidget 1 QDefaultAnimationDriver 1 QDBusPendingCallWatcherHelper This error is also _very_ common, triggered 116 times in a single run of make -C tests/auto check. Fix by using qobject_cast first and then doing the lookup only when the cast succeeded. Depending on the performance of qobject_cast<>, this may actually perform better, too. Change-Id: I884ec7d885711acc3c1d004ce93c628268d8fc18 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.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-097-32/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QCosmeticStroker: fix out-of-bounds access in drawPixel()Marc Mutz2016-03-091-5/+7
| | | | | | | | | | | | | | Found by UBSan: src/gui/painting/qcosmeticstroker.cpp:150:55: runtime error: index -1 out of bounds for type 'QT_FT_Span_ [255]' src/gui/painting/qcosmeticstroker.cpp:150:99: runtime error: index -1 out of bounds for type 'QT_FT_Span_ [255]' src/gui/painting/qcosmeticstroker.cpp:151:55: runtime error: index -1 out of bounds for type 'QT_FT_Span_ [255]' That code path makes no sense if no span has been populated yet, so skip the whole block if current_span == 0. Change-Id: I832b989e89c118dc48ab5add3a28bb44c1936a76 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Use booleans as booleans; don't compare == true to do so !Edward Welbourne2016-03-081-3/+3
| | | | | Change-Id: Ic900bf000cec52b3ebf0fd0fc61f42252f3200e6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Purge a verbose no-op.Edward Welbourne2016-03-081-4/+0
| | | | | | | | | An if with no side-effects in its test and an empty body is a no-op. An else block with nothing but a no-op in it is a no-op. A no-op without even pedagogic value is just a distraction. Change-Id: I224831a325e6b770d0a99d726d96f73da4b8c11f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Simplified repeated #if-ery and entangled conditionals.Edward Welbourne2016-03-081-9/+7
| | | | | | | | | | Three checks of the same #if managed to save repetition of (if I felt charitable) three shared lines, compared to combining the three into one, which leaves the code easier to read (and obviates the need for one of the "shared" lines). Split a long line while moving it. Change-Id: I762d10ae1df1224c749206b8eb490bafd7ea4900 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Duplicate trivial code for clarity on early return.Edward Welbourne2016-03-081-7/+4
| | | | | | | | | | Having a variable in which to store a function's return in two branches of a switch in order to return if either was true saved little relative to just testing the function in each case and returning in situ, which reads more clearly. Change-Id: Ibd95a95721eaa6fc4861b10e723038b96caf269a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@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-078-72/+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-072-9/+7
| | | | | | | | | | | | | | | | | | | | | 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>
* standardize statement order in project file a bitOswald Buddenhagen2016-03-071-2/+2
| | | | | Change-Id: I9fa42d9afa726f52390a2b01637e6f4e9b2fb537 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* fix mir platform plugin nameOswald Buddenhagen2016-03-071-1/+1
| | | | | | | | all platform plugins are supposed to start with a q. Change-Id: I4871cc553995aa68a09f8f045bdd378f5022cd87 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
* remove redundant TEMPLATE assignmentOswald Buddenhagen2016-03-071-1/+0
| | | | | | | qt_plugin.prf does that already. Change-Id: Ia0329c3b508c86c2b71782a4e9744cfda528559a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* consistently put {qt,qml}_{module,plugin} at the end of project filesOswald Buddenhagen2016-03-0766-274/+264
| | | | | | | | 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>
* QCoreTextFontDatabase: Get rid of local fallbacksForFamily cacheKonstantin Ritt2016-03-071-7/+1
| | | | | | | | The centralized one (in QFontDatabase) does the job. Change-Id: I33def7a7bcddeaa62b904d8812321a7f4648a9d0 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Increase chances of finding the ellipsis glyph in elided textKonstantin Ritt2016-03-071-2/+1
| | | | | | | | The glyph for the ellipsis could be absent in the main font, so we should try to find it in a fallback font; otherwise fall back to "...". Change-Id: Ic53060ed42f3c800aba055d2be2a1c7c3cfeec64 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Bundled HarfBuzz: simplify the built-in shapers list configurationKonstantin Ritt2016-03-071-50/+56
| | | | | Change-Id: If7819b5b6ad23e319bfedeb4c9e1e12054b216a7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* QCompleter: QMatchData: init all fields in default ctorMarc Mutz2016-03-061-1/+1
| | | | | | | | | Found by UBSan: src/widgets/util/qcompleter_p.h:130:8: runtime error: load of value 249, which is not a valid value for type 'bool' Change-Id: I0529e54e17a6f4d6add91786a2d5687f2d043531 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* QPlatformPrintDevice: fix uninit'ed member variableMarc Mutz2016-03-061-0/+6
| | | | | | | | | Found by UBSan: src/printsupport/kernel/qplatformprintdevice.cpp:370:10: runtime error: load of value 196, which is not a valid value for type 'bool' Change-Id: I184e5bf5e4917eeb492b54fe87950bcf03421887 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Make use of defaultDropAction in QListView icon modeSamuel Gaist2016-03-062-2/+7
| | | | | | | | | | | | | | | Before this patch, using setDefaultDropAction on QListView in icon mode would not have any effect. Now the drag behaves properly. The default action is set to CopyAction rather than IgnoreAction to keep the current behavior and avoid breaking user code. [ChangeLog][QtWidgets][QListWidget] Fixed a bug that caused the default drop action to be ignored when using icon mode. Task-number: QTBUG-15741 Change-Id: I49654cde382af344ffc4594699303c928e27e05d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Make an implicit grab on TouchBegin for a widget subscribed to a gestureAlexander Volkov2016-03-052-8/+45
| | | | | | | | | | | | | | | | | | | | | A receiver of TouchUpdate and TouchEnd events is determined either as a widget which has an implicit grab for the touch point or as a visible widget if there are no implicit grabs. The events are sent if the receiver has accepted TouchBegin event or if it is subscribed to a gesture. Before sending the events to the widget they are delivered to the gesture manager. Thus, in order to detect gestures for the widget, it must own an implicit grab or be a visible widget. It can happen that the parent widget is subscribed to a gesture, but doesn't accept TouchBegin event, as in the case of QScrollArea. Then it will not get an implicit grab and gesture detection will be impossible. Activate an implicit grab for such widgets. Also don't send TouchUpdate and TouchEnd to them, because it's against the documentation. Task-number: QTBUG-43277 Change-Id: Id767583991def6d76c48ad15eb39af822cad115d Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Silence the warning: Unhandled client message: "_GTK_LOAD_ICONTHEMES"Thiago Macieira2016-03-053-3/+7
| | | | | | | | Qt Creator keeps printing that warning. Change-Id: I0c94a5c2846b48c8aea7ffff1435775f04234656 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* ODBC: Fix a memory leak when open() fails.HyungDon Lee2016-03-051-1/+6
| | | | | | | | | When connection or login fails, the ODBC SQL driver was leaking memory. This bug has been present since Qt 4.8 and up. Task-number: QTBUG-51334 Change-Id: Ie17f3d575a08d47e047a65d1b30af9ce0789b2d0 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* Fix MIPS DSP optimized fetchUntransformedAllan Sandfeld Jensen2016-03-051-3/+3
| | | | | | | | These have been wrong since being introduced in 5.3. Change-Id: I5b4aa198c8d4c6726f1c5097abe8d43275722dab Reviewed-by: Ljubomir Papuga <ljubomir.papuga@imgtec.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix UB in QFontEngineFT::loadGlyph()Marc Mutz2016-03-051-1/+1
| | | | | | | | | | | | | | | Reported by UBSan: src/gui/text/qfontengine_ft.cpp:1079:54: runtime error: null pointer passed as argument 1, which is declared to never be null The default-constructed QScopedArrayPointer is not reset() in every code path. In fact, in the code path leading to this memset, the only reset() call is in the if block right above it, so move the memset into the if block. Change-Id: I1f793c313ca56f3315c6bdd55456cb025cafc089 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* QWheelEvent: make NoScrollPhase opt-inShawn Rutledge2016-03-057-4/+31
| | | | | | | | | | | | | | | | | | | | | | | The fix for QTBUG-50199 involves adding an undocumented enum value which can be returned from QWheelEvent::phase(). This will be quite unexpected for applications that use it, which work fine with 5.6.0 and then start receiving this new phase value in 5.6.1. So it should not happen by default. Set the env variable QT_ENABLE_MOUSE_WHEEL_TRACKING to enable this functionality. In 5.7 it will be default behavior. But in 5.6 the default behavior is as it was before: if you use a conventional mouse wheel, the phase stays at ScrollUpdate continuously. [ChangeLog][QtCore] QWheelEvent::phase() returns 0 rather than Qt::ScrollUpdate when the wheel event comes from an actual non-emulated mouse wheel and the environment variable QT_ENABLE_MOUSE_WHEEL_TRACKING is set. In Qt 5.6, this is required to enable the fix for QTBUG-50199. Change-Id: Ieb2152ff767df24c42730d201235d1225aaec832 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Expose the number of X screen through the QXcbScreenFunctionsAlexander Volkov2016-03-055-1/+72
| | | | | | | | | | | X screen corresponds to Qt virtual desktop, and RandR output corresponds to QScreen. There can be more than one X screen, so we need a way to get the number of X screen for QScreen, in particular for the right implementation of some methods in QX11Info. Change-Id: Ib5e38703bf11ae08bb283f26a7b7b15f1a5e8671 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Fix GCC 6 -Wunused-functions warningsMarc Mutz2016-03-053-29/+0
| | | | | | | | | GCC 6 is able to identify member functions that are unused. Remove them. Change-Id: Ic77548164b38a1cd3c957d2c57a5bccb979bc02e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fixing the SQLite3 build for WEC2013 again.Andreas Holzammer2016-03-042-1/+36
| | | | | | | | | | The new version broke the build again -> fix it again. (cherry picked from commit af2f3bde4866005d512d694f205231714d6e25b3) Change-Id: Ifcc33fbd9f7d7e98901de5130a67501ba19d9895 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
* Fix application fonts with DirectWrite font engineEskil Abrahamsen Blomfeldt2016-03-043-72/+19
| | | | | | | | | | | | | | | | | | | | | | There is no way to add fonts to the system font collection with DirectWrite. Instead you have to write custom collections. But that would mean keeping two instances of the same font data in memory since we are already registering them for the GDI engine, and we have no way of knowing which engine will be used. When we at some point replace the GDI engine completely, we could implement this in the proper way, but for now, instead of looking up the equivalent to the LOGFONT in DirectWrite's system font collection, we look it up using GDI and then convert the HFONT to DirectWrite. [ChangeLog][Windows][Text] Fixed disabling hinting for application fonts, e.g. when automatic scaling by device pixel ratio is in effect. Task-number: QTBUG-18711 Change-Id: I5c1365ab956dfa23d4d687877d7440473ee03bb0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* DirectWrite: Output correct error code on failureEskil Abrahamsen Blomfeldt2016-03-041-2/+2
| | | | | | | | | GetLastError() does not return the correct error code for the DirectWrite functions, they are returned by the function itself. Task-number: QTBUG-18711 Change-Id: I3931f58bb29a5f2dc4a5aa911ff16a873267d185 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* xcb: resourceType names must have only small lettersBłażej Szczygieł2016-03-041-1/+1
| | | | | Change-Id: I563ae26c9e7e6111399fd0b9af7bfb3ff750b34a Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* [Windows] Blacklist AMD FirePro V5900 cards for angle.Michael Bruning2016-03-041-0/+12
| | | | | | | They seem to cause crashes on Windows 7 and 8. Change-Id: I6e91a195077313610a79358d6787ed211357b56a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@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>
* Cocoa integration - do not invalidate backing store on moveTimur Pocheptsov2016-03-041-1/+3
| | | | | | | | | If window is only moving, there is no reason to reset a backing store, otherwise with current expose/flush events machinery it's possible to have glitches while moving a window programmatically. Change-Id: Ia4408bd23388e529ae93617a92ae84304b707ca1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Fix compile with clang and -Werror.Milian Wolff2016-03-031-2/+0
| | | | | | | | | | | | | | Fixes the following warning/error: src/sql/drivers/sqlite2/qsql_sqlite2.cpp:142:19: error: unused variable 'initial_cache_size' [-Werror,-Wunused-const-variable] static const uint initial_cache_size = 128; ^ 1 error generated. Change-Id: I4ed7f789561dd9b68dd374c122f4db3813e63e05 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
* Don't create accessible interface for QWidgets being destroyedGabriel de Dietrich2016-03-021-0/+9
| | | | | | Change-Id: I975ee556913707e8595b2a89f1bba4299187bcfb Reviewed-by: Wayne Arnold <wayne.arnold@autodesk.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@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>
* Windows: Extract the suffix from the simple file filter caseAndy Shaw2016-03-021-3/+6
| | | | | | | | Since the filter can either be something like "*.txt" or "Text Files (*.txt)" then it should have the suffix default to "txt" in both cases. Change-Id: I36a72f5bf0fb12c84db103f91c4fca94d0d933ae Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* QAbstractSocket: fix a possible crash in waitForReadyRead()Alex Trotsenko2016-03-021-4/+3
| | | | | | | | waitForConnected() could return 'true' even when the socket was disconnected. Change-Id: I99d9c9730f4e9b6c8a54696eb92c24c3ef36d261 Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>