summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Port QColorTransform to QESDPGiuseppe D'Angelo2020-10-163-17/+8
| | | | | | | | Remove the hand-rolled refcount management code, and cleanup the existing constructors. Change-Id: I1b91dbf888feff25d67310637d42dcdc3acaac13 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Port some more /*implicit*/-like comments to Q_IMPLICITGiuseppe D'Angelo2020-10-163-9/+9
| | | | | Change-Id: Ib70ad3f29365153af647deea54fc45467c413cb9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Unwrap private QPalette data memberVolker Hilsheimer2020-10-142-15/+12
| | | | | | | | | Following 556511f9f39ddc887481e0cd5a877134ceb0da6b, there is only one data member in addition to the shared QPalettePrivate, so we don't need a data struct anymore. Change-Id: I8d7f33ed042e47464eb5f60a048956f8bf70e0b9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* rhi: Fix up vertex inputs with matricesLaszlo Agocs2020-10-143-6/+31
| | | | | | | | | | | | In order to prevent too much voodoo in backends like D3D11, the input layout is expected to specify the slice index for vecX that are part of an unrolled matrix. Also deoptimize the instancing manual test to exercise a matrix too instead of just vectors. Change-Id: If2dcbcbc483645ce2420b2f87dda765b95da6e80 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Return false from canFetchMore for uninitialized QFileSystem modelsDoris Verria2020-10-141-0/+2
| | | | | | | Task-number: QTBUG-87273 Pick-to: 5.15 Change-Id: I1787e3dd26ec10cf161d8fa4e329972b6dd4aa6c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add a few missing Q_CLANG_QDOC for native interfacesTor Arne Vestbø2020-10-133-4/+4
| | | | | Change-Id: I5dbe2f7e7c03fb0a130b2da373f6f6a642d57575 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* doc: Add brief and group for native type conversionsTor Arne Vestbø2020-10-132-8/+22
| | | | | Change-Id: I74608619201bf77e487fb986bf213b349cc22f6a Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* rhi: Add missing \internal doc commandsTor Arne Vestbø2020-10-121-0/+3
| | | | | | Pick-to: 5.15 Change-Id: I09a69a04c6fcd406602e797cbeec59216fecd5d8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Exclude all modifiers as candidates for shortcutsTor Arne Vestbø2020-10-121-1/+1
| | | | | | | | | If we're going to limit shortcuts to non-modifiers, we should at least include all of the modifiers, otherwise we'll end up passing through e.g. Key_CapsLock. Change-Id: If11758f85d06f75e9b9c2d2a57d4a4915ff72317 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Remove dead codeLars Knoll2020-10-125-25/+0
| | | | | | | This code has been deprecated in Qt 5. Change-Id: Ia8e0bc791ac1f43df7124b4f30db3d0bb9966015 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Fallback to using the family when doing an exact matchAndy Shaw2020-10-121-6/+23
| | | | | | | | | | If the difference between the families sizes is just 1 where one of them is 0 in size then we can fallback to the family in that case. Pick-to: 5.15 Fixes: QTBUG-87267 Change-Id: I62b25b06c88000b4d7defe91871c07873b1fc792 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* macOS: Always include non-GL native interfacesTor Arne Vestbø2020-10-121-3/+4
| | | | | Change-Id: Idc8e76b5cb7af8b8df54820a4150ac7d1e3d8944 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Rename QtGui native interface implementation filesTor Arne Vestbø2020-10-1210-17/+12
| | | | | | | Follows the naming convention used by the plugins as well. Change-Id: Icba62fc2aaa5acf0ab3c88599a63aab1f530a2ab Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add an example to the documentation of QImage::scanLine()Mitch Curtis2020-10-122-0/+15
| | | | | | | | | I couldn't find any examples in Qt's documentation of this when I was trying to use it in a project. Pick-to: 5.15 5.12 Change-Id: Ic7b7b71f219b2c1012829980866940b9a77bd11f Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Link to qAlpha in qRgb() and qRgba() docsMitch Curtis2020-10-121-2/+2
| | | | | | Pick-to: 5.15 5.12 Change-Id: I5a3b8573123e82f4c8c92fa7a2e1af06e2e84eb2 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Improve QRgb documentationMitch Curtis2020-10-122-1/+13
| | | | | | | | | - Add examples of how to create QRgb values - Link to qRgba() Pick-to: 5.15 5.12 Change-Id: I2a86b1c8e00137ba868426b8157a3aa0d924d7a6 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Protect QImage work on shutdownAllan Sandfeld Jensen2020-10-124-7/+7
| | | | | | | | | | If the thread pool was not created, or already deleted, make sure the QImage routines can still run as they could before. Fixes: QTBUG-87320 Pick-to: 5.15 Change-Id: I4105a68b6ae0637faf82cdda5f5ae44298759396 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Avoid heap-buffer-overflowRobert Loehning2020-10-121-1/+1
| | | | | | | | | [ChangeLog][QCosmeticStroker] Avoid a heap-buffer-overflow found by oss- fuzz as issue 25243. Pick-to: 5.12 5.15 Change-Id: I36112f183241679e172ad1ee531e1b929d6f3815 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* rhi: Make the new direct buffer update available for non-uniform buffersLaszlo Agocs2020-10-1212-41/+69
| | | | | | | | | | | | | | | | | The original restriction to UniformBuffer was due to the GL backend where there is no GL buffer object for QRhiBuffers with usage UniformBuffer. However, we can still implement this for cases when there is a true GL buffer object underneath. With other backends it should all work as-is already. This becomes useful when one has buffers with usage Vertex that need full updates every frame. (f.ex. instance data) Unfortunately this involves renaming the function. But while at it, add an autotest case as well. Change-Id: Iff59e4509a8bae06654cc92fe8428bd79eb012fb Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: d3d: Save a few cycles in bindShaderResourcesLaszlo Agocs2020-10-113-121/+144
| | | | | Change-Id: Ib11ea33eb695d4599f4f040415d497aaf19cb15b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: d3d: Calculate dynamic offset usage upfrontLaszlo Agocs2020-10-112-9/+17
| | | | | | | Also remove an unnecessary buffer type test. Change-Id: I6f8312f03d3fe1729fa9b2eb95f6bfbeeccd0d4f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: vk: Avoid shadowing local variableLaszlo Agocs2020-10-111-5/+6
| | | | | Change-Id: I7ad14ff05a1ff10113f5d3985662970d74e68ead Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: vk: Skip buffer/texture registration on read-after-readLaszlo Agocs2020-10-111-6/+19
| | | | | Change-Id: I22027cfc227d3c09e446d193e6b2903b8df34eb2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: vk: Pre-calculate the flags for dyn.offsetLaszlo Agocs2020-10-114-48/+54
| | | | | | | ...instead of doing a loop in setShaderResources() just for this. Change-Id: Iac8d4517783967c6b8bca4926cceca918f7dcdec Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: d3d: Reduce the size of the Command structLaszlo Agocs2020-10-115-23/+36
| | | | | | | Copied by value so the size matters. Change-Id: I17eae99212801a4fb390a0e298b361123644d17d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: Move some code out of the inner loopsLaszlo Agocs2020-10-111-4/+4
| | | | | Change-Id: I96c71ef45b93ab95250a2a3f0e9c10e8bc86d650 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Add support for full, direct buffer updatesLaszlo Agocs2020-10-1113-6/+160
| | | | | Change-Id: I02c1f8c32c08d39cde9845d20ba8b02541d9d325 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make the named QColorSpace constructor thread-safeAllan Sandfeld Jensen2020-10-101-5/+24
| | | | | | | | | | Avoid accessing the shared pointer table without using atomic. Cleans up the shared table on exit for leak tracking utilities. Pick-to: 5.15 Change-Id: Ia2d6d79dea1c8be02bae2d8111e290f49eedf409 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix a compile error on Android in debug buildsLars Knoll2020-10-091-2/+2
| | | | | | | Android uses -Werror,-Wsign-compare. Change-Id: I4e861ebd6ea00914223358629f8e898c2aa67cd0 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Avoid double pixel-ratio scaling of dbus tray iconsAllan Sandfeld Jensen2020-10-082-10/+11
| | | | | | | | | | | QIcon::pixmap does automatic scaling to DPR by default, so use QIconEngine API to access internal pixmaps directly instead. Pick-to: 5.15 Task-number: QTBUG-83806 Change-Id: I3ccbed8387811a87bbea3f5d4ad9963e1be28a49 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* rhi: gl: Silence incorrect compiler warnings about uninitialized useLaszlo Agocs2020-10-081-3/+3
| | | | | Change-Id: I09bd22f3ccb1231ad4ef123f581459ef5c1ac37c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* rhi: gl: Drop the unused WRAP_R memberLaszlo Agocs2020-10-082-5/+0
| | | | | | | | If we do not use it for anything, do not spend time on comparing and copying it either. Change-Id: I3632792847010e5b73c48eb1ca88f5806f3ccd45 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: Fix missing texture bindingsLaszlo Agocs2020-10-081-5/+7
| | | | | | | | The block to update the cached state needs to be run also when the texture parameters have changed. Change-Id: Ifa80c142c6ff31c95a718a1a900ff3db0bbfe4bc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Do not trigger actions disabled directly or on group levelAllan Sandfeld Jensen2020-10-081-2/+5
| | | | | | | | | | | Only allow actions disabled due not being visible to trigger, when enabled is not true. This matches QQuickAction behavior, and doesn't apppear to affect QtGui or QtWidgets. Change-Id: I1a00b80213598ef1560be4c9ee9e65cd6fa6d760 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-079-11/+11
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Rename the new platform APIs from QPlatformInterface to QNativeInterfaceTor Arne Vestbø2020-10-0721-146/+143
| | | | | | | | | | | | We were already using the 'native' nomenclature when referring to these kinds of APIs, e.g. when talking about native handles, or the existing QPlatformNativeInterface on a QPA level. Using 'native' for the user facing APIs also distinguishes them from the 'platform' backend layer in QPA and elsewhere. Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rename Android offscreen surface interfaceTor Arne Vestbø2020-10-072-4/+4
| | | | | | | | The convention for these interfaces is to not have 'platform' in their name. Change-Id: I4af831861b58dcfc2538d4206788231b9ec3a766 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* CMake: Remove leftover debug outputAlexandru Croitor2020-10-061-2/+0
| | | | | | | Amends 07b6d3367debd8f15974abf0f5cdf48f0fe3a536 Change-Id: I8d5922af13903c6a10f967035bca70a89b19f86f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Un-special-case macOS in handling of QKeyEvent::nativeScanCode()Tor Arne Vestbø2020-10-063-7/+3
| | | | | | | | | | | | | | | | | | | | | | | In the porting from Qt 4 to Qt 5 an assumption was made in QKeyMapper that the underlying platform implementation needed the native scan code to be able to resolve the possible keymaps for an event. As a result, the macOS platform plugin started sending key events with a fake native scan code of 1, so that it would still be allowed to map key events. Which in turn led to the documentation of QKeyEvent::nativeScanCode() getting an exception for macOS. Let's clean up this by removing the original assumption, and leave it up to the platforms to decide what information from the key event is needed. QKeyMapperPrivate::possibleKeys() will still call extractKeyFromEvent as a fallback if the platform layer doesn't return any possible keys. Change-Id: I122a45bcec658c45ccc0b2c0671eb264d85d7be6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Convert a couple of APIs to use viewsLars Knoll2020-10-061-1/+1
| | | | | | | | | | | Try to get rid of APIs that use raw 'const {char, QChar} *, length' pairs. Instead, use QByteArrayView or QStringView. As QStringConverter is a new class, simply change the API to what we'd like to have. Also adjust hidden API in QStringBuilder and friends. Change-Id: I897d47f63a7b965f5574a1e51da64147f9e981f6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Refactor optimization flag handling and add optimize_fullAlexandru Croitor2020-10-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a bunch of helper functions to manipulate compiler flags and linker flags for the CMAKE_<LANG>_FLAGS_<CONFIG> and CMAKE_<LINK_TYPE>_LINKER_FLAGS_<CONFIG> CMake variables. These variables can be assigned and modified either in the cache or for a specific subdirectory scope, which will apply the flags only to targets in that scope. Add qt_internal_add_optimize_full_flags() function which mimics qmake's CONFIG += optimize_full behavior. Calling it will force usage of the '-O3' optimization flag on supported platforms (falling back '-O2' where not supported). Use the function for the Core and Gui subdirectories, to enable full optimization for the respective Qt modules as it is done in the qmake projects. To ensure that the global qmake-like compiler flags are assigned eveywhere, qt_internal_set_up_config_optimizations_like_in_qmake() needs to be called after Qt global features like optimize_size and optimize_full are available. This means that qtbase and its standalone tests need some special handling in regards to when to call that function. Task-number: QTBUG-86866 Change-Id: Ic7ac23de0265561cb06a0ba55089b6c0d3347441 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Simplify QAction privatesAllan Sandfeld Jensen2020-10-062-76/+44
| | | | | | | | List primary and alternative key sequences and ids together, making the logic cleaner. Change-Id: I4eb07f9828f2b15dc66c34ceb2c4f800df73e800 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Give QPlatformPlaceholderScreen a DPR of 1Morten Johan Sørvig2020-10-061-1/+0
| | | | | | | | | | | Use the default logicalDpi() implementation, which now returns logicalBaseDpi() and ensures a default device pixel ratio of 1. Change-Id: Idd408261c90b112a093c82695ff9e0078e90ac41 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QColorSpace: tidiesGiuseppe D'Angelo2020-10-061-1/+1
| | | | | | | | It doesn't actually need Q_DECLARE_PRIVATE (it never uses Q_D), it just needs to give friendship to the private class. Change-Id: I32ac128118a0c319a374e510a18ccf0edf323da7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QColorSpace: remove a redundant declarationGiuseppe D'Angelo2020-10-061-1/+0
| | | | | | | The same function was declared, as friend, a few lines above. Change-Id: I28368202c68242f2d30d25bd38f2f0e530a60082 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* rhi: vk: Reduce memcopies with full dynamic buffer updatesLaszlo Agocs2020-10-051-1/+4
| | | | | Change-Id: Ifc754a639fcdb45a1b1b8721393de9356504342f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove QPlatformScreen::pixelDensity()Morten Johan Sørvig2020-10-052-20/+0
| | | | | | | | | This function is no longer in use - Qt Gui now computes scale factors based on logicalDpi() and logicalBaseDpi() instead. Change-Id: Ieb4b75ef4e1563694a8e12b7cdd1f60c419d5bf2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make the logicalDpi() default implementation return 96Morten Johan Sørvig2020-10-051-10/+5
| | | | | | | | | | | | | Remove the code which calculates physical DPI and call logicalBaseDpi() instead. This will make sure that Qt gets a device pixel ratio of 1.0 by default, for the cases where the platform plugin does not implement logicalDpi() itself. Task-number: QTBUG-87035 Change-Id: I08433c9465be03d27b3decccb0e2e7e5e6aff0ae Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Streamline the template specialization of QESDP's dtorGiuseppe D'Angelo2020-10-052-4/+3
| | | | | | | | | | | | | | | | | | | | | Declaring and implementing out of line a specialization for QESDP's destructor is needed if we have an implicitly shared type and we want to provide an inline move constructor for it. The code is however a bit heavy on the eyes, and the full implementation for the destructor must be provided (read: copy and pasted) -- the specialization destructor cannot just "reuse" the one from the primary template. This patch adds a few macros to streamline the above, so that we can start using the same pattern in more places. These macros are completely private for the moment being; we don't want to push this solution for our users. Port QPixmap to the new macros. Change-Id: Ia6a51ad988483e44c9d97c0eca2fb003b6bd21e3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QStringTokenizer instead of QStringView::splitLars Knoll2020-10-051-2/+9
| | | | | | | | | | | This nicely optimizes a hot spot when our HTML parser was loading Qt documentation. This change improves the loading time of the Qt Concurrent overview page by 30%, both over the previous commit and 5.15. Fixes: QTBUG-86354 Change-Id: I4f401c2e6048096444e482c7724e3e3a6c71516e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>