summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Give QEventPoint a d-pointer after allShawn Rutledge2020-09-103-94/+222
| | | | | | | | | | I still have doubts that QEventPoint can't be made small enough that copying would be cheaper than reference-counting and all the indirections in now-noninline accessors, but this gives us the usual freedom to change the data members later on. Change-Id: I792f7fc85ac3a9538589da9d7618b647edf0e70c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Create consistent sets of QImage methodsAllan Sandfeld Jensen2020-09-092-8/+49
| | | | | | | Adds consistently named inplace and imperative methods. Change-Id: I8739c1c4585d2ba4aa181bb9a681255d76c120d7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Refactor testlib touch functions into qtestsupport_gui and _widgetsShawn Rutledge2020-09-082-1/+121
| | | | | | | | | | | | | Because we removed public setters from QTouchEvent and QEventPoint in 4e400369c08db251cd489fec1229398c224d02b4 and now it's proposed to give QEventPoint a d-pointer again, the implementation of QTouchEventSequence needs to start using QMutableEventPoint: being a friend will no longer be enough, because the member variables won't be accessible in the future. But because we have separate test libs for Gui and Widgets, it needs to be further refactored into two classes. Change-Id: I0bfc0978fc4187348ac872e1330d95259d557b69 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove deprecated method QOpenGLFunctions::initializeGLFunctions()Marcel Krems2020-09-082-11/+0
| | | | | Change-Id: I0c02b22630f8c9d463f48f6402a1930b60d3f818 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove deprecated API from QSurfaceFormatMarcel Krems2020-09-082-43/+0
| | | | | Change-Id: I8dacdaa18cea967a85e8835c2440ba53ee5df2e1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove deprecated method QTextList::isEmpty()Marcel Krems2020-09-082-20/+0
| | | | | Change-Id: I7acc0bb110c2bed55374576f59c24451afa7742a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Clean up QTextBoundaryFinder and qunicodetoolsLars Knoll2020-09-071-3/+2
| | | | | | | | | | | Make QTBF ready for Qt6 by using qsizetype in the API and use QStringView where it makes sense. Change the exported API of qunicodetools to use QStringView as well and use char16_t internally. Change-Id: I853537bcabf40546a8e60fdf2ee7d751bc371761 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove deprecated method QQuaternion::conjugateMarcel Krems2020-09-072-17/+0
| | | | | Change-Id: If539e47618357ef329925033842f266447632e6f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use C++17 [[maybe_unused]]Allan Sandfeld Jensen2020-09-062-168/+168
| | | | | | | In some places needs to be ordered before const/constexpr though. Change-Id: I57a521ac0ad22b5a018761c4d52befbef69d64c0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of hasPendingEvents() and flush()Lars Knoll2020-09-063-16/+0
| | | | | | | They are unused. Change-Id: I77383f2be45551401ed9c2f88285511134cc8b0d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* When finding the engine for a fallback font, then clear the familiesAndy Shaw2020-09-051-0/+1
| | | | | | | | | | | If it is a fallback font, then it should just have family set to that font so it does not get interference from what the families were originally set to. Fixes: QTBUG-85560 Change-Id: I6232f3d2ae12052fa3b0b3bc0e7f106e239a585d Pick-to: 5.15 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Remove some obsolete codeLars Knoll2020-09-053-95/+0
| | | | | | | Those checks aren't required anymore for Qt 6. Change-Id: Ida9f93544f42cb03723659a81e0094aa0cf14799 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Change translation context of strings to new classVolker Hilsheimer2020-09-051-13/+6
| | | | | | | | | | | The strings were in QFileDialog context even though they were in QFileIconProvider, probably for historical reasons. Now that the strings have been moved into QtGui, using a QtWidgets class as the context makes no sense. Change-Id: Ia4f3bd18abaab2a5fbbb94e945782f4d2d94e7d1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix compiler warnings from using deprecated qChecksum overloadVolker Hilsheimer2020-09-052-4/+4
| | | | | Change-Id: Ib7a6d0e752dc662a42abe38f2010da3f2b4626f1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* xcb: drop Xinerama supportLiang Qi2020-09-042-17/+1
| | | | | | | | | | [ChangeLog][Important Behavior Changes][X11] Xinerama is no longer supported. Fixes: QTBUG-86082 Change-Id: Ieb57d9035e1659fc22bf8333247fc3573fb62992 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Merge QPainterPathPrivate and QPainterPathDataVolker Hilsheimer2020-09-043-93/+70
| | | | | | | As per ### Qt 6 comment, and the code that never allocated QPainterPathPrivate. Change-Id: I553e3559fdb2a675f37cdd9855462a2f22ef84c6 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Remove deprecated QPrinter and QPagedPaintDevice APIsVolker Hilsheimer2020-09-045-416/+4
| | | | | | | | | | | Adjusting the QPrinter test case - some use cases no longer exist, or are already tested in QPageSize and QPageLayout tests. Adjust examples and manual tests. Change-Id: I01cbc65f3d8031aea2dac86dd942126ba708b111 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Tighten up QDialogButtonBox::ButtonLayout enumVolker Hilsheimer2020-09-032-11/+0
| | | | | | | | | | ... and the equivalent enum in QPlatformDialogHelper. No need to keep numerical values the same anymore. Remove ### Qt 6 comment. Change-Id: Ib369ea6ca2362f6ab0f71a3a6c90c4adaa7f11cd Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix build without features.highdpiscalingTasuku Suzuki2020-09-041-2/+2
| | | | | | | Broken since 37d5aaa4b42f9c837f0d27edb9da2185971d02be Change-Id: Id741f23ccae4f619e6a389ee71b3e7fe0c599989 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* rhi: Sanity check the srb in debug buildsLaszlo Agocs2020-09-036-2/+91
| | | | | | | | | | | Instead of cryptic assertions and crashes depending on the backend, show some useful warnings (in debug builds only) when one tries to create an srb with a list where there are duplicated bindings. (a mistake that happens relatively often during the development of frameworks, such as Quick 3D, on top) Change-Id: If1b50a2e8165b001878ad566e048f146e636514f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Mark obsolete QPrinter functions as deprecated from 5.15 onVolker Hilsheimer2020-09-033-3/+19
| | | | | | | | | | | Some of the methods are overrides of virtuals in QPagedPaintDevice, so document and mark those as obsolete as well. Adjust code that calls those APIs to use the recommended replacement. Change-Id: I3cd1980609ea20808d17379a5f97ca595e869875 Pick-to: 5.15 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Long live QKeyCombination!Giuseppe D'Angelo2020-09-0313-39/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++20 via P1120 is deprecating arithmetic operations between unrelated enumeration types, and GCC 10 is already complaining. Hence, these operations might become illegal in C++23 or C++26 at the latest. A case of this that affects Qt is in key combinations: a QKeySequence can be constructed by summing / ORing modifiers and a key, for instance: Qt::CTRL + Qt::Key_A Qt::SHIFT | Qt::CTRL | Qt::Key_G (recommended, see below) The problem is that the modifiers and the key belong to different enumerations (and there's 2 enumerations for the modifier, and one for the key). To solve this: add a dedicated class to represent a combination of keys, and operators between those enumerations to build instances of this class. I would've simply defined operator|, but again docs and pre-existing code use operator+ as well, so added both to at least tackle simple cases (modifier + key). Multiple modifiers create a problem: operator+ between them yields int, not the corresponding flags type (because operator+ is not overloaded for this use case): Qt::CTRL + Qt::SHIFT + Qt::Key_A \__________________/ / int / \______________/ int Not only this loses track of the datatypes involved, but it would also then "add" the key (with NO warnings, now its int + enum, so it's not mixing enums!) and yielding int again. I don't want to special-case this; the point of the class is that int is the wrong datatype. Everything works just fine when using operator| instead: Qt::CTRL | Qt::SHIFT | Qt::Key_A \__________________/ / Qt::Modifiers / \______________/ QKeyCombination So I'm defining operator+ so that the simple cases still work, but also deprecating it. Port some code around Qt to the new class. In certain cases, it's a huge win for clarity. In some others, I've just added the necessary casts to make it still compile without warnings, without attempting refactorings. [ChangeLog][QtCore][QKeyCombination] New class to represent a combination of a key and zero or more modifiers, to be used when defining shortcuts or similar. [ChangeLog][Potentially Source-Incompatible Changes] A keyboard modifier (such as Qt::CTRL, Qt::AltModifier, etc.) should be combined with a key (such as Qt::Key_A, Qt::Key_F1, etc.) by using operator|, not operator+. The result is now an object of type QKeyCombination, that stores the key and the modifiers. Change-Id: I657a3a328232f059023fff69c5031ee31cc91dd6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Long live QAIM::multiData!Giuseppe D'Angelo2020-09-022-5/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Views / delegates absolutely *adore* hammering data(). A simple QListView showing a couple of dozens entries can call data() a hundred of times on the first show. Back of the hand calculation, * 2 times per visible item (sizeHint() + paint()), * times 9 roles used by the default delegate, * times 20 visible items = 360 as a bare minimum, assuming the view doesn't redraw twice accidentally. Move the mouse over the view, and that'll cause a full update with certain styles: 360 calls to data() per update. This has an overhead visible in profilers. The model's data() has to re-fetch the index from its data structure and extract the requested field every time. Also, QVariant is used for the data interexchange, meaning anything that won't fit in one is also a memory allocation. This problem will likely be gone in Qt6Variant as that will store sizeof(void*) * 3, meaning QImage/QPixmap and similar polymorphic classes will fit in a QVariant now... So I'm trying to to remove part of that overhead by allowing views to request all the data they need in one go. For now, one index a a time. A view might also store the data returned. The idea is that the same role on different indexes will _very likely_ return variants of the same type. So a model could move-assign the data into the variant, avoiding the memory allocation /deallocation for the variant's private. This patch: 1) Introduces QModelRoleData as a holder for role+data. 2) Introduces QModelRoleDataSpan as a span over QModelRoleData. The idea of a span type is twofold. First and foremost, we are in no position to choose which kind of container a view should use to store the QModelRoleData objects for a multiData() call; a span abstracts any contiguous sequence, leaving the view free to do whatever it wants (statically allocate, use a vector, etc.). It also solves the problem of efficient passing the roles and gathering the returned variants from multiData(). 3) Add multiData(), which populates a span of roles for a given model index. The main advantage here is that a model can fetch all the needed information for a given index just once, then iterate on the span and provide data for each requested role. Cf. this with data(), where every call has to re-fetch the information for the index. A couple of models have been ported to multiData(), as well as QStyledItemDelegate. [ChangeLog][QtCore][QModelRoleData] New class. [ChangeLog][QtCore][QModelRoleDataSpan] New class. [ChangeLog][QtCore][QAbstractItemModel] Added the multiData() function. Change-Id: Icce0d108ad4e156c9fb05c83ce6df5f58f99f118 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove last traces of the PostScript paint engineVolker Hilsheimer2020-09-022-2/+0
| | | | | | | Remove enum value, documentation, and another ### Qt 6 comment. Change-Id: I046d9581625d39c8fc8cf75287e8767501aae0cc Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* High-DPI: Remove legacy environment variablesTor Arne Vestbø2020-09-021-35/+2
| | | | | | | | | | | | | QT_DEVICE_PIXEL_RATIO is replaced by QT_SCALE_FACTOR, while QT_AUTO_SCREEN_SCALE_FACTOR is replaced by QT_ENABLE_HIGHDPI_SCALING. Since High-DPI is now always enabled, there's no reason to keep the code path for android.app.auto_screen_scale_factor. Also, based on the original commit message that introduced this code, the value of the property should have been true. Change-Id: Ib34b1deeab46c488c67c4d64f087599b4a54dc55 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Document native interfacesFriedemann Kleint2020-09-0210-9/+511
| | | | | | | | | | | | | | As the private headers are not included by default in the precompiled header QDoc builds for QtGui, create a custom module header for the documentation build and pull in the required headers. Add dummy declarations for Windows-specific types for building docs on non-Windows platforms. Task-number: QTBUG-83252 Change-Id: I225ed08f68cf4f7c1f1d093424070b13ce36aa51 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QTextHtmlParserNode: Fix warnings flood about setting negative pixel sizeFriedemann Kleint2020-09-021-1/+2
| | | | | | | | | | | Exclude the default value (-1) from the check. Amends 0bd770fb875d5391dd78df95542c25bd15051938. Pick-to: 5.12 5.15 5.15.1 Change-Id: Ib98ae166fd5fdab546c5d4212ce78345b5c9b583 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove "fallback session management"Andreas Hartmetz2020-09-015-97/+1
| | | | | | | | | | | | | | With the Qt6 compatibility break, it can finally be removed. Closing windows (which might quit the application with quitOnLastWindowClosed() true, the default) acted contrary to the documentation of the commitDataRequest() signal, which could have been a hint. This removes the workaround API from the fix for QTBUG-49667 and also removes the problematic feature that it worked around. Change-Id: I672be58864ef062df7fb7f2a81658b92c4feedd2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: compile transform snippetsPaul Wicking2020-09-013-3/+12
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Fixes: QTBUG-81486 Change-Id: Ie35d22469e7f8d9c244b70665af30b39e265766a Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: compile separations snippetsPaul Wicking2020-09-015-16/+27
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: I62294cedd4a0f96ebc2513b5b4179d451bb4b375 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: compile scribe-overview snippetPaul Wicking2020-09-013-17/+23
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: If760744aba49361d8d9ed51c4a2641b743c35c25 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: compile textobjectinterface snippetPaul Wicking2020-09-013-0/+11
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: Ibad1ef95b85d5484ee7e9cceee8019d026c10cb9 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: compile qstatustipevent snippetPaul Wicking2020-09-013-2/+11
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: I44c7b31e0a99009f51f81e2c8d0e736e6eafd535 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: compile qimagewriter snippetPaul Wicking2020-09-013-16/+19
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: Ibb4087d7035c3061b2980b317ab4280fa38aab50 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: compile qfileopenevent snippetPaul Wicking2020-09-013-1/+10
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: I28d7e9749b7a8feacd6b82abebcea462010caeba Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: compile polygon snippetsPaul Wicking2020-09-013-48/+56
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Change-Id: I29caf1818154df3b0f2b599ac19c966e826f6287 Taks-number: QTBUG-81486 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: compile plaintextlayout snippetPaul Wicking2020-09-013-55/+54
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: I2bac37fd41703cc4cfb7de3946b31412c4af37b9 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: compile picture snippetsPaul Wicking2020-09-013-25/+31
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: I9daf8ed8c7d9620cd59feb40677795cbac30c97c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Remove obsolete snippet filePaul Wicking2020-09-011-150/+0
| | | | | | | | | | QMatrix is gone, remove the snippet file as the content is not referenced anywhere. Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: I57040bce50cc51f7a3580af65cc56713567330f9 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: compile image snippetsPaul Wicking2020-09-014-58/+36
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: 81486 Change-Id: I9860217a80cf94d27542d7e7836fe60fcd60897e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: compile droprectangle snippetsPaul Wicking2020-09-013-43/+17
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: I0087f7cc0746168bc2223972074fed468c3fba46 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Compile dropevents snippetsPaul Wicking2020-09-013-5/+32
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: I8d2eebcd82f47c500a215e310b5828f9b7e303c6 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Remove unused snippet filesPaul Wicking2020-09-016-418/+0
| | | | | | | Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: I7bf5794ffc9f96ca0cb85cc6f58b4400468df439 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Make snippets Qt Gui compilable - textblock-fragmentsNico Vertriest2020-09-014-9/+19
| | | | | | Task-number: QTBUG-81486 Change-Id: I3a6ee6ef744abb694d1cc7ef409f8bb584854395 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Remove unused files from snippetPaul Wicking2020-09-013-295/+0
| | | | | | | | | These files aren't referenced from anywhere and duplicates other snippet content. Remove them. Task-number: QTBUG-81486 Change-Id: I48976dae3c095ae38ced682147527f2809a8fef6 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Make snippets Qt Gui compilable - textblock-formatsNico Vertriest2020-09-013-5/+10
| | | | | | Task-number: QTGUI-81486 Change-Id: I06dd6ce04b4d37c49df07d4b1b47c3ef029ee419 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Compile droparea snippetPaul Wicking2020-09-014-82/+22
| | | | | | | | | | | droparea.h has been removed. Remove all code that depends on that header except the one snippet that is still used. Add minimal code to allow the snippet to be compiled. Done-with: Nico Vertriest <nico.vertriest@qt.io> Task-number: QTBUG-81486 Change-Id: I58c80d3527c82389ccff97567f4c75c33aec0f5e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Make Qt Gui snippets compilable - textdocument-texttableNico Vertriest2020-09-013-3/+11
| | | | | | Task-number: QTBUG-81486 Change-Id: If77873649aa10552047e0f89a7fccf55597e73f5 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Compile textdocument-tables snippetsPaul Wicking2020-09-015-12/+18
| | | | | | | | Minor code cleanup in passing. Task-number: QTBUG-81486 Change-Id: I23f8b3a22f627050582c69c81e5e0b85b5e45768 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Make Qt Gui snippets compilable - textdocument-selectionsNico Vertriest2020-09-015-18/+21
| | | | | | Task-number: QTBUG-81486 Change-Id: I467ca4d5ecd33f84e44b456a9559748ffd6cc53c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>