summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Remove bearermanagement usage inside QNAM and QNetworkProxyMårten Nordheim2020-04-0123-1305/+9
| | | | | Change-Id: I2c4fdf598b46daf1b69a65848ebe0fd78ef8be24 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Don't store iterators on QHash while erasingLars Knoll2020-04-013-39/+43
| | | | | | | | QHash::erase() in the new QHash will invalidate all iterators pointing into the hash. Change-Id: Ia54e8485a947cd7274f832c7c8c624d0aaded4ba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QRegExp usage in QNetworkCookieLars Knoll2020-04-011-11/+13
| | | | | | | | | | | Changed this to not use capturedTexts(), as it is slower than required, and behaves slightly differently than in QRegExp (the returned list might be shorter than the amount of captures if the last capture didn't match). Change-Id: I3f90128af62d784a3d1beb993ab215e0c7d6b826 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add support of failure handler callbacks to QFutureSona Kurazyan2020-04-014-1/+291
| | | | | | | | | Added QFuture::onFailed() method, which allows attaching handlers for exceptions that may occur in QFuture continuation chains. Task-number: QTBUG-81588 Change-Id: Iadeee99e3a7573207f6ca9f650ff9f7b6faa2cf7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Store QFuture exceptions as std::exception_ptrSona Kurazyan2020-04-016-62/+30
| | | | | | | | | | | Replaced the internal ExceptionHolder for storing QException* by std::exception_ptr. This will allow to report and store exceptions of types that are not derived from QException. Task-number: QTBUG-81588 Change-Id: I96be919d8289448b3e608310e51a16cebc586301 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QTableView: remove unused lambda captureFabian Kosmale2020-04-011-1/+1
| | | | | Change-Id: Ifd6994f90d2c4f550d8c1b8443f426006c06af96 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Remove QRegExp based API and QRegExp usage from QTextDocumentLars Knoll2020-04-012-134/+8
| | | | | Change-Id: Ib5cc2d747f215a483585b703f9b4f6415e0d59f7 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Remove all QRegExp dependencies from widgetsLars Knoll2020-04-018-70/+4
| | | | | | | | | QRegExp is deprecated in Qt6 and will get moved to the Qt 5 compat library. As such we need to remove all API and usages of QRegExp in Qt. Change-Id: I33fb56701d3d7c577f98a304c1d4e6f626fcb397 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Make QLocale(QString) explicitLars Knoll2020-04-012-3/+3
| | | | | | | | We should not implicitly convert a QString to a QLocale object. It can easily create unwanted side effects. Change-Id: I7bd9b4a4e4512c0e60176ee4d241d172f00fdc32 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* uic: Generate include statement for QActionGroupFriedemann Kleint2020-03-311-1/+1
| | | | | | | | | Legacy forms from Qt 3 may still contain QActionGroup, generate an include statement for them. Change-Id: I292967f23f798a132ec7e360e437b20a529c3a26 Complements: bcaff2b06fc46fce8a3ae6d613c025c8d097229 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QFuture - add ability to move results from QFutureTimur Pocheptsov2020-03-317-26/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QFuture's original design pre-dates C++11 and its introduction of move semantics. QFuture is documented as requiring copy-constructible classes and uses copy operations for results (which in Qt's universe in general is relatively cheap, due to the use of COW/data sharing). QFuture::result(), QFuture::results(), QFuture::resultAt() return copies. Now that the year is 2020, it makes some sense to add support for move semantics and, in particular, move-only types, like std::unique_ptr (that cannot be obtained from QFuture using result etc.). Taking a result or results from a QFuture renders it invalid. This patch adds QFuture<T>::takeResults(), takeResult() and isValid(). 'Taking' functions are 'enabled_if' for non-void types only to improve the compiler's diagnostic (which would otherwise spit some semi-articulate diagnostic). As a bonus a bug was found in the pre-existing code (after initially copy and pasted into the new function) - the one where we incorrectly report ready results in (rather obscure) filter mode. Fixes: QTBUG-81941 Fixes: QTBUG-83182 Change-Id: I8ccdfc50aa310a3a79eef2cdc55f5ea210f889c3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove QRegExp usage from QSslCertificate and QSslSocketLars Knoll2020-03-316-186/+1
| | | | | | Change-Id: I81abe1ab2173af922fa4b5fad58d25fa602c523b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Get rid of QRegExp usage in QFtpLars Knoll2020-03-313-14/+17
| | | | | | | Change-Id: Ia8743467d5b4537fe324a1278b526eb16bf0f732 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Don't keep a reference into the hash while modifying itLars Knoll2020-03-311-1/+1
| | | | | Change-Id: I8c7e180a3bc640a63c183f460918914265a2a31b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* RHI: Fix running with Vulkan on WaylandEskil Abrahamsen Blomfeldt2020-03-302-19/+12
| | | | | | | | | | | | | | | | When the Wayland client plugin is in use, the capabilities for the surface may report a minimum image count of 4. The internal "maximum minimum count" of 3, was arbitrary and only used for sizing buffers. To be more friendly to different setups, we remove the restriction and use QVarLengthArrays instead. We also set the initial size of the buffers to 4 so that we can run with Wayland without any resizing, but now the arrays will also grow to be safe for cases where 4 is not sufficient. Change-Id: Iba5434e84417d36b70f2655b152e816f04650ce4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Android: Update minimum version to 23 againEskil Abrahamsen Blomfeldt2020-03-302-2/+2
| | | | | | | | | | | | In 519ea72108fae7f5c4ed7c3e9fed3a999a16ed73, the minimum SDK version was moved away from the AndroidManifest.xml, and when the change was merged, we lost parts of the update to set the minimum version to 23. This redoes it in the remaining locations. Change-Id: Iada8188d3c0c8ec0a4801c1d219640ecb3976753 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Android: Implement MaximizeUsingFullscreenGeometryHintEskil Abrahamsen Blomfeldt2020-03-3012-149/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (This reintroduces c17a5cec1901dd23f4c39ec2ae47a060fbb06895, which was reverted in Qt 5 because it requires API level 23.) This flag tells the app to use as much of the screen as possible while still keeping system UI visible, and can be supported on Android by using translucent system UI, similar to iOS. What this does: 1. It changes the current fullscreen/not-fullscreen logic to allow three states: fullscreen, fullscreen with translucent decorations and not-fullscreen. 2. In order for it to work, we have to send the actual screen geometry and available geometry, at least in the case where the user needs to know the available geometry to know the safe area of the window. So we get the real screen metrics and pass these to the QPA plugin (API level 17, so we can do that now that the minimum version is 21.) 3. Note that getting the insets and calculating the useable area does not work for non-fullscreen windows, since Android is quite inconsistent in this respect. So in this case we just use the window size and origin of 0,0 for the available geometry. 4. Since we are touching this code anyway, this patch also tries to use more consistent wording (calling it "available geometry" everywhere instead of desktop geometry in some places and just geometry in others, etc.) [ChangeLog][Android] Qt::MaximizeUsingFullscreenGeometryHint window flag is now supported, and will make the window fullscreen, but keep the system UI on-screen, with a translucent background color. Fixes: QTBUG-74202 Change-Id: I4cc5ef9cc2a3bd22d4d8d2bb767c6ff8a3aa75c0 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Move undo framework out of Qt WidgetsMitch Curtis2020-03-3015-228/+228
| | | | | | | | | | | | | | | - Moves QUndo* classes (except QUndoView) from src/widgets/utils to src/gui/utils - Moves related auto tests from widgets to gui - Replaces QUndoAction with lambdas that do text prefixing [ChangeLog][Undo Framework] QUndo* classes (except QUndoView) were moved from Qt Widgets to Qt GUI. Done-with: volker.hilsheimer@qt.io Fixes: QTBUG-40040 Change-Id: I3bd8d4d32c64f8dee548f62159a1df2126da89d8 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of QRegExp usage in qfiledialogLars Knoll2020-03-301-8/+13
| | | | | | | | and replace with QRegularExpression Change-Id: Ic692fc0ea24da84dd4b6bb4c8a846c0fcc62c3cb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Make MatchRegExp an alias to MatchRegularExpressionLars Knoll2020-03-304-12/+4
| | | | | | | All matching happens using QRegularExpression now. Change-Id: I10bfcefbf4d9c79d235242e3e05116cdf7af02d1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove QRegExp dependencies and mentionsLars Knoll2020-03-302-1/+2
| | | | | Change-Id: I399f8980f56eda5d60b554aa942bf045ab91e0d6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove some leftovers of QRegExpValidatorLars Knoll2020-03-302-5/+1
| | | | | | | Amends dee55af0a5359bb3b57a89cf3065ffca9d8506da Change-Id: I59c02c6c289028abb86cdab1b2f2b3efdcea7821 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Extend the configure test for C++17 filesystemMartin Storsjö2020-03-302-2/+8
| | | | | | | | | | | | | | If recent versions of libc++ are built with filesystem support disabled, the filesystem header still is installed., The std::filesystem::path() constructor is completely defined inline in that header, making the test pass on such configurations, despite C++17 filesystem not being implemented. Test a call to std::filesystem::copy instead, which requires the actual library implementation to be available as well (on recent libc++). Change-Id: Id997ab75f3299d8431b13cad871f2901f4d9f6ed Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix deprecation warnings in QCocoaCursorVolker Hilsheimer2020-03-302-9/+9
| | | | | | | | | Explicitly use the Qt APIs that return QPixmap and QBitmap by value, and fix the API taking those to use const references rather than pointers or const values. Change-Id: I2bb7ad1edb3b65f806f0475fca383e5b9bdb61f3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QtConcurrent: add fluent interface to configure a task before runVitaly Fanaskov2020-03-2911-11/+635
| | | | | | | | Task-number: QTBUG-82950 Change-Id: I449da938b6b501a7646b3425edde5c880d6ca87e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
* Merge QGuiShortcut and QShortcut again in QtGuiVolker Hilsheimer2020-03-2913-688/+573
| | | | | | | | | | | | | | | | QShortcut has only one widget specific feature, which is whatsThis; that is just a QString, so the setters and getters can just as well be in QtGui. The widgets specific implementation of shortcut matching and of showing the whatsThis balloon stays in QtWidgets, in the private implementation. Using virtual functions in the private we can override the empty default in QtGui, and by adding a virtual factory function in QGuiApplication, the correct private is instantiated depending on the kind of application running. Change-Id: I09ae4a5482f9fb70940c5e2bfe76d3d7fd710afc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove QGuiAction again and split QAction implementation up insteadVolker Hilsheimer2020-03-2944-1114/+726
| | | | | | | | | | | | | | | | | | | | | | Duplicating the number of classes is a high price to pay to be able to have some QAction functionality behave differently, or be only available in widgets applications. Instead, declare the entire API in QtGui in QAction* classes, and delegate the implementation of QtWidgets specific functionality to the private. The creation of the private is then delegated to the Q(Gui)ApplicationPrivate instance through a virtual factory function. Change some public APIs that are primarily useful for specialized tools such as Designer to operate on QObject* rather than QWidget*. APIs that depend on QtWidgets types have been turned into inline template functions, so that they are instantiated only at the caller side, where we can expect the respective types to be fully defined. This way, we only need to forward declare a few classes in the header, and don't need to generate any additional code for e.g. language bindings. Change-Id: Id0b27f9187652ec531a2e8b1b9837e82dc81625c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Follow bundled Harfbuzz updateKonstantin Ritt2020-03-283-62/+33
| | | | | | | | | | | as we raised the minimum requirement for harfbuzz to version 2.6.0: * use new HB_SCRIPT values instead of tags * get rid of deprecated (and no-more-used) callbacks * replace deprecated hb_ot_tags_from_script() usage with a more flexible and up-to-date hb_ot_tags_from_script_and_language() Change-Id: I0eafdd2d2028c353fa3a93f5868efceccd364a70 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QAbstractItemView::dataChanged(): optimize call to QWidget::update()Christian Ehrlicher2020-03-286-2/+93
| | | | | | | | | | | | | When topLeft and bottomRight are different in QAIV::dataChanged(), the current implementation simply calls QWidget::update() without checking if the affected cells are visible. This results in a big performance hit when cells are updated frequently. Now try to compute the exact update rect by iterating through the modified indexes. Fixes: QTBUG-58580 Change-Id: I97de567d494e40ed8cdb1ea1f5b3cf3a2f60455e Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* HB-to-Qt bridge: get rid of stale/dubious safety checksKonstantin Ritt2020-03-281-18/+6
| | | | | | | these aren't needed for quite a long time already Change-Id: I3a5ce3199cee467d7dfba3c68256d214fee4d83c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Revert "QMetaType: support manual unregistration"Simon Hausmann2020-03-273-17/+0
| | | | | | | | | This reverts commit cf000d080c61cde44bd84e53ee018f36e33b7257. Reason for revert: This API is not needed (anymore) by qtdeclarative. Change-Id: I8af604c2babe3afc11f183ddb3ce3a9038a456ad Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make QPropertyBindingPrivate accessible to QtQmlSimon Hausmann2020-03-276-38/+61
| | | | | | | | | | | | | | | | | | QtQml needs the private just for one detail which nobody else should need it for: Tracking additional dependencies and marking the binding as dirty. Exporting the private requires hiding some variables and providing accessors, to compile with MSVC - including the removal of QVarLengthArray usage. Upside: The binding structure shrinks by 8 bytes and the encapsulation makes it a little easier to change things without breaking declarative, ... in the unlikely event ;-) Also remove setDirty() from the public API as it's not needed by QtQml and using it is dangerous, because it means that there's a risk of somebody keeping a reference (count) to the untyped binding from within the binding closure, which introduces a memory leak. Change-Id: I43bd56f4bdf218efb54fa23e2d627ad3acfafeb5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* macOS: Fix or ignore deprecated API in 10.14Tor Arne Vestbø2020-03-279-52/+58
| | | | | | | Fixes: QTBUG-82128 Change-Id: I11abfcf7f245a7a25733625b50e207b07abba289 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Speed up QSortFilterProxyModel filteringChristian Ehrlicher2020-03-271-8/+11
| | | | | | | | | | Speed up the QSortFilterProxyModel filtering by only updating the source_to_proxy entries which are really changed - When proxy intervals are added or removed, it is not needed to update the proxy_to_source indexes which were not touched. Change-Id: I35459ff1b04f4610ec74f4b01d58a71832a9ae22 Reviewed-by: David Faure <david.faure@kdab.com>
* Add a public qsimd.h headerLars Knoll2020-03-265-22/+161
| | | | | | | | This header only covers a part of what qsimd_p.h does, namely the compile time detection of simd extensions. Change-Id: I05f1d987f194a5bec335f2405cc2846fbaa88b66 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move qsimd* from corelib/tools to corelib/globalLars Knoll2020-03-268-4/+82
| | | | | | | | | | | It's not used in tools at all and fits a lot better in global. Also fix the qsimd_x86* files to have a proper copyright header. Change-Id: Id3d8e7cfcd7769a1ca9f3d8cf6d357a31a99ba40 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Revert "Android: Fix compile on arm64"BogDan Vatra2020-03-263-13/+0
| | | | | | | | | This reverts commit 81d6906ad9fa8ad3f73b151a1e8564ffaeccc3cf. Fixed upstream. \sa https://github.com/harfbuzz/harfbuzz/issues/1308 Change-Id: I7759e2bb199ffd11d42239be59704c4e1f7ddb9f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QCborValue::toCbor() constLars Knoll2020-03-252-4/+4
| | | | | | | | Those methods don't modify the CBOR value, they should be const. Change-Id: I213984ed82e43429413344999a22ad1c4c3beac8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaType: Do copy constuctible check at compile timeFabian Kosmale2020-03-251-1/+1
| | | | | Change-Id: I2f6a9bbaa0153fa33fc6a0b68bcedfbe3b9b1a7c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMetaType::fromType: support classes with inaccessible dtorsFabian Kosmale2020-03-251-1/+4
| | | | | Change-Id: I60a1b2496d48651a8166173b420da37f59d7a395 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QHttpNetworkReplyPrivate: Remove unused variableMårten Nordheim2020-03-253-1306/+0
| | | | | | | Oh, and re-remove the spdy protocol handler. Change-Id: I9ca3517b14ac202eac19ae75d481cfd78d431abb Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* CMake: Add support for bundled SQLite libraryLeander Beernaert2020-03-253-7/+85
| | | | | Change-Id: I4d3f6e3bf04eb2fcf337e2c5dbc04b6e6f8ebe0b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Avoid recreating QRegularExpression for every text blockJoni Poikelin2020-03-251-9/+9
| | | | | | | | With very complex regular expressions this makes a significant difference in performance. Change-Id: I5267bf71cae98dffb58ec7a1fc982dae639ff312 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Don't call QSet::erase() on an end iteratorLars Knoll2020-03-252-2/+4
| | | | | | | | hash.erase(hash.constFind()) is bound to crash if the hash doesn't contain the item we're looking for. Change-Id: Icbefca87b0258970373ec55d5dc113e6ab39c5f0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Fix configuration of FEATURE_JPEGLeander Beernaert2020-03-251-1/+1
| | | | | | | | Without this patch JPEG support is always disabled, even though we can build it from 3rdparty sources. Change-Id: I9e619f0ca8ec3ca3e7c58981bb6af9b33426a029 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove QSignalMapper::mappedWidget()Lars Knoll2020-03-252-43/+2
| | | | | | | | | | | | | | mappedObject() can do exactly the same thing, there's no need for a mappedWidget() signal as well This removes a reverse dependency between Qt Widgets and Qt Core where QWidget pointers are being used inside Qt Core. [ChangeLog][QtCore] Removed QSignalMapper::mappedWidget. Connect to mappedObject instead, and use qobject_cast<QWidget *> to handle Widgets. Change-Id: I60618a34dd94575e993bd6d8a2cead95cfd71d55 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Get rid of QRegExp usage in rccLars Knoll2020-03-251-2/+11
| | | | | | | | As a drive-by, enable testing of rcc in the cmake build. Change-Id: I4150ff3ffe7404bab0cbc72f80b23b47a60cf33d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
* Remove QRegExp usage from the XBM handlerLars Knoll2020-03-251-23/+28
| | | | | Change-Id: Ie7141c2a04c233bc1298195aebfc0437e43df0d1 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove qt6_use_modulesKai Koehne2020-03-251-46/+0
| | | | | | | | | | | qt5_use_modules has been deprecated in 2013 (commit d9ea4bb144153) and removed for the first time in 2018, but then brought back - see discussion in https://lists.qt-project.org/pipermail/development/2018-June/032837.html . Anyhow, I think we can finally put it to a rest in Qt 6. Change-Id: I770f7e93406ad68535d1d90e4a3bacfb920e2d5a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* HB-to-Qt: stop propagating helpers and types not used outside QtGuiKonstantin Ritt2020-03-252-12/+16
| | | | | Change-Id: I039efaeabc83bc0367bb3ab949057d2cbc6c2742 Reviewed-by: Lars Knoll <lars.knoll@qt.io>