summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QMainWindow: don't grow memory when modifying tabbed docks while hiddenVolker Hilsheimer2020-04-241-0/+9
| | | | | | | | | | | | | | | | | | | QMainWindow tries to avoid memory allocations by caching tab bars that are no longer used. That cache is populated when the layout is activated. The layout might never be activated when the main window is never shown, in which case adding and removing dock widgets at runtime will continuously allocate more memory for tab bars that are created. A workaround is to call QMainWindow::layout()->activate() explicitly in application code, once all dock widgets have been removed. This change avoids that applications have to do that. Change-Id: I70eb585d2120f0b7b73f59c3ee65d7242c12ec59 Fixes: QTBUG-83135 Pick-to: 5.15 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Don't send QEvent::Hide to an already hidden top level widgetVolker Hilsheimer2020-04-241-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | When hiding a popup by clicking outside of its area, a window is closed. Depending on the platform specific implementation details, this can result in multiple calls to QWidgetPrivate::setVisible(false). The first one from the handling of the close event in QWidgetWindow::event; the second from the destruction of the window in QWindow::event. Since the first call already sets the Qt::WA_WState_Hidden flag before calling QWidgetPrivate::hide_helper, we can test if the flag is set and skip the second call if it is. The included test does not reproduce the issue, as that issue only reproduces if the close event is generated by the mouse event handling in the Cocoa platform plugin (which doesn't call QWidget::close, but rather sends a native close event to the platform window). However, it verifies that the fix doesn't introduce any regressions. Change-Id: Id0eda9326a8adf0cc1f6a3840f9ac0b635ab39a1 Fixes: QTBUG-79134 Pick-to: 5.15 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove deprecated ApplicationAttribute enum valuesVolker Hilsheimer2020-04-244-38/+3
| | | | | | | | In the declaration, leave them in as comments so that the gaps in the numbering of the values doesn't create confusion. Change-Id: I92ff299416896c471e7c7d80b988cd4642b6b756 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move QMargins operator| into qmargins.h, add equivalent for QMarginsFVolker Hilsheimer2020-04-243-19/+48
| | | | | | | | | | | | | | | Addresses FIXME comment in qwidget.cpp, where the operator is being used. Add documentation, make constexpr and add noexcept as for the other operators. As a drive-by, remove invalid const from return type in the documentation of the other operators. They all return a non-const QMargins object. Change-Id: I5a9ca82978d38acd02e03ec00ca202fe1b8cf6c1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QListWidget/View: Update the selection when moving items within the viewVolker Hilsheimer2020-04-242-42/+45
| | | | | | | | | | | | | | | | | | The code for doing that existed in the QListWidget::dropEvent override, and was only using standard itemview APIs to adjust the selection model. There is no reason why dropping items internally in a QListView should not do the exact same thing. As part of moving the code from QListWidget to QListView, replace QList with QVector, and other minor optimizations. [ChangeLog][QtWidgets][QListView] Moving selected items within a list view by drag'n'drop will maintain the selection of those items. Change-Id: Ie24bec38234839dcb2f0b0ee0302cc59ca101631 Fixes: QTBUG-83084 Pick-to: 5.15 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QChar: port low-level functions from uint/ushort to char32/16_tMarc Mutz2020-04-243-85/+169
| | | | | | | | | | | | | | | | | | Now that the standard gives us proper types for UTF-16 and UTF-32 characters, use them. Will eventually make the code much easier to read than today, where uint could be an index as well as a char32_t. It also ensures that the result of e.g. QChar::highSurrogate() can still be implicitly converted to a QChar now that the QChar(non-characater-integral-types) ctors are being made explicit. [ChangeLog][QtCore][QChar] All low-level functions (e.g. highSurrogate()) now take and return char16_t instead of ushort and char32_t instead of uint. Change-Id: I9cd8ebf6fb998fe1075dae96c7c4484a057f0b91 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* QString: add append, op+=, prepend, insert taking QStringViewMarc Mutz2020-04-242-0/+49
| | | | | | | | | [ChangeLog][QtCore][QString] Now supports appending, prepending and inserting QStringViews. Change-Id: I7538c050c67590f27d91443eda0b94a4b80b62f2 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clarify ResetNotification in QSurfaceFormat a bitLaszlo Agocs2020-04-242-1/+12
| | | | | | | | | | Add some more details to make it a bit easier for advanced users to grasp what this is about. Task-number: QTBUG-80257 Pick-to: 5.15 Change-Id: I9969b5b62384a25d5e90b57ef25c83a8a2a6c9c7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QUrlIdna: re-enable NRVOMarc Mutz2020-04-241-2/+2
| | | | | Change-Id: Id4f9b14f4255c661a0313ca18b0c5af5c55880e7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Deprecate QGuiApplication::fontChanged() signalAndy Shaw2020-04-243-12/+16
| | | | | | | | | | | | | | Rather than have a fontChanged() signal which can be connected to for tracking when the application font has changed, then it is better to use the event that is sent to all windows and the application itself. That way it is easy for a window/widget or item that cares about the change to the application font to catch it in the event() function. [ChangeLog][QtGui][QGuiApplication] Deprecated fontChanged() signal in favor of QEvent::ApplicationFontChanged. Change-Id: Iae8e832238fc85e385a52305bc04f16e597454b0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Remove mentioning of QXmlSimpleReader from QXmlStreamReaderKai Koehne2020-04-241-6/+4
| | | | | | Pick-to: 5.15 Change-Id: Ieba073c21f666421ab519089e0976880e67ad0b1 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Fix compilation of thee OCI driverLars Knoll2020-04-241-1/+1
| | | | | | | Amends change befd198c15b7a2b95f539372d2557063b6b397a6 Change-Id: I11cc116d31fa1f71acd9579e60a6b265811def1e Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* CMake: Allow sqldriver plugins to be built as standaloneLeander Beernaert2020-04-241-0/+16
| | | | | | | | | | | | | This patch allows all the sqldrivers to be built as a standalone project. It is not possible to build each plugin separately due to the configuration features definition being located in the sqldriver's folder CMakeLists.txt. In other words, the project needs to be generated from the src/plugins/sqldrivers/CMakeLists.txt file. Fixes: QTBUG-82962 Change-Id: If41c7e3827589391830a894a9c998d2e56239562 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QUrl: fix implicit int->QChar conversionMarc Mutz2020-04-231-1/+1
| | | | | | | They're becoming explicit. Change-Id: I1221ee8fb3b373a991ddedc66a50f5d3b501876f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QFuture: the result type doesn't have to be a default-constructibleVitaly Fanaskov2020-04-231-13/+2
| | | | | | | | | | | Added asserts to insure the invariant declared in the documentation. Canceled future object is not valid, hence we don't need to handle this case separately. Fixes: QTBUG-83389 Change-Id: Ib0653ef40cd3135574a91740e4ce2c6dc4da8a71 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QWidget: fix regression when changing focus proxy while it has focusVolker Hilsheimer2020-04-231-6/+5
| | | | | | | | | | | | | | | | | | | | | | | This follows up on commits 3e7463411e549100eee7abe2a8fae16fd965f8f6 and 947883141d9d8b3079a8a21981ad8a5ce3c4798e. The changing of the pointer of QApplicationPrivate does not transfer focus properly. It updates the pointer, but it doesn't deliver events or update the widget hierarchy's focus chain. The result is that multiple line edits might show a blinking cursor. Instead, use QWidget::setFocus when the focus proxy has changed while it had focus, and pass OtherFocusReason rather than NoFocusReason. Add a basic test for QWidget::focusProxy, which exercises this code path and verifies that pointers are consistent when focus changes as a side effect of modifying the focusProxy. Change-Id: I15a4d868bab2b590cfe4a1daa6a3c8cebc9c9ca2 Fixes: QTBUG-83720 Fixes: QTBUG-79707 Pick-to: 5.15 Reviewed-by: David Faure <david.faure@kdab.com>
* vkmemalloc: make it compile with macOS 10.15 SDKLaszlo Agocs2020-04-232-1/+66
| | | | | | | | | | | | Simply rename the function in order to not clash with aligned_alloc() that is marked as 10.15 only (and thus would need annotation etc.) in the 10.15 SDK. (note that aligned_alloc is a C11 function which was presumably not present in earlier SDKs, by renaming our own version everyone will be happy, hopefully) Change-Id: Iee400d81df6a0af4fa2129358ed27b049720685b Pick-to: 5.15 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Take mip size into account for render target sizeLaszlo Agocs2020-04-237-8/+27
| | | | | | | | Also extend autotesting, both for rendering into a given mip level and for rendering into a given cubemap face. Change-Id: Ida94b71150477ceb50a3b5616d8b7be13174558b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-238-53/+86
|\ | | | | | | Change-Id: Iaa439ba7dff19a17e3716b3d30f49f60fa6e38f8
| * Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Liang Qi2020-04-222-0/+4
| |\
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2020-04-222-0/+4
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3a6d8df5219653b043bd642668cee193f563ec84. That change is only for 5.14. Conflicts: src/plugins/platforms/wasm/qwasmeventtranslator.cpp src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/wasm/qwasmopenglcontext.cpp src/plugins/platforms/wasm/qwasmscreen.cpp Change-Id: Ib9151e199291fe6eb4151027b515393c05303d65
| | | * QAuthenticator: Reset the authentication challengeMårten Nordheim2020-04-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both Negotiate and NTLM are conditioned on the 'challenge' being empty when starting the authentication process. So let's reset it when we start the authentication process. Fixes: QTBUG-83370 Change-Id: I41af6d5bcfe3dd980ca2bedce10ceff4f61047ff Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * Merge remote-tracking branch 'origin/5.14.2' into 5.14Qt Forward Merge Bot2020-04-215-21/+22
| | | |\ | | | | | | | | | | | | | | | Change-Id: I11019c23d949af45f0be814ab894dee602fb1b1a
| | | | * Revert "wasm: Specify event targets by CSS selectors; Support emsdk >= 1.39.5"v5.14.2Morten Johan Sørvig2020-03-274-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c6da278271a2a3627b7a9933776cbdffc5bd2f23. This was a 5.15-only change which should not go into 5.14 since it raises the minimum supported emsdk version. Task-number: QTBUG-83098 Change-Id: I9e15952803f9dfff89b5b4e9caeff5c03dabca27 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | | | * widgets: Re-calculate focus frame style option after setting new geometryTor Arne Vestbø2020-03-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-83019 Change-Id: I75d3d93732cb0c5a5b7350f19f0227998bda4791 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * | | | Standardise language about quoted text in date/time format stringsEdward Welbourne2020-04-221-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Iaaeff8cd28a23b878ca07d716e67d4bd9fbb8176 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | | | Handle specified time-spec in date-time parsingAndrei Golubev2020-04-226-39/+68
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a date-time was parsed from a string, the result was equal (as a date-time) to the correct value, but had (at least in some cases) the wrong spec, where it should have had a spec reflecting the zone specifier parsed. The time-spec imposed for the benefit of QDateTimeEdit is now moved from QDateTimeParser to QDateTimeEditPrivate, which takes over responsibility for imposing it. QDateTimeParser assumes Qt::LocalTime in member functions (where applicable) and uses the time-spec parsed from the string when constructing the date-time. QDateTime::fromString() and QLocale::toDateTime() are updated to use the full QDateTime returned by QDateTimeParser. Fixes: QTBUG-83075 Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I8b79add2c7fc13a200e1252d48dbfa70b36757bf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-04-2298-960/+839
|\ \ \ \
| * | | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-2298-960/+839
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/widgets/qabstractbutton.cpp src/widgets/widgets/qbuttongroup.cpp src/widgets/widgets/qbuttongroup.h src/widgets/widgets/qsplashscreen.cpp tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp tests/benchmarks/opengl/main.cpp Needed update: src/plugins/platforms/cocoa/CMakeLists.txt Change-Id: I7be4baebb63844ec2b3e0de859ca9de1bc730bb5
| | * | | Doc: Fix documentation warnings for Qt CoreTopi Reinio2020-04-213-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qsocketnotifier.h:113:69: error: cannot initialize return object of type 'Qt::HANDLE' (aka 'void *') with an lvalue of type 'const QSocketDescriptor::DescriptorType' (aka 'const int') qsortfilterproxymodel.cpp:2938: error: out-of-line definition of 'recursiveFilteringEnabledChanged' does not match any declaration in 'QSortFilterProxyModel' qline.cpp:376: (qdoc) warning: Cannot find 'QLineF::IntersectionType' specified with '\enum' in any header file Fixes: QTBUG-83676 Change-Id: I57b51f4ad15fdc50db88100ad5b1cb85ed394b7a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| | * | | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Qt Forward Merge Bot2020-04-204-2/+112
| | |\ \ \
| | | * | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-04-204-2/+112
| | | |\| | | | | | | | | | | | | | | | | | | | Change-Id: I088f72543f5a964ae073f434b819b5fda4c549c8
| | | | * | sqlite: Fix CVE-2020-11656Andy Shaw2020-04-202-1/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was taken from d09f8c3621d5f7f8 and b64674919f673602 in SQLite, ref: https://www3.sqlite.org/cgi/src/info/d09f8c3621d5f7f8 https://www.sqlite.org/cgi/src/info/b64674919f673602 [ChangeLog][QtSQL][sqlite] Fixed CVE-2020-11656 Fixes: QTBUG-83652 Change-Id: I99bd59dc10b753ff19822c902dff1fc339d330a8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | | | * | sqlite: Fix CVE-2020-11655Andy Shaw2020-04-202-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was taken from 4a302b42c7bf5e11 in SQLite, ref: https://www3.sqlite.org/cgi/src/info/4a302b42c7bf5e11 [ChangeLog][QtSQL][sqlite] Fixed CVE-2020-11655 Task-number: QTBUG-83652 Change-Id: I5ead78d9ee63aa0f12f1c1014c79373728569f30 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | | | * | doc: AA_DisableSessionManager was added in 5.14Liang Qi2020-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This amends 404bee752c5058506900c23faa9d577a38b300f1. Fixes: QTBUG-83611 Change-Id: Ic3379a646b9c70fb23fd1f3f4bebed6e0b485664 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| | * | | | Markdown writer: omit space after opening code block fenceShawn Rutledge2020-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CommonMark spec shows that it's not necessary to have a space between the code fence and the language string: https://spec.commonmark.org/0.29/#example-112 This also avoids a needless trailing space after a code fence that does not include a language string. Change-Id: I2addd38a196045a7442150760b73269bfe4ffb22 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * | | | Markdown writer: don't wrap code block, and detect its endShawn Rutledge2020-04-201-7/+10
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The end of a code block nested in a list item is now detected; and if the text of the list item continues after the code block, it continues to be indented. Code blocks should never be word-wrapped. Fixes: QTBUG-80603 Change-Id: I4427f8b1d4807d819616f5cb971e2d006170d9be Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * | | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Liang Qi2020-04-202-1/+3
| | |\ \ \
| | | * | | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2020-04-202-1/+3
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt_common.prf src/network/ssl/qsslsocket_openssl_symbols.cpp src/network/ssl/qsslsocket_openssl11_symbols_p.h src/network/ssl/qsslsocket_opensslpre11_symbols_p.h src/plugins/platforms/wasm/qwasmeventdispatcher.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: I04fb3139a0e2efd4bc2f0959f131679f192fa0f8
| | | | * | OpenSSL: handle SSL_shutdown's errors properlyTimur Pocheptsov2020-04-166-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not call SSL_shutdown on a session that is in handshake state (SSL_in_init(s) returns 1). Also, do not call SSL_shutdown if a session encountered a fatal error (SSL_ERROR_SYSCALL or SSL_ERROR_SSL was found before). If SSL_shutdown was unsuccessful (returned code != 1), we have to clear the error(s) it queued. Unfortunately, SSL_in_init was a macro in OpenSSL 1.0.x. We have to resolve SSL_state to implement SSL_in_init. Fixes: QTBUG-83450 Change-Id: I6326119f4e79605429263045ac20605c30dccca3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 8907635da59c2ae0e8db01f27b24a841b830e655)
| | | | * | wasm: do not try to resume main thread if mainloop has not started yetLorn Potter2020-04-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit d928beb024c240b37d35d2c53f25648c99a484b4) Fixes: QTBUG-83293 Change-Id: Ibd891629d1d023e47d196dd60821cc5c583a178d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | | | * | Add information for macOS to qsystemdetection.hLars Schmertmann2020-04-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ibc99b5481709b1b99cdbbdd94ad544175871cbae Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | | | Add support for high resolution wheel events from Linux 5.0+Allan Sandfeld Jensen2020-04-202-2/+36
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They come in as a different relative axis, and we need to ignore the old axis to not scroll double. Change-Id: I808cce95417ec9f8058dee26d0a2694dda27944d Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| | * | | QSocketNotifier::activated(QSocketDescriptor...) doc fixupMårten Nordheim2020-04-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We agreed to make the type internal but somehow it slipped my mind to actually label them as such. Task-number: QTBUG-70441 Change-Id: Id90521ecc09bfa1db29601b96ba70bcdcb64d458 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | | rcc: Always seed the hash with 0hjk2020-04-171-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That was already done to pass the auto tests, but the randomization also bites for reproducible builds. Change-Id: Ibf4da513059deb5a806d2ac1a83c1994edf09d4a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | | Docs: show more relevant and correct way of using Q_FLAGVolker Hilsheimer2020-04-162-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The snippet didn't quote the QLibrary header correctly, and didn't register the flags type, but only the enum type with the meta object system. Update example to use QItemSelectionModel instead as a more relevant class for readers, and restructure the text a bit. Change-Id: I572e2aaac4601087e7aa6d2ea7a8f8fd65d82539 Fixes: QTBUG-83474 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| | * | | Introduce QSocketNotifier::activate(QSocketDescriptor, QSN::Type)Mårten Nordheim2020-04-1617-33/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pre-existing overload passes an int, but this can mean the descriptor gets truncated in compilations where the descriptor is 64-bit. The old overload with int is visible when querying the metaobject system so string-based connects still work as before, and connecting to it will produce a deprecation warning in the output. At the same time the PMF-based connect will, on recompile, pick the QSocketDescriptor overload. As an added improvement it also comes with the notification type, removing the need for separate slots where the code would be mostly shared anyway. The QSocketDescriptor type can be implicitly converted to and from qintptr to ensure existing code still compiles. It can also be constructed from Qt::HANDLE on Windows. In this same patch I also update the existing string-based connects in this module, which then includes updating the parameters for some slots as well. [ChangeLog][QtCore][QSocketNotifier] Added QSocketNotifier::activated(QSocketDescriptor, QSocketNotifier::Type). This replaces the activated(int) signal which in 64-bit environments could truncate the socket descriptor. If you use "activated" with the string-based connect() then you need to update the parameter type of the signal and slot if it had one. If you use it with the pointer to member function based connect() then all you need to do is update your slot's parameter type if it has one. If you need to compile your source code with multiple versions of Qt then connect() to this function using pointer to member function and update the slot's parameter type if needed. Task-number: QTBUG-70441 Change-Id: Ic43d6bc4c5bcb4040867b2ffad8d36fb01eed8af Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | | Fix display-name calls in QAndroidTimeZonePrivate::init()Edward Welbourne2020-04-161-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following up on commits 4fa8dfee5dd31433d22fdb449c1783e256931c8f and c20c7efea96046bebcb8ff7823d3a7e227f92e73, where I apparently got the call to Java's getDisplayName() method wrong. Use the same code as our own displayName() method used for this, pulled out as a function to be shared by the two callers. This requires a locale and it's not immediately obvious which to use, so try the three most plausible candidates: C locale because IANA IDs are typically in it; default because that's most likely what language a user-supplied locale name might be in; and system because the name may have come from the system, not the user. In the process fixed some loops that didn't visit all the values they thought they did. Fixes: QTBUG-81975 Change-Id: I7867ca6f46951315a41c389107439acb439eaf08 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| | * | | macOS: Remove a bunch of dead (forward) declarationsTor Arne Vestbø2020-04-1519-270/+25
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I402668a17b48c164658f775bacd832615a6d2587 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * | | Windows: Make QStandardPaths::writableLocation low-integrity awareFredrik Orderud2020-04-151-2/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Return %USERPROFILE%\AppData\LocalLow instead of %USERPROFILE%\AppData\Local when running in a low-integrity process. [ChangeLog][QtCore][QStandardPaths] When used in a low-integrity process on Windows, QStandardPaths::writableLocation returns respective low-integrity paths. Fixes: QTBUG-83453 Change-Id: Ie5e4625a34d08e4ef54be4ba45b2dae9e60feb63 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>