summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Pull several structs and static functions into an anonymous namespaceEdward Welbourne2017-11-301-22/+24
| | | | | | | | | | The implementation of QWinTimeZonePrivate used many static functions and at least one struct; to which I've added. Put these all into an anonymous namespace (thereby keeping the struct types out of the linker's sight): make them local the C++ way, rather than the C way. Change-Id: Ibdce0865234b5d4ebbdc90628cc4d9e790ed6321 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fake a "first transition" at the start of timeEdward Welbourne2017-11-301-0/+9
| | | | | | | | | | | | | | QTimeZonePrivate::dataForLocalTime() needs a transition before the time it starts at; MS's time-zone data tends to omit old zones (before 2007, in the case of Win7 for Casablanca - which had interesting transitions before that), so all we can do is extrapolate backwards from there; but a first rule is indeed apt to be a no-transition rule, describing the zone's status up to the first known transition. So fake a "start of time" transition to return for this case, that describes this prefix of history. Change-Id: Iaf178cbebc3b1e599cbde3437a0af75d9f6ca432 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid underflow on arithmetic with possibly-first transition timesEdward Welbourne2017-11-301-2/+2
| | | | | | | | | | A transition time may represent the beginning of time; as such, arithmetic on it might underflow, e.g. on adding a negative zone offset to compare with a given time. So move the arithmetic to the other side of the comparison in such cases. Change-Id: I1697a03ebf74679ff86059664dd2b173b9c4c367 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Take account of single-transition hacks in MS time-zone APIsEdward Welbourne2017-11-302-17/+106
| | | | | | | | | | | | When a year contains a real change of standard time without any DST, MS's APIs still claim to have both a DST start and a DST end; one of them is bogus and positioned on the start (or end) of the year, producing no change in offset from the end of the previous (or into the start of the next) year. So code round that. Task-number: QTBUG-42021 Change-Id: Ieb6161cfb77db8a57dc181097f117316f9d1c13c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QWinTimeZonePrivate: make transition searches more efficientEdward Welbourne2017-11-301-125/+83
| | | | | | | | | | Iterate rules (now that there's fewer of them than years) with only a secondary iteration on years (when needed - in which case it should never need more than two iterations). In particular, avoid iterating years to the MIN_YEAR and MAX_YEAR extremes on failure; fail faster ! Change-Id: I354af8e0cb1e484c8abda279991e6e1824f9f7d4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Refine handling of wMonth checks in QWinTimeZonePrivateEdward Welbourne2017-11-301-6/+28
| | | | | | | | | | | | | | | | | The MS API documents that the two TIME_ZONE_INFORMATION date fields either both have wMonth clear (when there is no DST) or both have it set (for each part of a DST pair). This rule is followed even when there's a standard time change without DST, with perverse results I'll deal with in a later commit. Add code in init() to verify the rule is followed and qWarning() if not. A year with no transitions doesn't imply no earlier or later year has transitions, so don't give up on searches for transitions because of it. Also fix a potential uninitialized variable bug, related to data() breaking out of a loop on such a year. Change-Id: I1ad86c07e54b2eb835a2e02d18dc64022f52a0d9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tidy up QDateTimeParser code to make it easier to reason aboutEdward Welbourne2017-11-301-9/+10
| | | | | | | | | | Note that the relevant cases are all numeric, eliminate a redundant variable (the min of two others, one of which was provably <= the other), invert and rename a boolean (that was always used negated), eliminate a case that couldn't arise (and assert this). Change-Id: I9ef9cedbeb608c7cd56ddc618ddfb921966edfbf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTimeParser: reject all short values in fixed-width fieldsEdward Welbourne2017-11-301-1/+2
| | | | | | | | | | | | | | | | | | | | Previously, a 1, 2 or 3 for "dd" would be rejected because 10, 20 or 30 would fit in the field and be valid; but 4 or more was accepted, even though it was too short for the field, because no suffix could make it valid within the field-width. [ChangeLog][QtCore][QDateTime] When parsing dates and times from strings, fixed-width date-time fields, such as a "dd" for day, QDateTime now rejects all values that should be padded, rather than only doing so when the value is a prefix of some value that would fill the field-width. Use a single letter for the field, e.g. "d" for day, if you want to accept short values. (QDateTimeEdit is not affected.) Task-number: QTBUG-63072 Change-Id: I22d223c50057c3edab4ef7f01d9ed0f58e9139c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Raise the upper bound on years to 9999Edward Welbourne2017-11-304-6/+6
| | | | | | | | | | | | | | | | | Test-case taken from bug-report; fits in as an easy row in an existing data-driven test. Add similar tests for date-time and time; and an isValid test on the end of year 9999. The date-time parser was using the end of year 7999 as maximum value for dates and date-times; extend this to year 9999, as I can see no reason not to. [ChangeLog][QtCore][QDateTime] Years up to 9999 can now be parsed without error (previously 8000 and beyond were treated as invalid) in all formats (not only in ISO format). Widgets handling dates now support dates to 9999, likewise. Task-number: QTBUG-64401 Change-Id: I518cfa6c2cb4ecc5a85b896dc9e56b4fdd8a8bb1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mutex-lock QLocale's update of its globalLocaleDataEdward Welbourne2017-11-301-6/+17
| | | | | | | | | For want of this, nothing that used QLocale::system(), inter alia, could be thread-safe or re-entrant. Task-number: QTBUG-49473 Change-Id: I3e017aa7d59c4c39828bb5cdc7ff0780ea66bafe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Optimize QThread::isInterruptionRequested()Marc Mutz2017-11-302-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To signal a thread to cancel, nothing more than a std::atomic_flag is needed, but the implementation actually used mutexes, and weird run-state introspection, so we can't just swap it out for a std::atomic_flag. Instead, we retain the principal logic, however weird it is, and just optimize the common case where isInterruptionRequested() is called from the secondary thread, repeatedly. We add a fast-path that just checks that d->interruptionRequested is not set. That requires nothing more than a relaxed atomic load, because there's no new value read that could be used as a signal to the secondary thread that some condition changed. "What signal?", you may ask. Well, one can think of users doing this: void cancel() { m_why = tr("&Canceled"); requestIterruption(); } void run() override { while (!isInterruptionRequested()) { doWork(); } emit progress(100, 100, m_why); } We need to keep this code working, at least until Qt 6. But the code can already now only rely on synchronization if isInterruptionRequested() returns true. If it returns false, then requestInterruption() has not been called, yet, and any modifications done prior to the requestInterruption() call are not visible in the secondary thead. So we still lock the mutex, and in general don't change the semantics of the functions, except that we don't lock the mutex in the case where the flag wasn't set in the first place. This makes calling isInterruptionRequested() as cheap as it can get, assuming a lock-free implementation, of course. I opted to use a std::atomic<bool> instead of QAtomicInt, as the latter does not have loadRelaxed()/storeRelaxed(), and because it future-proofs the code. Change-Id: I67faf36b8de73d2723f9cdd66c416010d0873d98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QSortFilterProxyModel: Clear persistent indexes on source model changeChristian Ehrlicher2017-11-301-1/+4
| | | | | | | | | | | When a new source model was set to QSortFilterProxyModel, the model tried to remap the persistent indexes to the new model which was wrong. The correct solution is to clear the persistent indexes with _q_sourceModelDestroyed() since the old source model went away. Task-number: QTBUG-44962 Change-Id: Id39e9ac83324250e8bfa434aae467a9206d2590e Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* QItemSelectionRange: speedup intersects() in negative caseChristian Ehrlicher2017-11-301-4/+6
| | | | | | | | | | | | | | QItemSelectionRange::intersects() needs to check if the parent of both QItemSelectionRanges is the same. This is a very expensive operation which should be done last. Same goes for isValid() which itself calls parent() for two indexes. This rearrangement speeds up some worst-case usecases by at least 30% as shown in the bug report. Task-number: QTBUG-60940 Change-Id: If6111a73cb8b97a8a0d0640527b34448d21f3143 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Replace qrand() engine with C++11 <random> LCG and deprecateThiago Macieira2017-11-301-83/+59
| | | | | | | | | | | | | | | | Instead of trying to adapt to whatever the C library may have and using QThreadLocalStorage, let's use a simple linear congruential generator engine from <random>. We can't use a single instance because qsrand() is documented to work per thread. I thought of using QRandomEngine, but had to make the choice between growing the QtCore code size and growing the per-thread data size. Code is sharable and is actually smaller than the sizeof(QRandomEngine), which is over 2500 bytes. sizeof(std::minstd_rand) is just sizeof(uint_fast32_t). Change-Id: I0a103569c81b4711a649fffd14ec8e641d02bf20 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* qtest_gui.h: remove incorrect #ifdefGatis Paeglis2017-11-301-3/+0
| | | | | | | Originated from 6c06e14a49773ce5572935864ed6b9be219c610 Change-Id: Id93f33c8a00850c7b41593c85521d75e5293b36b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* qtestmouse: do not qWait for mocked events on macOSGatis Paeglis2017-11-302-15/+7
| | | | | | | | | | | | | | | | | | | | This logic initially was copied from QTest::mouse* widget overload (by d130382776e8b9db491385a0db45a3daaa79890c) which uses QCursor::setPos() to generate mouse move events via the windowing system. The QCursor API was later removed by 1762bf3394219db3a7a9cc99306f4111e6cb8492, but now the redundant qWait logic remained. Later this stray qWait was incorrectly moved to apply for all mouse event types (by 268f41ec70fd70d4aa44a5043d1a4e678df4c5b5), when originally it was needed (arguably) only for mouse move events due to usage of QCursor. This patch also removes the waitForEvents() function as it is not a documented qtestlib API (in qtestlib only the documented functions should be considered public API, no matter what you can find in the header files). Removal does not affect binary compatibility as this is not an exported symbol. And if somebody has used this non public API, updating code is trivial. Change-Id: Id1dec10f5cf276cee1ac0e8c8f8ba2edc493b667 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Create a QNX version of calculateUnixPriorityJames McDonnell2017-11-301-0/+54
| | | | | | | | | | | | | | | The standard calculateUnixPriority provides values that are almost invariably inappropriate with even LowestPriority mapping to something higher than the priority of any other thread on the system. [ChangeLog][QtCore][QThread] Changed how Qt thread priorities are mapped to QNX system thread priorities. Task-number: QTBUG-53357 Change-Id: I205035c4ca7dcafabda7a9a9b06cc52c67c6d2b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Mark some functions as coldMarc Mutz2017-11-303-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | Add Q_DECL_COLD_FUNCTION (__attribute__((cold))) to tell the compiler that the following functions are not usually executed in normal programs: - qWarning/qCritical/qFatal - qTerminate - assertion failure - qBadAlloc The effect of the attribute is that 1. These functions get put into their own section, .text.unlikely, and will be optimized for size, not speed. 2. Conditions that lead to one of these functions are automatically marked as unlikely (something we have done manually in the past) 3. (anecdotal) the compiler is less likely to inline these functions Text size effect of this change over all of QtBase: ~27KiB text size saved, of which 11KiB in QtCore alone. Change-Id: If308d4a4b9ff8f7934316c54b161a78ebe3f4205 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThread::requestInterruption(): move qWarning() out of critical sectionMarc Mutz2017-11-301-4/+4
| | | | | | | | | | | | | We do not touch anything mutex-protected in the path towards the qWarning(), so the mutex lock is not needed. It may actually be harmful, since a message handler may check isInterruptionRequested(), which would then deadlock. Otherwise, we're just decreasing the size of the critical section — always a worthwhile goal. Change-Id: I26aa7e3dc087ff7efaccff1d4dc788ba00ba183f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* doc: document the anonymous enum type correctlyMartin Smith2017-11-301-12/+78
| | | | | | | | | | | clangqdoc now accepts an unnamed enum type, calls it "anonymous" and allows it to be documented as a named enum type. In this update, several instances appear in subclasses of QGraphicsItem. This update documents them correctly. Change-Id: Ide8026801269154a37e7677a1ce62e0cb392efea Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* QTreeWidget::setHeaderItem: fix off-by-one in signal emissionsGiuseppe D'Angelo2017-11-301-4/+4
| | | | | | | | | | | | | | | | | | | When setting a header item (that is, the item that provides the QTreeWidget's column) the widget needs to manipulate the underlying tree model and add or remove columns. This requires calling the right QAbstractItemModel APIs for structural model changes. The calculations done resulted in a off-by-one error: * if the model had N columns and needs to grow to M(>N), then one needs to begin insertion from N to M-1 (and not M); * if the model had N columns and needs to shrink to L(<N), then one needs to begin removal from L to N-1 (and not N). Add the -1s needed. Change-Id: Ic669788825a1c480376a08df0d7c9c10f91552ef Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* QTreeWidgetItem::insertChildren: ignore out of bounds indexesGiuseppe D'Angelo2017-11-301-0/+3
| | | | | | | | | | | | | | | | QTreeWidgetItem::insertChildren should behave like a more-optimized QTreeWidgetItem::insertChild. Unlike the latter, the former lacks out-of-bounds checks, resulting in successful insertions even when using an invalid index (say, bigger than the row/column count). Reintroduce some sanity checks instead. This allows to fix a "fixme" left in the autotest. [ChangeLog][QtWidgets][QTreeWidgetItem] QTreeWidgetItem::insertChildren now ignores insertions happening at invalid indices, for consistency with QTreeWidgetItem::insertChild. Change-Id: I1532597768cc6aff96a6e8f356bc6075b582801d Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Liang Qi2017-11-3039-313/+338
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-3039-313/+338
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/thread/qsemaphore.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Id35b535e88df63fdfe4007ea92ed4a39c4b6d707
| | * Correct \since value for QIODevice::skipAndy Shaw2017-11-291-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I9a2f18263a8bc0a0de8978792dbb1f285acc0ccd Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * iOS: Don't set background color when debugging window managementTor Arne Vestbø2017-11-291-1/+0
| | | | | | | | | | | | | | | | | | | | | It will fill the view in some cases, obscuring what Qt draws. Change-Id: I9ca00dddd829a28fb2cb3b009bfd3223f85ef7cb Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| | * iOS: Use environment variables for debug flags instead of QObject propertiesTor Arne Vestbø2017-11-284-21/+2
| | | | | | | | | | | | | | | | | | | | | | | | The former is more idiomatic in Qt, and doesn't require as much boilerplate to set up. Change-Id: Idf03af4018611c8eb3b31af90da72f9d85617b2c Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| | * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-288-168/+172
| | |\ | | | | | | | | | | | | Change-Id: Iede384644c3df5ee01b701806dfdb586dd6bb138
| | | * QUdpSocket: Work around WSARecvMsg quirk relating to no control blockThiago Macieira2017-11-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WSARecvMsg does not return the sender in WSAMSG::name if WSAMSG::Control isn't set. This makes no sense, so I'm assuming it's an API quirk we need to work around. [ChangeLog][QtNetwork][QUdpSocket] Fixed a regression from Qt 5.9.3 caused by an apparent Win32 API quirk we triggered when using readDatagram(), resulting in an invalid QHostAddress sender address. receiveDatagram() was not affected. Task-number: QTBUG-64718 Change-Id: I71488efd29b645f7b228fffd14f9d84cc205c4b3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * Initialize QLoggingRegistry rules on first useTor Arne Vestbø2017-11-253-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows categorized logging before QCoreApplication has been created, which otherwise would silently fail to output anything because the category would never be enabled, despite QT_LOGGING_RULES being set. Change-Id: I1861e5366ea980dff2ffa753b137276c77278eee Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | | * Merge "Merge remote-tracking branch 'origin/5.9.3' into 5.9" into ↵Thiago Macieira2017-11-252-151/+158
| | | |\ | | | | | | | | | | | | | | | refs/staging/5.9
| | | | * Merge remote-tracking branch 'origin/5.9.3' into 5.9Liang Qi2017-11-232-151/+158
| | | | |\ | | | | | | | | | | | | | | | | | | Change-Id: I9add7e07ff1b6a1cf52f59dbb8319f30e114e5fc
| | | | | * No debugging and extra env & params processing on sealed packagesv5.9.3BogDan Vatra2017-11-161-148/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A "sealed" package is a *release build and signed* Qt for Android package with no debugging capabilities. By default sealed packages have no debugging capabilities, but the user can force debugging capabilities also on a sealed package. This is useful in corner cases when the user really needs to debug a sealed package. Change-Id: I840526092556067f2659facf1525861bbabe0edd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | | | | * QSemaphore: fix regression when the timeout < 0Thiago Macieira2017-11-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue was introduced by eaee1209f0ead5be786e81db8aee604ccfea85b0, so it affected only 5.9.2. [ChangeLog][QtCore][QSemaphore] Fixed a regression that would make tryAcquire() not to wait forever if the timeout was a negative value. Note: new code is advised to only use -1 to indicate "forever", as some other functions taking timeout periods do not accept other values. Task-number: QTBUG-64413 Change-Id: I57a1bd6e0c194530b732fffd14f58fce60d5dfc9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | | * | | QFlags: support enum classes in setFlag()Giuseppe D'Angelo2017-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unary ~ is not defined for enum classes, so we need a cast. Change-Id: I79d495ebcc24ab960da8dae3be08eb307a9de448 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * | | Handle HostNotFoundError correctly for HTTP/2Timur Pocheptsov2017-11-241-8/+8
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When processing host lookup error if-statement only checks the connection type SPDY, which is not right - it could also be HTTP/2. As a bonus: QT_NO_SSL conditional inclusion is not needed - HTTP2 can be 'clear text' and SPDY enumerator is defined even in no-tls build (and is just a noop here). Also, improve our somewhat cryptic message in 'Should not happen' else branch - 'cannot dequeu' says nothing about HostNotFoundError. Task-number: QTBUG-64721 Change-Id: Ib0346b8717c2dbddaffab690298f3cae01e338ea Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | | [android] Fix compile with -warnings-are-errorsBogDan Vatra2017-11-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused variable Change-Id: I64da66da0c17131de6280660576f2789696e86b3 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
| | * | | improve QLocale::formattedDataSize docs slightlyShawn Rutledge2017-11-241-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I42aaec6d54299d906bf8e2ef1fd696f121b7c2d0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * | | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-2320-69/+130
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstandardpaths_win.cpp src/plugins/platforms/ios/qioswindow.mm src/plugins/platforms/ios/quiview.mm tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: I5deb0a0176a454a9c566e924d074ba60ce04f0bc
| | | * | Windows: Resolve QStandardPaths config location without qApp instanceTor Arne Vestbø2017-11-221-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling QCoreApplication::applicationDirPath() requires an app instance, but on Windows the implementation just relies on qAppFileName(), which does not require any instance. As resolving the standard paths could be needed before QCoreApplication instantiation, e.g. for categorized logging, we use qAppFileName() directly. Change-Id: Id882cebd528bcb8e945e73a83f1dc3d599b74d1d Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| | | * | iOS: Take UIWindow bounds into account when making window fullscreenTor Arne Vestbø2017-11-221-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an app is in split-view mode, the app can't use the full bounds of the screen, but should limit its area to that of its UIWindow. Task-number: QTBUG-48225 Change-Id: Ia66ad6bba24d9d73a8263ad3f65b9dee9b8a1b37 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * | QHeaderView: Simplify and fix layoutChange handlingStephen Kelly2017-11-221-24/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A layoutChange indicates that anything can have moved to anywhere else, including as a result purely of new items being added. It can also indicate that items are removed. The old code here incorrectly assumed that the section count remained constant over this operation by setting the size of the oldSectionHidden QBitArray - whose size is the size before the layoutChange operation - and then calling setBit with model rows numbered after the layoutChange operation. As the two are not necessarily the same dimensions, this can result in asserts from the setBit call. Simplify the handling of layoutChanged entirely by clearing section information, and using the QPersistentIndexes which indicate hidden state to restore that state after re-population. Task-number: QTBUG-53221 Change-Id: I3cda13e86b51b3029b37b647a48748fb604db252 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| | | * | QTreeView/Fusion style : Draw child indicator correct in RTL-modeChristian Ehrlicher2017-11-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fusion style did not honor direction option when drawing the child indicator. This lead to a wrong rendering of QTreeView in right-to-left mode. Task-number: QTBUG-63396 Change-Id: I2d5de03d7c831e3caabcc9269617eecb9338f163 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * | Fix the build when AVX2 is enabled but __F16C__ isn't definedThiago Macieira2017-11-221-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If -mavx2 is used, __AVX2__ is defined, which enables the F16C code after commit 280e321e52fd4e86545f3f0d4bd4e047786a897e, but that was wrong since we aren't allowed to use the F16C intrinsics with either Clang or GCC (we can only do that with GCC 4.9 and Clang 4.8, and only with an __attribute__ decoration). With ICC and MSVC, we are allowed to use the intrinsics, but the #include was missing. [ChangeLog][QtCore] Fixed a compilation issue with qfloat16 if AVX2 support is enabled in the compiler. Since all processors that support AVX2 also support F16C, for GCC and Clang it is recommended to either add -mf16c to your build or to use the corresponding -march= switch. Task-number: QTBUG-64529 Change-Id: I84e363d735b443cb9beefffd14b8ac1fd4baa978 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | | * | CMake: Set SKIP_AUTOMOC/AUTOUIC where neededKevin Funk2017-11-222-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure we don't run into warnings for CMake 3.10 Task-number: QTBUG-63442 Change-Id: Ida004705646f0c32fb4bf6006036d80b1f279fd7 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Sebastian Holtermann <sebholt@xwmw.org> Reviewed-by: Rolf Eike Beer <eb@emlix.com>
| | | * | Start from the first visible item when doing a searchAndy Shaw2017-11-221-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the first item in a treeview might be hidden, start from the first visible item in the view when starting or wrapping round during a keyboard search. Task-number: QTBUG-63869 Change-Id: I202bea567c6d4484c3ffaf8a5f9af8ea2e13708d Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
| | | * | Code cleanup in QNAMFilipe Azevedo2017-11-221-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The private class already store a QNetworkConfigurationManager and networkSessionRequired so it's not need to compute them again nor to instantiate temporary classes. Change-Id: I1bbd9439afa70c950ed6ec3e4fc63ddae4a5b259 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * | iOS: Add logging of window geometry/exposureTor Arne Vestbø2017-11-213-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I6ffc7cd1dde4fadd3e952deabe9c3a1dbce7884d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * | iOS: Make sure FBOs are cleaned up in the right QIOSContextTor Arne Vestbø2017-11-211-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 655687d84d6a591422 shuffled things around, moving the logic to connect to the window's destroyed signal from backingFramebufferObjectFor into makeCurrent. Unfortunately backingFramebufferObjectFor was the one taking care of recursing into the root context (when shared contexts were in play), so the end result was that the root context were keeping track of the FBO, but the leaf context was trying to clean up the FBO. Task-number: QTBUG-56653 Change-Id: I80ed71a3dedeb7611b2aa7548d94b9fbe0e20763 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * | qpa: Teach handleApplicationStateChanged about sync/async deliveryTor Arne Vestbø2017-11-205-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using QWindowSystemInterface::SynchronousDelivery reduces the chance that we are flushing other events before delivering the application state change. Those other events may conclude that the application is still active, while in reality it is not, and do bad things. Change-Id: I738c162fac22d2cd18de1e080bcd2cda78ec3f77 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>