summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* platform plugins: Remove unused former overridersAlexander Volkov2016-12-223-14/+0
| | | | | | | | They were implied to override QPlatformIntegrationPlugin::keys() but it was removed before releasing Qt 5.0. Change-Id: Ia1f1ad27b7511b1141887f5dcde0dadeb2e5cabf Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* fix sysrootification of install pathsOswald Buddenhagen2016-12-222-16/+15
| | | | | | | | | | | | | | | | | | | | | initially, the idea was that QLibraryInfo would receive a pre-sysrootified ExtPrefix from the builtin qt.conf. matching this against the sysroot would then tell us whether to sysrootify the Prefix from a "regular" qt.conf as well. however, this would have lead to some major ugliness and inconsistency between the code paths, so i changed my mind. unfortunately, i failed to adjust the remaining code, leading to 169a40d51 entirely breaking sysrootification ... the proper (and nicely consistent) solution is to introduce a SysrootifyPrefix key to qt.conf. this is user-accessible as well, so as a bonus it is now possible to adjust the setting at qmake installation time. incidentally, this omission was the last thing that prevented using the same qmake host build for any imaginable configuration of the same qt version ... i think. Change-Id: Ic0eebf21f93651f6374628c0ad8b206d696a4a7e Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Silence maybe_uninitialized warning with gcc -OgAllan Sandfeld Jensen2016-12-213-4/+4
| | | | | | | | | | GCC produces false positives for maybe_uninitialized when compiling with -Og in these three places. Simply initialize the variables to silence it. This should be entirely cost-free for normal compilation. Change-Id: Iab778a6ba25993f78f190e928c1fcc2dbd8b2fcd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* macOS: Take DPR into account when creating CGContexts for a QPixmapTor Arne Vestbø2016-12-211-0/+2
| | | | | | | | | Missing logic when refactoring image manipulation methods into QtGui in c52bb030907. Task-number: QTBUG-57723 Change-Id: I7b55d4451d35faf5fd794daa0b80acbd712f30cd Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* QLockFile: make sure we encode the hostname as UTF-8 in the lock fileDavid Faure2016-12-211-11/+2
| | | | | | | | | | | | | | | | | | | | We chose to use UTF-8 as it allows us to ensure there's no mistaking the hostname in case the locale is changed, if the host name contains characters outside of US-ASCII. But this didn't work because the code that wrote the hostname always used the local 8-bit codec instead of UTF-8. On Unix, we used the result of gethostname(3) directly, which is supposedly on the locale codec. This commit doesn't fix Windows, which requires _wgetenv, the plan being to encapsulate that with a qEnvironmentVariable() method. [ChangeLog][QtCore][QLockFile] Fixed a bug that caused QLockFile not to recognize a stale lock file if the machine's hostname contained non-US- ASCII characters, on Unix. A Windows fix is still pending. Task-number: QTBUG-49640 Change-Id: Ib9d045544ff370ec901626658a84ec4e6575fe21 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QIPM: Persist model indexes after emitting layoutChange, not beforeStephen Kelly2016-12-211-9/+9
| | | | | | | | | | | | Callers can persist a QModelIndex which was not persisted before in a slot connected to the signal, and such a persisted index must be updated in the course of the layoutChange. Store the indexes to persist after emitting the signal. Task-number: QTBUG-32981 Change-Id: Ibee4c0d84817d72603a03fe5b22fdeefeac0695e Reviewed-by: David Faure <david.faure@kdab.com>
* QSFPM: Remove data manipulation from move handlersStephen Kelly2016-12-211-55/+12
| | | | | | | | | | | | Similar to the fix in the parent commit, incorrect updating of the internal data structures during layout changes can lead to dangling pointers being dereferenced later. Moves are treated as layoutChanges by this proxy by forwarding to the appropriate method. However, data is incorrectly cleared prior to that forwarding. Remove that, and let the layoutChange handling take appropriate action. Change-Id: Iee951e37152328a4e6a5fb8e5385c32a2fe4c0bd Reviewed-by: David Faure <david.faure@kdab.com>
* QSFPM: Fix handling of source model layout changeStephen Kelly2016-12-211-20/+11
| | | | | | | | | | | | | | | | | | | | | | | In sourceLayoutAboutToBeChanged the source model update is ignored if the affected parents are filtered out anyway. The same logic is attempted in the sourceLayoutChanged slot, but there the early-return logic is applied too late - the mapping is cleared before performing the early-return. Because pointers into the mapping are used in the internalPointer of QModelIndexes in this class, persistent indexes used later will segfault when attempting to dereference it. Additionally, if a parent becomes invalid as a result of the layoutChange, it would be filtered out by the condition in the loop, resulting in a different result in the comparison of emptiness of the parents container. Fix that by persisting the parent's container, and performing the test for early-return before clearing the mapping. Task-number: QTBUG-47711 Task-number: QTBUG-32981 Change-Id: If45e8a1c97d39454160f52041bc9ae7e337dce97 Reviewed-by: David Faure <david.faure@kdab.com>
* Doc: Updated code sample to match documentation of QCompleterSamuel Gaist2016-12-201-1/+1
| | | | | | | | | | The QCompleter documentation mentions QFileSystemModel while the code sample still uses QDirModel. This patch fixes this by updating the code sample. Change-Id: I99a0d2419efcf781af3e9530508df088d77fbbfa Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Avoid using QRgba64 for buffersAllan Sandfeld Jensen2016-12-201-33/+33
| | | | | | | | | | | | Benchmarking showed most time rendering in rgb64 mode was spend on memsetting the buffers because they were not declared with a primitive type. This patch changes the buffers to quint64, but leaves refactoring function arguments to a later patch in the dev branch. Change-Id: Iacc81b0d8e9570b1975dffb85c955b0aabb096a7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* fix typos in "ras[p]berry pi"Oswald Buddenhagen2016-12-201-2/+2
| | | | | Change-Id: I2d8910df9266d9cbf2426e5f2ba2a88eb2e821ef Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Silence implicit-fallthough warningsAllan Sandfeld Jensen2016-12-192-2/+3
| | | | | | | Fixes Werror build with GCC 7. Change-Id: Ie0e9fb907af545b6c200558faaaf83b8ec058b7a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Update model-view documentation about layoutChangedStephen Kelly2016-12-181-3/+16
| | | | | | | | | | | This has always been true, but hasn't been documented well enough, so triagers are giving incorrect information in bug reports (eg QTBUG-47711 and QTBUG-53221). That incorrect information is being treated as truth by Qt users which take action based on incorrect information. That is a problem, so try to make the documentation clear. Change-Id: I4e44a9a0675cdd7d9289ec209ae32d5a92899fc9 Reviewed-by: David Faure <david.faure@kdab.com>
* Make the bearer QFactoryLoader a member variable, not a staticThiago Macieira2016-12-172-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Because it was a function-level static, the QFactoryLoader was getting destroyed out-of-sync with the bearer thread stopping. Under normal conditions, the thread stopped first (~QApplication / ~QCoreApplication via qAddPostRoutine), and the static got destroyed when the process exited. However, if QApplication leaked or if the destruction order is wonky (as seen in PyQt5), the thread could still be running when the plugins were already unloaded. With the loader a member variable, it gets destroyed when the thread stops. Note: in Qt 5.7, QFactoryLoader no longer unloads the plugins (since commit 494376f980e96339b6f1eff7c41336ca4d853065), so this crash cannot happen in that version. [ChangeLog][QtNetwork][Bearer management] Fixed a bug that could cause a crash on application exit, depending on the order of destruction of the QCoreApplication object and the QtDBus manager thread. Task-number: QTBUG-56228 Task-number: QTBUG-52988 Change-Id: I33dc971f005a4848bb8ffffd147853376f82de2a Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix build on Windows: winsock2.h requires WIN32_LEAN_AND_MEANThiago Macieira2016-12-173-0/+8
| | | | | | | | This is required for the next commit. Change-Id: I73fa1e59a4844c43a109fffd148c8c3e3a100c79 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix race condition in QFactoryLoader: lock the mutex we already haveThiago Macieira2016-12-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The process of loading a plugin is examplified by the qLoadPlugin function (though not all users of QFactoryLoader use this function, they all do something similar): const int index = loader->indexOf(key); if (index != -1) { QObject *factoryObject = loader->instance(index); if (FactoryInterface *factory = qobject_cast<FactoryInterface *>(factoryObject)) if (PluginInterface *result = factory->create(key, std::forward<Args>(args)...)) return result; } QFactoryLoader::indexOf already locked the mutex, but not QFactoryLoader::instance. This commit fixes that. Note that calling the virtual create() in the plugin's factory is not protected by the mutex. Each plugin's factory must be thread-safe and also create an object that works on any thread too. It's also the responsibility of the caller of qLoadPlugin to ensure that it's called thread-safely. Task-number: QTBUG-42855 Change-Id: I63e21df51c7448bc8b5ffffd148ebee33d4c47de Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QTestLib: Add timestamp to mouse click eventsPeter Varga2016-12-161-2/+13
| | | | | | | | | | | Timestamp is necessary for testing custom mouse event handlers e.g. what Qt WebEngine uses for handling triple and quadruple mouse clicks. Based on commit 181ee8f9ffacc51265ccc3a0005bf146f230cf85 Task-number: QTBUG-56223 Change-Id: I2bf840f326255333eec83ca8c42f087cb7deb1fb Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Merge remote-tracking branch 'origin/5.8.0' into 5.8Liang Qi2016-12-1656-399/+808
|\ | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/plugins/platforms/android/qandroidplatformopenglcontext.h src/plugins/platforms/android/qandroidplatformtheme.h Change-Id: I13d51cc66f708138ff4d667ceea7d515992e58a4
| * Silence platformheaders syncqt warning about qt_egl_p.hv5.8.0-rc1Laszlo Agocs2016-12-162-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop the include for qt_egl_p.h. For Qt itself this should have no effect since platform plugins including this header include EGL headers on their own anyway. Similarly, applications relying on such advanced functionality will likely include EGL/OpenGL headers on their own - the point is anyhow to interoperate with native, non-Qt EGL and GL code. This avoids a lot of hassle since normally no EGL (or other winsys interface API) bits are exposed in the public Qt APIs, and thus there are no public headers provided to set up EGL headers in the same way Qt does internally. Change-Id: Icdbc28811b753799abc06085bc8dff7f09bdbff9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * fix directfb build without EGLOswald Buddenhagen2016-12-161-1/+2
| | | | | | | | | | | | Task-number: QTBUG-57176 Change-Id: I174828e0657e244b060df6223650091a06ecd980 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| * QCocoMenu: Fix patch b2f78b796b5b73d4Gabriel de Dietrich2016-12-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | A null pointer check was accidentally removed while refactoring the code. Change-Id: I547936671bd134bb7df710a4b123a0d731076bf2 Task-number: QTCREATORBUG-17438 Task-number: QTBUG-57404 Task-number: QTBUG-57657 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * Work around old Clang bug parsing of NSDMI referring to membersThiago Macieira2016-12-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Clang pre-3.4 didn't like this and it's used in Xcode 5.1 (which we need to support for 5.8). error: 'this' cannot be implicitly captured in this context typename T::const_iterator i = c.begin(), e = c.end(); ^ Task-number: QTBUG-57488 Change-Id: I63e21df51c7448bc8b5ffffd148e688d7c9b89d6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * Re-fix build error with ICC 17 on WindowsThiago Macieira2016-12-152-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a repeat of ae880beb7d02141c5097ef61409fa66b2c910dd3, which had fixed the problem for ICC 16. That commit was a repeat of acf80b9a2b913e898ed4c4ed14d4ea79401484fe, which had fixed it for ICC 15. As reported in ae880beb7, ICC doesn't like polymorphic exported classes with inline constructors. That commit added the default constructor, but we forgot the copy constructor. This constructor should have been protected, so users are forced to use the virtual clone() function, but we can't make it so in Qt 5 because MSVC encodes the protection and has exported the inline function in debug builds. qsvgiconengine.obj : error LNK2001: unresolved external symbol "const QIconEngine::`vftable'" (??_7QIconEngine@@6) Change-Id: I427336c52fc342638c74fffd149033b990ea7ade Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Update Ministro's urlBogDan Vatra2016-12-151-1/+1
| | | | | | | | | | | | Task-number: QTBUG-57645 Change-Id: I014b1926c9b91e085baa5df563dc4cc06fe0596c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * winrt: Check for removed timers after sending eventsOliver Wolff2016-12-151-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After all the check makes sense here. If a timer was removed as a result of sendEvent and it was not at the end of the list the list is not shrunk but the timer info's id is just set to INVALID_TIMER_ID. Additionally the timer's object should be fetched before we unlock the locker as timerIdToObject is changed in removeTimer and we might access a nullptr if the timer has been removed. Reverts c83ba01f7bc542368973f3f24dfb59c6052dd78a Task-number: QTBUG-56756 Change-Id: Ib1a04c02fbfcf4c939b4891d42f954dc9e87149e (cherry picked from commit 8f2088db171a6941feb1903a2912a8b7fdf3a9ec) Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * qdoc: Define Q_COMPILER_UNICODE_STRINGSTopi Reinio2016-12-151-0/+16
| | | | | | | | | | | | | | | | | | | | | | Some public functions in QString and QDebug are declared inside Q_COMPILER_UNICODE_STRINGS. This commit defines it for QDoc, and adds documentation for QDebug functions that are now visible to QDoc. Change-Id: Ia7f2501c1dc7b8244dcc3ce4adcd2019fdbffcb6 Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Fix qtlibpng being built despite system libpng being foundJames McDonnell2016-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | 90eee08b made system-png a subset of png, which is strictly speaking a porting error. However, as this is a good idea as such, fix it by adding the missing !system-png check. Change-Id: I1557a2130a22ac668be315dc9aea67845928ff4c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
| * Android: fix (partially) text deletion when the cursor is movedBogDan Vatra2016-12-134-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - wait until the handle location changes the cursor position - don't update cursor position if: * a batchEdit is in progress * the UpdateSelection is blocked - finish the composing before update the cursor - add the missing .java files There are still corner situations when the text gets deleted/moved, but those are pretty rare and they will be fix in another patch. Task-number: QTBUG-57507 Change-Id: I230d7f64625fb556e1be3069694a71e9bc91323a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| * Fix gcc 6.4 buildsAllan Sandfeld Jensen2016-12-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The builtins clzs and ctzs have been removed. Additionally they were never proper internal GCC builtins and shouldn't have been used in a constexpr function in the first place. This patch removes the assumption that they exist when BMI is available, and let GCC fall back to using __builtin_clz and __builtin_ctz. Change-Id: I3e0b4e246098bb9ce6ede28b311948260ef881b9 Task-number: QTBUG-56813 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Re-fix the build with ICC and cmath & math.hThiago Macieira2016-12-101-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit c35fef9d3b8bb77a7f303e3cd62c86cd00e57f5b wasn't sufficient. The problem is that there's a complex combination of libc headers (math.h), C++ headers (cmath), which may be provided by three different sources on Linux (glibc, gcc and ICC). On some combinations, the isnan macro leaks from math.h or cmath and that's what the the commit above tried to fix. On some other combinations, there's no macro but there's an ::isnan function defined. When we do "using namespace std; return isnan(x);", that causes a compilation error. This commit solves that by detecting whether there is a macro defined. error: more than one instance of overloaded function "isnan" matches the argument list function "isnan(double)" function "std::isnan(double)" argument types are: (double) Change-Id: Iaeecaffe26af4535b416fffd148bf71826541bdd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Doc: QPointingDeviceUniqueId: Fix documentation warningTopi Reinio2016-12-091-1/+1
| | | | | | | | | | | | | | | | | | Fix the following warning by adding a const qualifier: warning: No documentation for 'QPointingDeviceUniqueId::isValid()' Change-Id: I1ebeda8f45e88efb7cb844b67409352c695e6354 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Android: Add missing overrideAlexander Volkov2016-12-0921-142/+142
| | | | | | | | | | | | | | Change-Id: I70b802517d8f7d129ffb71dc3e92cb2458a55acc Reviewed-by: BogDan Vatra <bogdan@kdab.com> (cherry picked from commit e3ad43843a6ddb20c901b6fba85c12fb0e6c5651) Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * Android: remove unused variableBogDan Vatra2016-12-092-3/+0
| | | | | | | | | | | | | | Fix compilation with -Werror Change-Id: Iae6068f9eeb92dd1a96b11f6bb7017b97a8486fb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * REG: Fix missing glyphs with DirectWrite and stretch == QFont::AnyStretchEskil Abrahamsen Blomfeldt2016-12-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | A stretch equal to 0 is since 5.8 defined as "accept the stretch of the font", and this needs to be accounted for in the font engines. Task-number: QTBUG-57491 Change-Id: Idabbe44677c4b92cbd8ad8278b054de53e9cc7f9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * QGtk3Dialog: don't crash on WaylandJ-P Nurmi2016-12-091-4/+6
| | | | | | | | | | | | | | | | | | | | | | Check if it's an X11 window before calling XSetTransientForHint(). No transient parent will be set for GTK+ dialogs on Wayland. That has to be implemented separately. Task-number: QTBUG-55583 Change-Id: Iabc2a72681c8157bb2f2fe500892853aa397106b Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * winrt: Fix input grabbingMaurice Kalinowski2016-12-084-3/+106
| | | | | | | | | | | | | | | | | | Beside its usage in widgets, mouse grabs are required for QML menus to work. Task-number: QTBUG-57079 Change-Id: I306cb68624186da69725470e147bc7b979dac8e4 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| * QPointingDeviceUniqueId: remove deprecated numeric() and constructorShawn Rutledge2016-12-081-9/+0
| | | | | | | | | | | | | | | | | | Followup to 0484473: this is all new stuff for 5.8 and we don't need to release it with pre-deprecated functions. Task-number: QTBUG-54616 Change-Id: If17a4bec6fc36ca78d87517992374f101ae13b4f Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * Merge remote-tracking branch 'origin/5.7' into 5.8.0Liang Qi2016-12-0814-88/+99
| |\ | | | | | | | | | Change-Id: I576187a9905802c177ae483e6c29d0f55cf7034d
| | * Merge remote-tracking branch 'origin/5.7.1' into 5.7Liang Qi2016-12-071-10/+21
| | |\ | | | | | | | | | | | | Change-Id: Ic2cdbd0c826bd63f545479495fa095ec666ddd5a
| | | * Fix the JPEG EXIF reader to deal with some broken/corrupt filesv5.7.1Thiago Macieira2016-12-011-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We parse the EXIF header in order to get the proper orientation, so let's be a bit more careful in what we accept. This patch adds better handling for reading past the end of the stream, plus it limits the number of IFDs read (to avoid processing too much data) and deals with a pathological case of the EXIF file format: EXIF (due to its TIFF origins) permits the offset to the next IFD to be backwards in the file, which means it could result in a loop or pointing to plain corrupt data. We disallow any backwards pointers, since it seems that's what other decoders do (libexif, for example). Change-Id: Iaeecaffe26af4535b416fffd1489332db92e3888 (cherry picked from 5.6 commit 02150649f95b8f46f826e6e002be3fa0b6d009bc) Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | | * Prevent stale QOpenGLContext fbo pointerMorten Johan Sørvig2016-11-112-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is logic for clearing the qgl_curent_fbo pointer in release(), but it is not always called, causing the pointer to become stale on QOpenGLFramebufferObject deletion. As a last resort, clear the qgl_curent_fbo pointer on the current context if it’s pointing to the object that is being deleted. Change-Id: I0a91d686cec5fcbe4c1520a9ba96cea833bb2249 Task-number: QTBUG-56639 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| | | * macOS: Clear event dispatcher interrupt stateGabriel de Dietrich2016-11-089-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A pending interrupt of a QEventLoop may interfere with native runModal calls, resulting in Cocoa's main event loop to be stopped unexpectedly. After commit 9ab60b9c processEvents() no longer resets the event dispatcher interrupt flag. Add QCocoaEventDispatcher::clearCurrentThreadCocoa EventDispatcherInterruptFlag(). Use it to clear the interrupt state before calling runModal and variants. Work around the inability to use platform API in the print support code. Change-Id: I3e03e7ec21ff6c49442c7a6e803a7200aac0b58d Task-number: QTBUG-56746 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| | | * Apple OS: Handle QSetting strings with embedded zero-bytesTor Arne Vestbø2016-10-214-16/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Saving strings with embedded zero-bytes (\0) as CFStrings would sometimes fail, and only write the part of the string leading up to the first zero-byte, instead of all the way to the final zero-terminator. This bug was revealed by the code-path that falls back to storing e.g. QTime as strings, via the helper method QSettingsPrivate::variantToString(). We now use the same approach as on platforms such as Windows and WinRT, where the string produced by variantToString() is checked for null-bytes, and if so, stored using a binary representation instead of as a string. For our case that means we fall back to CFData when detecting the null-byte. To separate strings from regular byte arrays, new logic has been added to variantToString() that wraps the null-byte strings in @String(). That way we can implement a fast-path when converting back from CFData, that doesn't go via the slow and lossy conversion via UTF8, and the resulting QVariant will be of type QVariant::ByteArray. The reason for using UTF-8 as the binary representation of the string is that in the case of storing a QByteArray("@foo") we need to still be able to convert it back to the same byte array, which doesn't work if the on-disk format is UTF-16. Task-number: QTBUG-56124 Change-Id: Iab2f71cf96cf3225de48dc5e71870d74b6dde1e8 Cherry-picked: 764f5bf48cc87f4c72550b853ab93b815454cd48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| | | * Windows: Fix regression in QFSFileEnginePrivate::nativeWrite()Andy Shaw2016-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 0696566b1e19c8178e00c0d14f185935e17d9e8b caused the block size to be incorrect for data > 32MB. Since bytesToWrite changes within the do...while loop, then the block size can potentially change too each time. So it needs to be recalculated each time rather than just once. Task-number: QTBUG-56616 Change-Id: I9880d0985f2d0242c30e67230be7271eb806db95 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 683c9bc4a8e656b2251871b9d8c9952e58681a52)
| | * | ~QHttpNetworkConnectionPrivate - disconnect from socket's signalsTimur Pocheptsov2016-12-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a 'channel' object connected to a socket with Qt::DirectConnection. QHttpNetworkConnectionPrivate in its dtor (note, it's a private object destroyed after its 'q' - QHttpNetworkConnection - was destroyed) calls socket->close() and this can end up in socket setting an error and emitting (for example, in QSslSocket::transmit). The slot (QHttpNetworkConnectionChannel::_q_error) will access the now-dead/non-existing connection then. So disconnect the channel from the socket early, before closing the socket. Task-number: QTBUG-54167 Change-Id: I3ed4ba4b00650c3a39e5c1f33aa786e47bfbbc57 Reviewed-by: Konstantin Tokarev <annulen@yandex.ru> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * | Remove unnecessary warning disablingThiago Macieira2016-11-271-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt 5.7 cannot be compiled in C++03 mode anymore. Change-Id: Iaeecaffe26af4535b416fffd1489d808edc3c996 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * | QtGui: Add missing overrideAlexander Volkov2016-11-2710-73/+73
| | | | | | | | | | | | | | | | | | | | Change-Id: Ief5b0863d7649d5a8d421c05766513276c264776 Reviewed-by: hjk <hjk@qt.io>
| | * | Make sure all pattern args get cleared when parsing a new patternThiago Macieira2016-11-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user can call qSetMessagePattern after program start, so we need to be sure that the parsed argument data is properly cleared. Task-number: QTBUG-57144 Change-Id: I1978c6b95bd84639a8c4fffd1487429b04725522 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| * | | moc: force the Microsoft compiler not to define _MSC_EXTENSIONSThiago Macieira2016-12-081-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This re-fixes commit d72ac3f35f4c6d6405e9675d54124b3ddb8d80ab, which simply removed the #define but did so at the wrong place. Instead of forcing the macro to be removed, let's simply not have it defined in the first place. Change-Id: Ie6dbad9bbbd9488887e8fffd148dd67d9a31b32e Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| * | | QCocoaMenu: Don't rely on tags when we can get the actual NSMenuItemGabriel de Dietrich2016-12-081-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -[NSMenu itemWithTag:] clearly states that it'll return the first item with that tag. Furthermore, when and item has been synced more than once, it could be that more than one such item exists in the same menu (e.g. lately changing the role of Edit->Copy). Change-Id: I95a4f0a151659ae273ba03a3cab4a720b781fc3a Task-number: QTBUG-57404 Reviewed-by: Jake Petroules <jake.petroules@qt.io>