summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* QFileSystemModel: use the QFileInfo from the model as much as possibleVolker Hilsheimer2020-08-121-9/+19
| | | | | | | | | | If the file system already stores a QFileInfo, then it will have the information cached, which avoids costly roundtrips to the file system. Task-number: QTBUG-41373 Change-Id: I830a39fe0e20ebf07abde4438a87f7572f608d66 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFileDialog: fix warning message when navigating to "My Computer"Volker Hilsheimer2020-08-121-4/+5
| | | | | | | | | | | | | | | | The mapping between model indexes, QUrl, and QDir in QFileDialog resulted in QFileSystemEngine methods being called on empty strings, which results in a warning from QFileSystemEngine. When QFileDialog gets an empty string as the new path, then we know that it's the "My Computer" location, so handle that case separately. This makes sure we don't call any QFileSystemEngine methods with an empty string. Change-Id: I421d3d76b053379c216c41a72fb783d1bad176cb Pick-to: 5.15 Fixes: QTBUG-67866 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QFileDialog: reduce number of times a file is stat'edVolker Hilsheimer2020-08-122-76/+65
| | | | | | | | | | | | | | | | | | When opening a QFileDialog with an initial directory that lives on a disconnected network drive, repeatedly testing that directory consumes a significant amount of time during which the UI is blocked. To reduce the amount of file accesses, refactor the initialization code to allow sharing of a QFileInfo for the default case of operating on a local and absolute file system. This reduces the amount of stat calls significantly during startup time, and in case of a disconnected network shaves of 10-15 seconds of blocked UI, if Windows has already noticed that the file system is disconnected. Pick-to: 5.15 Fixes: QTBUG-6039 Change-Id: Ie082e447db214033291455bef2087cd05f366806 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Don't depend on tools for the qtestlib examplesAndy Shaw2020-08-122-2/+2
| | | | | | | | | Only widgets is required here, so drop the dependency on QT_BUILD_PARTS and just depend on widgets. Pick-to: 5.15 Change-Id: Idaae547b69ffd91681900b33c73e4a341011c30c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* cmake: Suggest qt-cmake-private script for building other Qt modulesKai Koehne2020-08-121-2/+2
| | | | | | | | This automatically sets the CMake Generator to be the same as the one used for qtbase. Change-Id: If9e1a6942520417393055c572f0d892efca43d2e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix Threads::Threads dependency handling with CMake < 3.18Alexandru Croitor2020-08-122-0/+22
| | | | | | | | | | | | | | | | | | | | Apparently CMake encods targets from different scopes with a different encoding scheme for earlier CMake versions. CMake 3.16.3: Threads::Threads::@<0x5604cb3f6b50> CMake 3.18.0: ::@(0x5604cb3f6b50);Threads::Threads;::@ Handle the earlier version approach as well. It needs to be done both when writing out 3rd party dependencies, as well as for lib prl files. Possibly in more places as well, but I didn't detect additional places yet. Amends 92ee9bd6b885879090ba57e49c8bd84a06d42b2b Task-number: QTBUG-85801 Task-number: QTBUG-85877 Change-Id: Ib348b51b2d623fb50d9080dba2beeb931d47a69c Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Configure.json: Do not link to pthread on Android on feature testingCristian Adam2020-08-123-2/+1009
| | | | | | | | | pthread has been removed from the NDK and the cxx11_feature detection fails. Fixes: QTBUG-72330 Change-Id: I22a97814b7e95011ad3944327f02343348c72b91 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QtFontStyle: Add missing const to non-mutable operatorsKonstantin Ritt2020-08-121-3/+3
| | | | | | | | and once I touch these lines anyways, either add noexcept ;) Fixes-up 8bdbb7f2267 Change-Id: Ibfaedcff82c041293220408ab7ae739b3cbd2a4f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* cmake, README: clearify the usage of '-' in feature namesRichard Moe Gustavsen2020-08-121-1/+2
| | | | | | | | | | It's not immediately obvious that you need to use all underscores for the feature name, so add a line that explaines it. Change-Id: I508eaf909c808fb0a93442f6e71428c18559b965 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Expose public info about whether Qt is a shared lib buildAlexandru Croitor2020-08-122-0/+2
| | | | | | | | | | We expose it in the private QtBuildInternals package, but we need it also as public information for consumption in qt_import_qml_plugins() to decide whether it should do anything. Change-Id: If135ae596b4edaf8e2c458f6a2518b968c6d01c4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Prepare ground work for static Qml plugins importingAlexandru Croitor2020-08-124-16/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | For qt_import_qml_plugins to work, it needs to have access to the Qml plugin targets by the time find_package(Qt6Qml) is called. To do that, we modify the generation of Qml plugin Config, Targets and Dependencies files to go into a special 'QmlPlugins' subfolder of the Qml package. The Qml package will then GLOB include all the Config files in that folder, to make them available whenever find_package(Qt6Qml) is called. This is similar to how the Qt plugins were glob included in the CMake integration of Qt 5.15. In fact that glob including is missing in Qt 6 for regular Qt plugins, and should be implemented in a following change. Currently the Qt Plugins config files that are included are hardcoded to the list of known plugins at Qt configuration time. As a drive-by to make this all work, the naming of the various Config and Dependencies files has been normalized to include the Qt6 prefix. This is done for both regular Qt plugins and Qml plugins. Task-number: QTBUG-85961 Change-Id: Id20da72337ca2945fa330ea6fb43535e44a83292 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QXmlStreamReader: Don't resize readBuffer to a size it already hasRobert Loehning2020-08-121-1/+2
| | | | | | | | | | | Resizing it to 0 will cause it to allocate memory. This will then cause append() to copy the data from the other string instead of using copy on write. Task-number: oss-fuzz-24347 Pick-to: 5.12 5.15 Change-Id: I581bd109f9b973e1c70b7b41b1f610a2ad5725b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Inline two macros in the unicode tablesEdward Welbourne2020-08-122-24/+20
| | | | | | | | They were only used by one function each, in unicodetables.cpp, so don't need to be macros. Change-Id: I3e7f9f661568862d0a0d265bb8f657a8e0782b13 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows: Remove method not existing in base classKai Koehne2020-08-121-1/+0
| | | | | Change-Id: Ifd016eabb07849fb3f310593ebe5301d3a9b09c1 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* HTTP/2: Don't handle Remote Disconnected if we haven't switched yetMårten Nordheim2020-08-121-1/+2
| | | | | | | | | In that case we haven't created the h2 handler yet, so it will crash when trying to access various members. Task-number: QTBUG-85902 Change-Id: Id0699ff06ef67748a16622703f731db0b0867771 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QNX: fix buildSamuli Piippo2020-08-121-2/+2
| | | | | | | | Remove unused argument and use default contructor for the flags. Change-Id: I09d319bc58199ed713333055a2fdd519c249f831 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
* QNX: register mouse input deviceSamuli Piippo2020-08-122-8/+27
| | | | | | | | | | Use the new QWSI APIs that take a registered input device. Task-number: QTBUG-85852 Change-Id: Iefb8239a60ff819172ba64f35f120cdc6975257f Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: James McDonnell <jmcdonnell@blackberry.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QDecompressHelper: Change order of encodingsUlf Hermann2020-08-122-1/+3
| | | | | | | | | Before the introduction of QDecompressHelper gzip was preferred over deflate. The change seems to be accidental. Amends commit 7b76379a89158f10780cbfc74965027246faec68. Change-Id: I70f33d551912465d63f49ea3db1ac3575d19a92d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Allow smooth curve stroking for very wide linesEirik Aavitsland2020-08-121-1/+5
| | | | | | | | | | | | | | The earlier limit set on the curve threshold turned out to be too strict, leading to visibly bad rendering in reasonable use cases. Ref. 5322998a0ba80b1e095340245ddb00aaf5947be9 As a drive-by, add a missing fixed-to-real conversion. (This is a no-op in a default build, where qfixed==qreal.) Fixes: QTBUG-85193 Pick-to: 5.15 5.12 Change-Id: I7cc3543d7aa4e90643b275686372400879decef2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Doc: Remove outdated documentationPaul Wicking2020-08-121-5/+0
| | | | | | | | | We don't have this class in Qt anymore. Drop the related snippet as well. Pick-to: 5.15 Change-Id: I5149e2f9da483b9ad678a6d414a278cb7e107f10 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Introduce maximumIdentifierLength to return database limits for namesAndy Shaw2020-08-115-3/+25
| | | | | | | | | Since Interbase/Firebird has a limit for column and table names then this function can be used by QSqlRelationalTableModel to make sure that the aliases created are within that limit. Change-Id: I0cb1c65b34befcb3690ccad3f081556dd2691344 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QJsonDocument: fix comparison of valid vs defaultThiago Macieira2020-08-112-1/+64
| | | | | | | | | | | [ChangeLog][QtCore][QJsonDocument] Fixed a bug that caused QJsonDocument's equality operator to crash if one of the operands was default-constructed and the other wasn't. Pick-to: 5.15 Fixes: QTBUG-85969 Change-Id: I5e00996d7f4b4a10bc98fffd1629f835f570ef6b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Document how keyboard tracking can prevent use of a date/time editorEdward Welbourne2020-08-111-9/+52
| | | | | | | | | | | | | This follows up on commit 580e9eedf783ccbdcb67baa3d1a9dcdd53922f86; if the allowed range is narrower than some time interval whose end it straddles, users can only access the later part of the range if keyboard tracking is disabled. Pick-to: 5.15 Task-number: QTBUG-65 Change-Id: Ie8882bd65bda603133abaa82ad83eb1cdd91f175 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Introduce QIODevice::skipData()Alex Trotsenko2020-08-1115-36/+56
| | | | | | | | | | | | | | | | | | | QIODevice::skip() called a virtual QIODevicePrivate::skip() to implement an efficient skipping on I/O devices for the internal subclasses. The user subclasses cannot inherit QIODevicePrivate, so this functionality was not externally accessible. This patch replaces QIODevicePrivate::skip() with a virtual protected QIODevice::skipData(). While the basic implementation simply discards the data by reading into a dummy buffer, users can reimplement this function to improve the performance in their subclasses. [ChangeLog][QtCore][QIODevice] Added virtual protected skipData(). Now, subclasses can implement device-specific skipping of data. Change-Id: I9522f7f7ab9d03ac06e972a525f8ec2fa909a617 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove old CBOR-based format from QShaderLaszlo Agocs2020-08-116-293/+19
| | | | | | | | | We only support version 4 and 5 in Qt 6.0. 1 and 2 are already gone (due to being based on binary JSON), now we remove 3 as well. Task-number: QTBUG-81346 Change-Id: I3627dcc0587f1e36f11e93edf7172889e911d64e Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Sort out the overflow cases in tst_QDateTimeEdward Welbourne2020-08-111-13/+12
| | | | | | | | | Use the actual minimum value, rather than minus the maximum, and adapt the overflow expectations so that they're correct west of Greenwich as well as east. Change-Id: I7a5f4510db0fdea3855b5b2bd4c4a86882030efd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix handling of last second in 1969Edward Welbourne2020-08-112-11/+28
| | | | | | | | Due to a limitation of mktime(), we would have declared it invalid. Tidied up qt_mktime() slightly in the process. Change-Id: I25469e314afee6e0394e564bc69a98883005d4ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tidy up use of local variables and add an assertionEdward Welbourne2020-08-111-6/+4
| | | | | | | | Petty tidy-up, narrowing the scopes and asserting that localtime_r()'s return, when non-null, is the pointer we gave it. Change-Id: I6c0959524260028ca9b234f6d33eae78f27c1412 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* wasm: detect canvas resize using ResizeObserver APIMorten Johan Sørvig2020-08-112-0/+45
| | | | | | | | | | | | | The ResizeObserver API is now available on the major desktop browsers (Safari, Chrome, Firefox), and can be used to handle canvas resize. (Previously, we got a callback on viewport resize only) Pick-to: 5.15 Change-Id: I8737285416bef70641f90da793c85efcb24f3623 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Add degree<->radians conversions for long double and integral typesGiuseppe D'Angelo2020-08-112-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | For long double: they're just missing, so add them for completeness. For integral types: follow the advice of C11's trigonometric functions; first convert the angle to double, then do the actual conversion. This is offered only for the degree->radians conversions, as someone may legitimately want to call e.g. qDegreesToRadians(90). On the other hand, it seems extremely unlikely that someone may want to do a radians->degree conversion starting from integral datatypes, so I'm not adding it for the moment being (instead, I'm leaving a note). [ChangeLog][QtCore][QtMath] qDegreesToRadians now also accepts long double and integral types. A value of integral type will be casted to double before the conversion to radians. [ChangeLog][QtCore][QtMath] qRadiansToDegrees now also accepts long double. Change-Id: Ib1576be5193ae09bb6cb4a70d7a31702955df2c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* wasm: fix natural scrolling on macLorn Potter2020-08-111-1/+1
| | | | | | Pick-to: 5.15 Change-Id: Icc41b2c54a2e8d0da11ba5068bdde1a0c20686e0 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Interbase: Don't call toUpper() on the names as they are escapedAndy Shaw2020-08-101-2/+2
| | | | | | | | | | Interbase is case sensitive when tables/fields are escaped so we should ensure that we pass the value as is. Pick-to: 5.15 Change-Id: Ia6c4edc9c1e675bd95913c85d47bf22c418d2113 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QMultiMap: add constructors from QMapGiuseppe D'Angelo2020-08-102-0/+44
| | | | | | | | | | | We can provide those. They don't lose information, do not have the problem we face at offering ranged constructors (namely the order of duplicate keys), and have a distinct advantage over ranged constructors: a non-shared rvalue QMap can be "upgraded" to a QMultiMap without allocating memory for the multimap. Change-Id: Ic23c83927c05a210bc1f0050006c9f26365d3916 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve QMultiMap docs a bitGiuseppe D'Angelo2020-08-101-1/+8
| | | | | Change-Id: I170dc5de15dac61620aaed94f32226c158092dce Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFileInfo: make stat method publicVolker Hilsheimer2020-08-103-4/+4
| | | | | | | | | | | | Forcing the reading of all file system attributes is generally useful in multi-threaded applications, and has at least one more use case in Qt. Using it in QFileSystemWatcher on Windows avoids several file system accesses. Task-number: QTBUG-41373 Change-Id: Ib3c3243fd083142393ad46d62f49cb4f7bfda17c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* cmake support for tst_mocFabian Kosmale2020-08-103-6/+155
| | | | | | | | | | | | | We use qt_wrap_cpp instead of AUTOMOC so that we can easily find the json files. Getting autorcc to run only after json file has been generated was deemed too tricky. Therefore the test is slightly modified to check for the json files in its directory instead of the resource, if the qrc file does not exist. Change-Id: Id1aabb117c8bab3ff81156da1f66d64e796bf18b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Filechooser portal: Implement "current_filter"Michael Weghorn2020-08-102-5/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds supports for setting and retrieving the selected MIME and name filter for 'QXdgDesktopPortalFileDialog'. For preselecting a filter [1]: > current_filter (sa(us)) > > Request that this filter be set by default at dialog creation. If > the filters list is nonempty, it should match a filter in the list > to set the default filter from the list. Alternatively, it may be > specified when the list is empty to apply the filter > unconditionally. The "current_filter" return value was added in xdg-desktop-portal commit [2]. [1] https://flatpak.github.io/xdg-desktop-portal/portal-docs.html#gdbus-org.freedesktop.portal.FileChooser [2] https://github.com/flatpak/xdg-desktop-portal/commit/35fca7fae881bdaba1bebccf7775eba84407a488 Fixes: QTBUG-85658 Pick-to: 5.15 Change-Id: I8651c1a8942dfd358895b7826730729c4d22e680 Reviewed-by: Jan Grulich <jgrulich@redhat.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: pro2cmake: Specify library versions for 3rd party libs part 2Alexandru Croitor2020-08-105-31/+36
| | | | | | | | | | Embed package versions into the qt_find_package calls for various Linux specific packages. Task-number: QTBUG-82917 Change-Id: I5d1cb623f81932dfae4658b8a3a89eedb71ea3af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: pro2cmake: Specify library versions for 3rd party librariesAlexandru Croitor2020-08-1011-83/+151
| | | | | | | | | | | | | | | | | | | | | | | | If certain 3rd party libraries have a version that's not suitable for Qt, the configure summary should say so, rather than use them and fail at build time. With the current situation, we have to duplicate the version information from the configure.json files in helper.py, by assigning the version number as an extra find_package variable. Rerunning configurejson2cmake then embeds this version info into the qt_find_package calls in configure.cmake. Some of the Find modules are rewritten to take the specified version into account when looking for the libraries. This involves moving around the code for creating a target, after calling find_package_handle_standard_args() so we know if a good enough version was found. Task-number: QTBUG-82917 Change-Id: I139748d8090e0630cda413362760034dc3483e11 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QLayout: minor tidy in the docsGiuseppe D'Angelo2020-08-101-1/+1
| | | | | Change-Id: Ifc2aa62a9c9480c85cc36f60941411e920066db8 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Fix build with mingw gcc 9 and -Wsuggest-overrideKai Koehne2020-08-1012-85/+86
| | | | | Change-Id: I780b0761a7f6b19022116b738efa7aca1378b715 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix compilation in C++20 modeAllan Sandfeld Jensen2020-08-081-6/+12
| | | | | | | | The comparisons with pointer were ambiguous as the comparisons could be done between iterators or pointers. Change-Id: I0484946931502d04bd63519fcd6e886c732758d3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid UB in 64bit compositionsAllan Sandfeld Jensen2020-08-081-17/+17
| | | | | | | | Multiplying 65535 by 65535 would exceed the precision of an int, so use 65535U instead. Change-Id: I066e552fb7db03ce867bcbfbd0b555ac98ca4bbf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QBezier: Don't try calculating a unit vector when length is nullRobert Loehning2020-08-071-0/+4
| | | | | | | | | It's undefined and causes a division by zero. Fixes: oss-fuzz-24273 Pick-to: 5.12 5.15 Change-Id: I3d34d5c43cccff9255abaf87af265ddea3fe6d95 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QSettings: purge deprecated APIEdward Welbourne2020-08-072-42/+1
| | | | | | | Since 5.13: setSystemIniPath(), setUserIniPath() Change-Id: Ie02fa96e652c10ac1a276016bd556474030fe0f5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QStandardPaths: purge deprecated APIEdward Welbourne2020-08-072-12/+2
| | | | | | | Since 5.2: enableTestMode(bool) Change-Id: Ibfd5958b6383491d9297d3f0e815ad4679fb57f5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFileInfo: inline the file-time methodsEdward Welbourne2020-08-072-22/+11
| | | | | | | | As instructed in a // ### Qt6 comment Added missing #include for QDateTime. Change-Id: Ic1f9e6ec42ecae07d037b84943444785847bdf98 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFileInfo: purge deprecated APIEdward Welbourne2020-08-073-55/+1
| | | | | | | | Since 5.10: created() Since 5.13: readLink() Change-Id: I9722f81750dd92315a67a1c38df41a95ae63e0db Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFile: purge deprecated APIEdward Welbourne2020-08-072-41/+2
| | | | | | | | Since 5.0: set{En,De}codingFunction() Since 5.13: readLink() Change-Id: I5386d0accf2724d84550c9bfdbbe914937194be2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Purge deprecated API from QDirEdward Welbourne2020-08-072-51/+1
| | | | | | | | | Assignment from QString and addResourceSearchPath(), both deprecated since 5.13. Change-Id: I25f08ffadc7b9dfd7895a9199255ca5f1948bd47 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>