summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* uic/Python: Fix tab stop/Z-Order and buddy handlingFriedemann Kleint2019-05-084-42/+52
| | | | | | | | | | | | | | | | | | | | | | | | The code compared the attribute names of the properties against the m_registeredWidgets hash which contained the qualified names (self.widget) and thus reported errors without actually generating anything. Replace the m_registeredWidgets hash by a lookup of the attribute name in the m_widgets hash and add a function widgetVariableName() returning the qualified variable name for an attribute name and use that for the checks. Remove unused m_registeredActions hash and rename some variables to make it clearer. Task-number: PYSIDE-797 Change-Id: Id31d95c1141d21c51eb85bcd8f8fc63486eb36a5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Windows QPA: Fix RTL window title barsFriedemann Kleint2019-05-227-23/+110
| | | | | | | | | | | | | | | | | | Add a platform option to the plugin (-platform windows:reverse) that enables reverse mode. It sets WS_EX_LAYOUTRTL on RTL windows, forces normal orientation on all HDCs created for the window, fixes ClientToScreen()/ScreenToClient() accordingly and transforms mouse events. [ChangeLog][Platform Specific Changes][Windows] It is now possible to enable RTL mode by passing the option -platform windows:reverse. Fixes: QTBUG-28463 Change-Id: I4d70818b2fd315d4e8d5627eab11ae912c6e77be Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Long live Qt::SplitBehavior!Marc Mutz2019-05-215-0/+85
| | | | | | | | | | | | | | | | | | | | | | | The is a copy of the QString::SplitBehavior enum, but scoped in the Qt namespace instead of inside QString, where it creates problems using it elsewhere (QStringView, in particular). Overload all QString{,Ref} functions taking QString::SplitBehavior with Qt::SplitBehavior. Make Qt::SplitBehavior a QFlags for easier future extensions (e.g. a hint to use Boyer-Moore searching). Added tests in QStringApiSymmetry. [ChangeLog][QtCore] Added new Qt::SplitBehavior. [ChangeLog][QtCore][QString/QStringRef] The split functions now optionally take Qt::SplitBehavior. Change-Id: I43a1f8d6b22f09af3709a0b4fb46fca61f9d1d1f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QGestureManager: don't abuse a QMap for a setMarc Mutz2019-05-211-6/+6
| | | | | | | | | | | | | | | | | | | | The filterEvents() implementations used a QMap<GestureType, int> for tracking whether a given type was already seen. The mapped_type was completely unused. Since the expected number of gesture types is very low, go directly to QVarLengthArray, not QSet, as the reduced number of allocation will dwarf the low overhead of O(N) search vs. O(1) for QSet or O(logN) for QMap. Change-Id: I98b6af69f11cca753e3c7c4fbb58e8f2e935e0d5 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QEvdevTouchScreenData: use a mutex locker instead of manual lock/unlock()Marc Mutz2019-05-211-4/+5
| | | | | | | | | | | | Extra difficulty: the lock is conditional. Not a problem with std::unique_lock, which is movable. Change-Id: Ib5515838ccb10100d5aa31163ab7f171591c04c4 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QStandardDirs: fix quadratic loopMarc Mutz2019-05-211-8/+4
| | | | | | | | | | | | | | | Instead of a bad copy of remove_if, with quadratic complexity, use an ok copy of copy_if, with linear complexity. Port to QStringRef as a drive-by. Change-Id: I47fde73b33305385835b0012f6d332e973470789 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QFileSystemWatcher: fix quadratic loop by porting away from QMutableListIteratorMarc Mutz2019-05-211-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | QMutableListIterator::remove() is linear, so called in a loop, the loop potentially becomes quadratic. Fix by porting to std::remove_if. In this case, since the old code unconditionally detached, anyway, we use remove_copy_if to build a new list. That's still more efficient than the old code, even if nothing is removed. It also prepares the code for when Java-style iterators will be deprecated. Since the same code appears in two different functions, do an Extract Method into a file-static function. Lastly, restore NRVO for most compilers by returning the same object from all return statements of the function. Change-Id: I6909c6483d8f7acfd1bf381828f020038b04e431 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QtGui: get rid of the last Java-style iteratorMarc Mutz2019-05-211-3/+1
| | | | | | | | | | | | | | | | | | Trivial. Java-style iterators are going to be deprecated. Change-Id: Ie94658be988cc095fb3b05d0d4ef6e7e3bf9a2af Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QFileSystemWatcherEngines: port some Java-style iterators to ranged-forMarc Mutz2019-05-214-53/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Java-style iterators are scheduled to be deprecated. The general pattern used in the patch is that instead of copying an input list, then iterating over the copy with some calls to it.remove() (which leads to quadratic-complexity loops), we simply copy conditionally (a la remove_copy_if instead of remove_if). To make clearer what's going on, rename the outgoing list to 'unhandled'. To avoid having to touch too much of the loops' structure, which sometimes is quite convoluted, use qScopeGuard to do the append to 'unhandled', unless the original code removed the element. Saves a surprising almost 5KiB in text size on GCC 9.1 optimized AMD64 Linux builds. Change-Id: Ifd861de9aa48d66b420858606998dd08a8401e03 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QQnxIntegration: replace a Java-style iterator with an STL-style loopMarc Mutz2019-05-211-4/+3
| | | | | | | | | | | | | Java-style iterators are going to be deprecated. Change-Id: Ia55070608d3826bd84ed5d56a593c1c4918a6063 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add private qt_make_unique as a drop-in for C++14 std::make_uniqueMarc Mutz2019-05-212-0/+72
| | | | | | | | | | | | | | | | | | | | | | | The original is much more subtle, so don't try to be a 100% replacement. Most users will be able to use std::make_unique these days. This is just a minimal implementation to enable using the functionality in the implementation of Qt libraries. In particular, it does not attempt to deal with arrays. It is therefore not proposed as public API. It is placed in a new private header, since the only header in QtCore that already includes <memory> is sharedpointer_impl.h, and that did not seem to be a good place to add it. It is probably too much of a compilation-time drain to add <memory> to qglobal.h... Change-Id: Ie206ef7ae9beb36c63aef4ec46dbde6c73e0d9f5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCharRef/QByteRef: warn when triggering the resizing operator= behaviorGiuseppe D'Angelo2019-05-195-12/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The whole reason of QCharRef/QByteRef existence is to have a magic operator=. This operator= delays the actual detach up to the moment something is written into the Ref, thus avoiding spurious detaches to the underlying string/byte array. operator= has also an extra feature, it allows this code to succeed: QString s("abc"); s[10] = 'z'; assert(s == "abc z"); This last behavior is *extremely* surprising. The problem with all of this is that this extra convenience is outweighted by the massive pessimization in the codegen for operator[]; by the maintenance burden (QChar APIs need to be mirrored in QCharRef, etc.), and, for the automatic resize, by the fact that it's an super-niche use case. Cherry on top, std::basic_string does not do that, and no Qt or std container does that. In other words: any other container-like class exhibits UB for out of bounds access. We can't just go and change behavior, though. This is something coming all the way back from Qt 2 (maybe even Qt 1), which means we can't deprecate it at short notice. This patch simply adds a warning in debug builds in case the special resizing behavior is triggered. While at it, removes some code duplication in QByteRef. [ChangeLog][QtCore][QString] The behavior of operator[] to allow implicit resizing of the string has been deprecated, and will be removed in a future version of Qt. [ChangeLog][QtCore][QByteArray] The behavior of operator[] to allow implicit detaching and resizing of the byte array has been deprecated, and will be removed in a future version of Qt. Change-Id: I3b5c5191167f12a606bcf6e513e6f304b220d675 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QPainterPath: convert manual memory management to std::unique_ptrGiuseppe D'Angelo2019-05-142-11/+7
| | | | | | | | | And default the destructor, now that it's empty. Change-Id: I868d4fa04f8e82bc35f2364073d07fa47659b89c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QPainterPathPrivate: code tidiesGiuseppe D'Angelo2019-05-141-7/+24
| | | | | | | | | | | | | | | | | * Honor the RO3, doing copies of the members where it belongs (and not in its subclass), and properly handling the refcounting by disabling the copy assignment * Clean up construction of QPainterPathData by using ctor-init-lists, getting rid of a warning because the base class copy constructor wasn't being called by the subclass' copy constructor. * Mark everything for cleanup in Qt 6. Change-Id: I143a322dc816e2e12b454a9e5ffe63f1a86009a5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix compilation error on compilers not supporting [[nodiscard]]Jędrzej Nowacki2019-05-211-4/+4
| | | | | | | | | | | | | | | | | | __warn_unused_result__ and [[nodiscard]] both are masked by Q_REQUIRED_RESULT but there are some minor differences between them. In general [[nodiscard]] is more flexible while __warn_unused_result__ can cause warnings in some contexts, for example: error #2621: attribute "__warn_unused_result__" does not apply here error #3058: GNU attributes on a template redeclaration have no effect That is a fix for regression caused by b91e6f6f40864d54903d707d7f19a9732188b670. Change-Id: Icf11b832f31e714a88536828051f4b7f348cdb36 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix build without features.timezone on macOSTasuku Suzuki2019-05-211-2/+0
| | | | | | | | It is no longer needed after bd78f57463c381203099d7939c9d37cba0341713 Change-Id: I73aceb10eab7c9fdc7d0dfbe89012df7d0110205 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* rtems: Disable features which RTEMS does not supportMikhail Svetkin2019-05-142-5/+5
| | | | | | | | | | | | | | | | | | | | | build: - shared - use_gold_linker - large file support QtCore: - systemsaphore - process - processenvironment QtGui: - clipboard - multiprocess Change-Id: I641b37d0b603bbe6f0a839019f458f8138c73d34 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qlalr: replace a QMap-wrapping OrderedSet with std::setMarc Mutz2019-05-143-96/+6
| | | | | | | | | | | Why roll your own if you can use the original. The clone was even designed to be API-compatible with std::set, so porting is trivial, except for the unholy int/size_t mismatch, which requires a few casts. Change-Id: Ieb99cbc019ef387c6901d7518d1e79585169b638 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Qt 6: unexport QCharRef / QByteRefGiuseppe D'Angelo2019-05-182-3/+10
| | | | | | | They're fully inlined classes. Change-Id: Id9e5f1a1a0b3d8ee49ba45ad2157ffa38fe265cd Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QFileSystemWatcher: lock autotest code away into a cold sectionMarc Mutz2019-05-211-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | The code contained a sizeable chunk of string parsing along with qDebug()s in the normal path of execution. That code, however, was only used for Qt's own autotests. The idea of this patch is, then, to not only move the autotest case into the cold text section (using Q_UNLIKELY), but also to completely exclude it, when QT_BUILD_INTERNAL is not set. Unfortunately, the structure of the function did not really lend itself to #ifdefing that part of the code out (production code was in the middle of non-production code), so I transformed the engine selection code into a lambda, replacing assignment with returns, and swapping the branches of the central if around to yield a single block of code that can be excluded from compilation with just one #ifdef. As a consequence, the runtime code is almost unaffected, and the function is much easier to read now. Since the test-specific code is only compiled into Qt now in developer builds, guard the tests that rely on this behavior with the same macro. Change-Id: I9fd1c57020a13cef4cd1b1674ed2d3ab9424d7cd Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Disable copies in QObjectData / QObjectUserDataGiuseppe D'Angelo2019-05-182-0/+15
| | | | | | | They're meant to be subclassed, so we need to avoid slicing. Change-Id: I384b65478f728c69aaf1edbc985b3fb4150191fe Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QScopeGuard: some cleanupsMarc Mutz2019-05-211-3/+2
| | | | | | | | | | | | | | Use qExchange() in the move ctor and pass the function object by rvalue ref. This saves one move construction and doesn't produce unexpected results. The qScopeGuard free function should take the function object by value, because it decays and because we can't create an rvalure reference in a deduced context. But once we're inside qScopeGuard, the extra object isn't needed anymore, so optimize it away. Change-Id: I94cbc45f9bf6ca086e100efd922a0b4643a81671 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QtNetwork: port away from Java-style iteratorsMarc Mutz2019-05-211-4/+3
| | | | | | | | | They are going to be deprecated. Change-Id: Ib021aad108dc021df76ae21d1db6c8a1a734893d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Fix usage of deprecated accessibility APIsFrederik Gladhorn2019-05-201-124/+119
| | | | | | | | | | | | | | | The accessibilityAttributeValue method was deprecated and all needed replacements are in macOS 10.12. The new API is nicer, since it adds a lot of individual functions instead of forcing one big switch statement on us. This makes it easier to implement further protocols. When implementing e.g. the Button protocol, the old attribute functions do not get called any more, so this is needed before implementing more features. Change-Id: I5a705edfa3f6bb0d25436df8cf5dd7f59e7e764e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS accessibility: implement accessibilityLabelFrederik Gladhorn2019-05-161-1/+17
| | | | | | | | | | We had an implementation of this based on the old attribute based API, which also works. This cleans it up and adds the setter. Change-Id: I886fc9c89ee08b9f4f9aabec00ac1a5b9a800c6f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QStateMachine: handle parallel child mode for state machinesErik Verbruggen2019-05-163-8/+43
| | | | | | | | | | | | | | | | Setting the childMode property to ParallelStates will result in an invalid state machine. This is never checked (worse, we explicitly allow it and have a constructor to set it), but it results in findLCCA failing, which then results in a failing assert or crash. This fix in this patch is to handle this case separately. The proper fix would be to remove completely the ability to set the childMode on a QStateMachine, but that will have to wait until Qt6. Fixes: QTBUG-49975 Change-Id: I43692309c4d438ee1a9bc55fa4f65f8bce8e0a59 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove dead code from qdbusintegrator.cppChris Adams2019-02-221-2/+0
| | | | | | | | This code has been there since the initial public commit, but has no effect. Change-Id: Iae80ae22a363b3bd0e6cf7706619b38edc47790f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tidy up in qdatetime.cppEdward Welbourne2019-05-151-18/+7
| | | | | | | | | | Break a line before a close-brace. Added blank lines. Remove some duplicate blank lines and spurious \fn directives. Fixed placement of & between type and parameter name in the function declarations that made these last redundant (these are the WS-only changes). Change-Id: I7ee06a7cbb4f9cb275d5ad87246d8fbc9c9b6668 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Cleanup the fallout of QWeakPointer::data() deprecationGiuseppe D'Angelo2019-05-172-4/+19
| | | | | | | | | | | | | | | | | There are still users of QWeakPointer::data(), which under certain compilers will make headersclean fail. So this patch: * ports data() to a private internalData() function and calls it from all the usage points; * adds cleanup notes for Qt 6, once some of the deprecated machinery around storing unmanaged QObjects in QWeakPointers can get removed. Change-Id: Id3bcbd23374c18a2026861c08a4dcba1670673c1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* QFileDialog: mark obsolete enum DontUseSheet as deprecatedChristian Ehrlicher2019-05-173-3/+9
| | | | | | | | | | QFileDialog::DontUseSheet is obsolete since 4.5 and not used anywhere inside the Qt code base. Mark it as deprecated and remove the last usage in the examples. Change-Id: If3d23fd5906314e6ebc7080efa79da14a2aa2720 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QtCore: mark obsolete enumerations as deprecatedChristian Ehrlicher2019-05-173-15/+29
| | | | | | | | | | | | | | | | | | | | | The following enumerations were obsolete for a log time but not marked as deprecated: - WA_NoBackground - WA_MacNoClickThrough - WA_MacBrushedMetal - WA_MacMetalStyle - WA_MSWindowsUseDirect3D - WA_MacFrameworkScaled - AA_MSWindowsUseDirect3DByDefault - AA_X11InitThreads - ImMicroFocus mark them as deprecated and remove the usage inside QtBase so they can be removed with Qt6 Change-Id: Ia087a7e1d0ff1945286895be6425a6cceaa483fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Deprecate QWeakPointer::data()Giuseppe D'Angelo2019-05-163-7/+6
| | | | | | | | | | | It's a dangerous API to have. Upgrade to a shared pointer if accessing the raw pointer is required. [ChangeLog][QtCore][QWeakPointer] The data() function has been deprecated. Change-Id: Ie5d34f4fb500b3cfa14d2c0b1b08484df072129c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add some examples to qExchange() docsMarc Mutz2019-05-161-0/+39
| | | | | | Change-Id: I758782f6566ab94006aedacc9988ec4eb09a14c6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix race in colorspace LUT generationAllan Sandfeld Jensen2019-05-163-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code did not prevent concurrent writes to the LUTs by separate threads, each finding lutsGenerated to be false. Let's consider whether the change is safe now: the storeRelease(1) comes before the QMutex::unlock(), but since it is release semantics no writes may be ordered past it. We have two releases, and their order doesn't matter, since nothing else happens in-between. Could we use a normal relaxed store? No, because the unlock() of the mutex only synchronizes with the lock() of the same mutex, which doesn't happen if the loadAcquire() succeeds. For loadAcquire() to happen-before a write to the luts, we need a storeRelease() on the atomic. So, everything is correct, and minimal. But maybe, to save the next reader from having to do the same mental exercise again, add a manual locker.unlock() in front of the storeRelease()? Again no: that opens a gap where the luts are already generated on T0, and the mutex unlocked, but the atomic not set. If another thread T1 gets to execute the function, it will enter the critical section, then writing new values to the LUT. Meanwhile, the T0 sets generate to true and a T2 enters the function, sees the final write from T0 and starts using the luts -> data race with the writes concurrently done by T1. Change-Id: Id278812a74b6e326e3ddf0dbcbb94b34766aa52e Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* macOS accessibility: Implement NSAccessibilityElementFrederik Gladhorn2019-05-152-4/+13
| | | | | | | | | | | Modern macOS accessibility is based on protocols. By implementing NSAccessibilityElement we get warnings for missing functions for the most basic accessibility functionality. Change-Id: I0595ea5b9927c5bfb4bbeff3fc9322cb1f232b9f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Add setAutoDeleteReplies to QNetworkAccessManagerMårten Nordheim2019-05-153-0/+44
| | | | | | | | | | | | | | | | Following the introduction of AutoDeleteReplyOnFinishAttribute to QNetworkRequest it seems natural to make it easy to enable for all replies created with the current QNetworkAccessManager. [ChangeLog][QtNetwork][QNetworkAccessManager] Added setAutoDeleteReplies to QNetworkAccessManager to enable the AutoDeleteReplyOnFinishAttribute attribute for all QNetworkRequests that are passed to QNetworkAccessManager. Change-Id: I7f96dd1fc9a899328e89732be17780b4e710c2a2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Introduce AutoDeleteReplyOnFinishAttribute for QNetworkRequestMårten Nordheim2019-05-153-1/+11
| | | | | | | | | | | [ChangeLog][QtNetwork][QNetworkRequest] Added the AutoDeleteReplyOnFinishAttribute attribute to QNetworkRequest, which makes QNetworkAccessManager delete the QNetworkReply after it has emitted the "finished" signal. Change-Id: I03d4ac0830137882e51dd28795a8ec817762a300 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QComboBox: do not bypass the base class' overridesGiuseppe D'Angelo2019-05-151-1/+1
| | | | | Change-Id: I01bb84a39d15231878ff267cfcb0f13167defd47 Reviewed-by: David Faure <david.faure@kdab.com>
* QSplitter: do not bypass the base class' overridesGiuseppe D'Angelo2019-05-151-1/+1
| | | | | | Change-Id: Ie58025191bb250914c13385d6e374e8d0c3f99b6 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QNetworkReply: replace a QQueue with a std::vectorMarc Mutz2019-05-152-16/+9
| | | | | | | | | | | | | | | | | | | The 'queue' was never used as a queue: it was populated, and then exchanged into a local copy to be consumed in a loop. This loop used dequeue(), but of course it could just const-iterate the container and dump it as the end, since the member variable was already reset at that point, no-one could tell the difference from the outside. So, no need for a queue. A vector will do very nicely. The loop now uses ranged-for and qExchange(), greatly simplifying the code over the old version. Add another qExchange() call as a drive-by. Change-Id: I6147453dc9edfe9500833627b123bb3a31114651 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add shortcut for select all in QSpinBoxFrederik Gladhorn2019-05-151-0/+1
| | | | | | | | This adds the shortcut to spinboxes and date edites. Fixes: QTBUG-48231 Change-Id: I91400e1990e4b1d7d971198c1e2a64149c2a835e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Liang Qi2019-05-1544-318/+724
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-05-1544-318/+724
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qfloat16.cpp src/corelib/global/qfloat16.h src/plugins/platforms/windows/qwindowswindow.cpp Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
| | * Add 'well-formated' JSON string valuesMichal Klocek2019-05-141-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for surrogate code points U+D800 through U+DFFF, represent them with JSON escape sequences. https://github.com/tc39/proposal-well-formed-stringify Change-Id: I84fea53a8ef400beebefdba10ea82dc510fe7dda Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Friedemann Kleint2019-05-1413-92/+273
| | |\ | | | | | | | | | | | | Change-Id: Id3d16035c9692af42e9c1bf512218f3c836ae2eb
| | | * macOS: Guard against display on non-main threadsTor Arne Vestbø2019-05-131-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AppKit will in some cases ask our view to display on secondary threads if we call APIs that are only supposed to be called on the main thread, such as -[NSOpenGLContext setView:] or -[NSOpenGLContext update]. Forwarding this display-request is bad, as QtGui expects all window system events to come on the main thread, and we can easily deadlock client code such as the Qt Quick threaded renderer. Change-Id: I1daeabf1dca6ca8ba908d3998b444a2089681e3a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | | * Windows QPA: Fix resize loops when moving fixed size windows between screensFriedemann Kleint2019-05-133-23/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Postpone the screen change until the DPI changed event in case a move between screens with different DPI is detected. Task-number: QTBUG-65580 Change-Id: I356f144b243d7d1ce7feabf0434c3f534b903965 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
| | | * Windows QPA: Fix window frame calculation in multi-monitor setupsFriedemann Kleint2019-05-137-60/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When introducing EnableNonClientDpiScaling() for QTBUG-53255, the window frame calculation was not adapted. That is, window frames were calculated from the style for the primary screen only, causing - minimum size constraints not being calculated correctly for applications on secondary screens when populating the MINMAXINFO structure. - warnings about not being able to apply a geometry when moving fixed size windows across screens. The calculation of the frames for propagating size hints is also no longer required after 3035400f36731c400adb9204b94e9afe346a71b7, which retrieves them from the WM_NCCALCSIZE message; QWindowsWindow::fullFrameMargins() can be used instead. For newly created windows, use the newly added AdjustWindowRectExForDpi() function to calculate the initial frame size. Change QWindowsGeometryHint from a class to a collection of static functions and add overloads to calculate the frame. In checkForScreenChanged(), update the margins until WM_NCCALCSIZE is received. Task-number: QTBUG-67777 Task-number: QTBUG-65580 Task-number: QTBUG-53255 Change-Id: Iff2d382b2b316adec6c1a0622ae8015dba6de371 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
| | | * Fix QWindow::mapToGlobal()/mapFromGlobal() for multi-screen windowsMorten Johan Sørvig2019-05-134-4/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make these functions handle the case where a window spans multiple screens, and high-DPI scaling is enabled, and the local position (in the window) is not on the window primary screen (as returned by QWindow::screen()). This is done by detecting the case, and then calculating the correct position using the native coordinate system. [ChangeLog][QtGui] QWindow::mapToGlobal()/mapFromGlobal() now handle windows spanning screens correctly. Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io> Task-number: QTBUG-73231 Change-Id: I3c31b741344d9e85e4f5d9e60bae75acce2db741 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | | * Make sure QAccessibleTableCell is valid before referenceFrederik Gladhorn2019-05-131-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are some cases (model resets in weird positions) where we would crash due to accessing invalid model indices. Fixes: QTBUG-61416 Fixes: QTBUG-71608 Change-Id: Ibfedcbd921a3145f3e1596ac424a77f2319a5c46 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>