summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Update QPalette() documentation to not mention the application paletteTor Arne Vestbø2021-01-041-1/+4
| | | | | | | | | | | | | | | | | | | It's an implementation detail that the default constructed palette happens to use the d-pointer of the application palette, and as a result has the same colors as the application palette if requested. The palette has an empty resolve mask, and hence all the colors in the palette are undefined. Users should not rely on QPalette() to represent the application palette when for example overriding a parent palette. Task-number: QTBUG-85226 Change-Id: Ia6747887eef6e9a5f21b2002066608c433260de2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 74559dccc84ed0f0f7d8f57165fe387c3e112485) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Clarify QWindowPrivate::maybeQuitOnLastWindowClosedTor Arne Vestbø2020-12-171-3/+3
| | | | | | | | | | | | | | We only need to check QGuiApplication::quitOnLastWindowClosed() at the point where we've actually concluded that the last window was closed. Checking for !q->parent() was redundant, as we were already exiting early when !q->isTopLevel(). Change-Id: I934e186d707361b31d19692c04d2e17b7ba0f49e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 1649137b9311a5ee3d12bc8824f5453294bd6fe9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc: Remove dpiawareness command line argumentTor Arne Vestbø2020-12-071-2/+0
| | | | | | | | | | | We don't want to (officially) expose customizations like this to the user, now that high-DPI is always enabled and should work. Change-Id: I2f0bd7c625b565896b0766586f191ff5001eb60a Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit ecb61c17f5f22a997d98da9ce750367bc02d1f96) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QInputDevice: Parent default keyboard to core app singletonFabian Kosmale2020-12-041-1/+1
| | | | | | | | | | | | With this we can avoid leaking the QInputDevice which is created when the platform plugin does not provide any. The onwership is solved in a similar way as in the plugins, except that here we have no parent which really fits, so we use QCoreApplication::instance instead. Change-Id: I77a212fb592ba3d5a42b2ecd486763e3b4d3410e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit bc093cd294cbf48eb93b776fc0b927f0a43fa603) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-12-044-5/+5
| | | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 0440614af0bb08e373d8e3e40f90b6412c043d14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix links to Application ExampleVolker Hilsheimer2020-12-021-1/+1
| | | | | | | | | | | The example was renamed in 6cb36d825d365988ea7a601218bdd3a329290469. Change-Id: Ic9daac60002c9988dfeb5c7dcde74edb69388f37 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com> (cherry picked from commit 0cc9a99865c4b6dfb1a212a5aba0fc5907f19b24) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix documentation links to High DPI documentationAndreas Buhr2020-12-011-1/+1
| | | | | | | | | | | | The documentation on High DPI was recently rewritten, renaming several sections. This patch fixes the links which were broken by this change. Task-number: QTBUG-88533 Change-Id: I5e9417554270a6740986d7cec5e3433d043e5560 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 10b6a87679d02d7cf5dcd2f75d5640ffb1e1303e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update setHighDpiScaleFactorRoundingPolicy docsTor Arne Vestbø2020-11-271-6/+3
| | | | | | | | | | | The default is now passthrough. And let's not mention the environment variable overrides, as they are meant for internal testing. Change-Id: Ie2409e5411d4bdcdf041834cb5ca9e1215aa173a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 58afadc624cf284cfe93d6a5c85557ed6e4f9765) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows QPA: Pass device for synthesized touch/tablet eventsFriedemann Kleint2020-11-272-0/+33
| | | | | | | | | | | | Add the overloads for mouse events with device/without timestamp and pass the active tablet or touch device. Task-number: QTBUG-88678 Task-number: QTBUG-46412 Change-Id: I8695b493540d0cbf50e9c72afe870a7633de3ab9 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit d3caea04dc6c3a7072a43294b70bec860c199bf1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Output source in debug operator of QMouseEventFriedemann Kleint2020-11-251-0/+4
| | | | | | | | | Task-number: QTBUG-88678 Task-number: QTBUG-46412 Change-Id: If9282f5b845ef16ff7e7ce523f78e3b8adfbef90 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 45c623c42ac26eafff8e401709fa4c97ed9cd585) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Return subclass type from overrides of QEvent::cloneVolker Hilsheimer2020-11-241-34/+34
| | | | | | | | | | | C++ allows overrides to return a covariant type, so if calling code has already cast the callee down to the right type, don't require it to cast the returned clone down as well. Change-Id: I802f00a3c78e03047046986d0ed0a479b47573b8 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 146b37cdf376fb2fde85fa27326acfbeb2a024e3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QGuiAppPriv: don't clear target and window for TouchCancelShawn Rutledge2020-11-211-2/+0
| | | | | | | | | | | | | It's nice not to leave garbage in QPointingDevicePrivate::activePoints between events; on the other hand, this garbage doesn't matter, because every press event sets the target and window independently, without caring what was stored there from before. But it was wrong to clear it before we've even delivered the TouchCancel event. Change-Id: I924039a7c7a8ed75f420d1837c63dc19d3cc98b6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 45a65cbeb2775da71d4e7b417b45d54341a3ee7f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix documentation warnings for Qt GUITopi Reinio2020-11-193-5/+4
| | | | | | | | | | | | | | | - Remove obsolete dependencies and references. - Restore previously deleted snippet code referenced in richtext.qdoc. - Add widgets snippets path to exampledirs; some classes were moved from QtWidgets to QtGUI and related \snippet commands were broken. - Mark internal functions under QNativeInterface::Private as \internal. Task-number: QTBUG-86295 Change-Id: I9c165c860c7191dac65972d702698a1745bff77f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Disable copying and assigning of QEventVolker Hilsheimer2020-11-192-12/+41
| | | | | | | | | | | | | | Polymorphic classes should not be copied. However, we do rely on event copying in our propagation logic. So, make the members protected, don't delete them, using a dedicated macro. This way, QMutable*Event classes can be used to make copies. Remove some last usage of copying of QInputMethod(Query)Events. Change-Id: Ia0a8ae4ca9de97dcd7788ca3c6ed930b6460c43a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Consolidate static_asserts for event sizesVolker Hilsheimer2020-11-172-4/+4
| | | | | | | | | | | | The assertion for size of QMouseEvent and Q(Mutable)SinglePointEvent being equal was previously in QtDeclarative; qtbase should already fail to build if they ever diverge. Having the checks in a single translation unit is enough, qevent.cpp is the obvious choice. Change-Id: I80ad24273738dfde8b165323ac1e790c320c707c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Allow QMutableSinglePointEvent to be copy- and default-constructedVolker Hilsheimer2020-11-171-1/+2
| | | | | | | | | | | | | | | | | Since QMutableSinglePointEvent is just an access-helper to QSinglePointEvent, we can safely create one from the other. This covers QMouseEvent as well with the right casting in place. And by making QMSPE default constructable, we can use it in code that needs to frequently copy event data, for example in QtQuick. This allows us to make the copy c'tor and assignment operators for QEvent classes protected, which prevents potentially dangerous (ie. slicing) implicit copies. Change-Id: I815774847cca63896f46c43df683053b3d952b61 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Allow cloning of event objectsVolker Hilsheimer2020-11-171-1/+72
| | | | | | | | | | | | We have use cases for cloning of events, e.g. in the state machine and for event propagation. Provide the means to do so through a virtual method. Adapt QFutureCallOutEvent::clone, which is now an override. No code seems to be using that method. Change-Id: I6864d6597f6de800343c4dc458a7994e84dc6fb4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-166-21/+21
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Make QEventPoint an idiomatic value typeVolker Hilsheimer2020-11-163-72/+71
| | | | | | | | | | | | | | | | | | Use atomic ref counting and make type movable. Make a moved-from QEventPoint valid but undefined. Given that the d pointer is anyway loaded into the register, the additional check doesn't cost much, and makes the class more compliant with our guide for value types in Qt. Add a free swap overload via Q_DECLARED_SHARED, which also declares the type as movable. As a drive-by, remove superfluous inline. This also silences some static analyser warnings. Change-Id: I7c4a436fce44556aa37026ac26dc2061e1f01de9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Inline trivial getters for QEvent subclassesVolker Hilsheimer2020-11-132-51/+27
| | | | | Change-Id: Ic0ee4f3e311e1068d23796cee4fe58008a2a8114 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Clean up and pack data members of QEvent classesVolker Hilsheimer2020-11-122-83/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure all bits reported by sizeof for the most important public event classes are used optimally. QEvent is 24bytes large due to default alignment in C++, so we might just as well use bool instead of bitfields for the most important data members. This generates less (and thus smaller and faster) code, and we still have plenty of bits available for future needs. Default the copy constructor and assignment operator, the assert and tracing seem to be relics from the Qt 3/4 days. Note: QEvent's d-pointer is currently unused, with the exception of a hack in QGraphicsView. Removing that would save another 8 bytes through the entire event hierarchy. For the new classes in the QInputEvent hierarchy, apply the same principle. Allocate bits in QInputEvent and QSinglePointEvent to fill the 8-byte aligned space. Using some of those bits for QMouseEvent and QWheelEvent makes sure we don't increase the size for those in spite of additionally reserved bits. As a result of this, several QInputEvent and subclasses become 8 bytes smaller on clang and gcc (with the exception of QNativeGestureEvent) while at the same we have more space for future extensions. The sizeof's for the various classes on different compilers produce these before and after result: clang +/- gcc +/- msvc +/- QEvent 24 0 24 0 24 0 QInputEvent 56 -8 56 -8 48 0 QPointerEvent 80 -8 80 -8 72 0 QSinglePointEvent 96 -8 96 -8 88 0 QMouseEvent 96 -8 96 -8 88 0 QTabletEvent 112 -8 112 -8 96 -16 QKeyEvent 104 -8 104 -8 96 0 QNativeGestureEvent 120 0 120 0 120 0 QWheelEvent 112 -8 112 -8 112 -8 So, with this change we save 8 bytes on gcc and clang for many event types, esp on Linux systems. As a drive-by: replace ulong with quint64, make QTabletEvent data floating point, and rename some variables for clarity. Change-Id: I4cf81c8283262cbf59ee3fb7064a59837332ced7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Document physicalDotsPerInch high-DPI behaviorMorten Johan Sørvig2020-11-121-0/+3
| | | | | | | | | The values are in device-independent dots, which may be unexpected. Task-number: QTBUG-62649 Change-Id: I85d0e3dd6bd428dd351ebf22281b1f4d9a1b2dc4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Document physicalDotsPerInch high-DPI behaviorMorten Johan Sørvig2020-11-121-0/+9
| | | | | | | | | Add note to the member function documentation, in addition to the class documentation. Task-number: QTBUG-62649 Change-Id: I5cce6c06b58e70ef6c051d63c2901b219fa6d6b9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Purge QCoreApplicationPrivate::cloneEvent and overridesVolker Hilsheimer2020-11-123-348/+1
| | | | | | | | Not used anywhere in Qt 6, and if whatever needs this ever comes back, then we won't implement it like this. Change-Id: I99655ba5825644cef3686bbe50ca688b68f5c2a4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Add missing brief statements for \property documentationTopi Reinio2020-11-121-25/+25
| | | | | | | | ... where applicable. Fixes: QTBUG-88232 Change-Id: I835df434765caededd35d5114965b4a1663e7942 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Replace ushort -> quint16 in event classesShawn Rutledge2020-11-102-6/+6
| | | | | | | | We used quint32 for 32-bit types and ushort for 16-bit ones, but using explicit bit sizes looks more consistent. Change-Id: I3106dd6ecb2367fef6f8012c28266e1b4b1abf4b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Silence "same window" warning when QPA doesn't give touch dest windowShawn Rutledge2020-11-101-6/+4
| | | | | | | | | | | | Platform plugins should dispatch events to specific windows when possible; but eglfs currently doesn't do that, so this warning was printing for many touch events. Now we print it only if the window that the platform plugin says *should* handle a touch move or release is non-null and *different* than the one that actually handled the press. Fixes: QTBUG-88192 Change-Id: Ia3271b5e67902dcf8a1cdae605adec470c3cfd89 Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
* Reset the velocity Kalman filter when the mouse enters a windowShawn Rutledge2020-11-101-0/+12
| | | | | | | | | | | | | | If we always tracked the mouse, we could always have accurate velocity; but most of the time, when the mouse enters a top-level window, we don't know how fast it was moving at that time, unless the application has requested a window-system mouse grab. It's better to assume that any residual velocity stored in the persistent QEventPoint instance (in QPointingDevicePrivate::activePoints) is inaccurate, and just start over from zero. Especially for the sake of autotest sanity. Task-number: QTBUG-88346 Change-Id: Id6c4fbffb8a86a8ab50a09f09aa62125d10155b4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Move the remaining QSinglePointEvent ctor to protected; add source argShawn Rutledge2020-11-102-13/+13
| | | | | | | | | | | | | QSinglePointEvent no longer has public constructors: we don't expect users to construct instances, because it's conceptually an abstract base class (even though some subclasses don't add more storage). We give it a Qt::MouseEventSource argument so that m_source won't need to be set in other subclasses. There was some hope of removing MouseEventSource completely, but it hasn't been done, for the sake of avoiding SC breaks. Change-Id: Iea2946699726fb7ac98757b7b8f1b7cfdccc1449 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove code for non-enhanced mouse eventsShawn Rutledge2020-11-102-74/+25
| | | | | | | | | | | | Followup to a37785ec7638e7485112b87dd7e767881fecc114. The mouse button that caused the event and the current state of all mouse buttons must always be given separately in QPA mouse events. Task-number: QTBUG-59277 Task-number: QTBUG-62329 Task-number: QTBUG-63467 Change-Id: I27209b3730baef325ce0f1c4d3778930e72d5465 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Improve QPointerEvent qDebug operatorsShawn Rutledge2020-11-092-35/+50
| | | | | | | | | | | | Use the property=value format consistently for the QPointerEvent types. Abbreviate property names for compactness, but show more info. Omit device seatName(), pointerType(), capabilities(), maximumPoints() and uniqueId() when they are uninteresting. In the case of uniqueId() it's uninteresting when it's not valid (-1) rather than when it's 0. Add QMouseEvent::scenePosition(). Change-Id: Ia076c5958e8f7032929517401d332b07d2fd0e78 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Introduce QEvent::isSinglePointEvent()Shawn Rutledge2020-11-072-3/+21
| | | | | | | | | | | | This makes high-level event dispatching easier: for example we often need to cast an event to access getters like button() and buttons(). We can so far assume that any QPointerEvent that is not a QTouchEvent is a QSinglePointEvent; but more explicit type-checking looks safer. Implemented in a similar way as c7f727996909338c3689396160f3060480521846. Change-Id: I980d759e2a7538b6b30fd3bdc3be0c351ec6c246 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move QEventPoint and QPointingDeviceUniqueId out of qeventVolker Hilsheimer2020-11-0711-894/+1138
| | | | | | | | | | | | | | | | | | | qevent.h/cpp are huge already, no need for more classes. Move QEventPoint into new qeventpoint.h/cpp files, and QPointingDeviceUniqueId into qpointingdevice.cpp; the class is already declared in qpointingdevice.h. Move the documentation of QEventPoint APIs next to the implementation, and document all APIs as properties. Add Q_PROPERTY macro where missing. QEventPoint::device needs a workaround of qdoc due to the type being a pointer-to-const; qdoc doesn't know how to tie a \property to it, but documents it correctly. While at it, move the logging category declarations to the header matching the .cpp file where they are defined. Change-Id: I096e609edbb760b5686d577e7fe47eea0807904e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix mouse velocity calculationShawn Rutledge2020-11-061-1/+8
| | | | | | | | | | | | | The mouse event that is sent to QPlatformCursor is in native pixels, but the QSinglePointEvent constructor sets QEventPoint::globalLastPosition every time, and velocity is calculated by delta from globalLastPosition to globalPosition. We plan to rely on this velocity being correct in Qt Quick, in Flickable for example. So globalLastPosition and globalPosition need to be in the same coordinate system at the time QPointerEvent::setTimestamp() is called. Change-Id: I39f97a43f55f47a70cbd574861e920f3106e2125 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add multi key bindings to QShortcutAllan Sandfeld Jensen2020-11-043-27/+236
| | | | | | | | | | | This makes it feature comparable with QAction, and makes it possible to use as a backend for QAction, and fixes a few missing alternative keybindings in qtwidgets. Change-Id: Iaefc630b96c4743fc5ef429dc841870ddd99fc64 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add QEventPoint::normalizedPosition() to replace normalizedPos()Shawn Rutledge2020-11-032-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 4e400369c08db251cd489fec1229398c224d02b4 we deprecated normalizedPos() because we suspect it's a legacy feature that few users will need. However Qt developers keep bringing up the continued usage in autotests over and over. (It's IMO not wrong to keep testing deprecated functions in autotests, but the warning keeps attracting attention.) Of course it will turn out that normalizedPos() has users; we just don't know how many. One way to look at it is: why should they copy a snippet of code to calculate it, when it costs us so little to continue to provide this accessor. It might also turn out that some users will complain that in Qt 5 it was passed through from the device driver (or at least from the window system API) to the application, and perhaps the replacement will not always work, for example if availableVirtualGeometry() ends up wrong, or there is some strange scenario that generates events that are out-of-bounds for the device that the event professes to come from, so that the "normalized" coordinates also go outside the [0..1] range. We reserve the right to put back the storage in QEventPointPrivate if the need arises; so that's why this function is not inline. We continue to hope that startNormalizedPos() and lastNormalizedPos() are used even less and won't be missed much, because it would be wasteful to store them all the time if only a few users need them. Change-Id: I23ed78843e3f9e16133c5b6f462884a3845f91b6 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Clean up qcontainerfwd.hLars Knoll2020-11-031-3/+0
| | | | | | | | | | | | Add missing declaration of QVariantList and friends. Replace class with typename for template parameters. Remove some left-over forward declarations in other headers. Change-Id: I31d443019d48b619e02834395dafa40182cac7b9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Address API review comments for QInput/QPointingDeviceVolker Hilsheimer2020-11-036-37/+27
| | | | | | | | | | | | | | - Give default constructor an optional parent, as is standard for QObjects - remove default for QObject parent from inheritance constructor - make QPointingDeviceUniqueId comparison inline, remove superfluous inline of hidden friends - mark read only properties as CONSTANT - remove bit-size from enum types; they are stored in the private, and there are just a few instances; no need to save a few bytes at the expense of performance and code cleanliness Change-Id: Ie7d4a587362714e9d3bc41447cef786bbdb382c6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix typoVolker Hilsheimer2020-11-021-1/+1
| | | | | Change-Id: Ia8ce9ac486d1ee54a772367cba90b42197f622d1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Get rid of QInputDevicePrivate::extraShawn Rutledge2020-10-301-1/+0
| | | | | | | | | | | | | | | Since QPA plugins own the input device objects that they create, they can also subclass to add arbitrary extra data (as was done with QWinTabPointingDevice in abb5f0d3768a817b7e30639107210e64b8dbc138); so this pointer seems unnecessary. It's unused so far AFAIK. Retaining it also brings up the possibility of a memory leak: ~QInputDevice() doesn't delete it, and whatever code stores something there would need to make sure it gets deleted. Change-Id: I7ec264c23c74b83db1f37f64f31857caf551fdae Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix QScreen orientation not being updated when setting a platform screenFriedemann Kleint2020-10-301-1/+1
| | | | | | | | | | | | ScreenPrivate::updatePrimaryOrientation() depends on the geometry being set which is calculated by updateHighDpi(). Move the call up. Amends 370289bef68d8505b66cb27150a3f596e23c5ed3. Task-number: QTBUG-76902 Change-Id: I8188e04ad4a2ef7d414a2b78ecb3dd6c64528fa6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit d10c34b0cc896c711fce8ae5629e3cc3d74b6452)
* Change terminology to "look and feel"Jerome Pasion2020-10-291-1/+1
| | | | | | | | -should be "look and feel" Task-number: QTBUG-88010 Change-Id: Icd71c84e2331faa317a228cdbaaa82e7598b781f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QSurfaceFormat: Make comparison operators hidden friendsVolker Hilsheimer2020-10-282-29/+29
| | | | | | | | Reduce ADL noise. Also add noexcept. Task-number: QTBUG-87973 Change-Id: I83787264b00b084ecdc85b6b3c2a8d95db94a05e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Make comparison operators hidden friendsVolker Hilsheimer2020-10-283-15/+24
| | | | | | | | | Reduce ADL noise from QKeyEvent, QKeySequence::StandardKey, and QPointingDeviceUniqueId. Task-number: QTBUG-87973 Change-Id: Ib4a3190d03046949acb25b3fe68c611689b82565 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix documentation warningsVolker Hilsheimer2020-10-243-23/+3
| | | | | | | | | Declare hidden friends like qdoc expects them, and other signature fixes Document function parameters Remove documentation for removed APIs. Change-Id: I44c1caeed0d40be04612129d074acc30b75f5259 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Rename “pixelDensity” variablesMorten Johan Sørvig2020-10-232-16/+16
| | | | | | | | | | | | | QHighDpiScaling now computes scale factors based on QPlatformScreen::logicalDpi(), instead of by calling QPlatformScreen::pixelDensity() as done earlier. We forgot the rename the internal state variables, update them to indicate that platform screen DPI is used. Change-Id: Ib718a6176e0ac138395eea13b292f75f69dac3ad Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make QEvent::setAccepted() virtual; set QEventPoints state the sameShawn Rutledge2020-10-222-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | In Qt Quick, when we deliver an item-specific QTouchEvent that contains only the subset of eventpoints that are inside the Item's bounds, traditionally the Item can accept the event to tell the delivery logic that the event is handled and doesn't need to be delivered further. But an Item cannot be expected to have total scene awareness; so now, the delivery is "done" only when all eventpoints in the original event are accepted. This behavior has been working well enough already due to logic in QQuickWindow that iterates the points and accepts them if the event is accepted; but it seems appropriate to move this enforcement into QPointerEvent itself. Making setAccepted() virtual gives us a useful degree of freedom. Event-handling code should alternatively use QEventPoint:setAccepted() or QPointerEvent::setExclusiveGrabber() to take resonsibility for only a subset of the touchpoints. Another way to put it is that we treat QPointerEvent::setAccepted() as a convenience method: accepting the QEventPoints is what counts (at least in Qt Quick). Change-Id: Icec42dc980f407bb5116f5c0852c051a4521105a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add forwarding headers for classes moved from QtWidgets to QtGuiVolker Hilsheimer2020-10-201-3/+3
| | | | | | | | | | | | | | | The QT_BEGIN_NAMESPACE QT_END_NAMESPACE block is added to avoid warnings from the build system's sanity check. As a drive-by, fix the include guards in the QtGui/QActionGroup header. Change-Id: Ie10e7830c3b00a3548123f58498def49b194c7aa Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add QSinglePointEvent::exclusivePointGrabber convenience propertyShawn Rutledge2020-10-202-0/+23
| | | | | | | | | | | Since a single-point event (such as a QMouseEvent) only carries one point, it only has one grabber, so we can have a normal Q_PROPERTY. It's named exclusivePointGrabber to avoid shadowing the QPointerEvent::[set]exclusiveGrabber functions that take QEventPoint&. Change-Id: Ie18f1c1849ed057b98f229de7b17b7fc3f3eea36 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update QHighDpiScaling internal documentationMorten Johan Sørvig2020-10-202-57/+105
| | | | | | | | Document new conversion functions and how the new public API (rounding) effects QHighDpiScaling operation. Change-Id: I801fc065cdb4904811a009510b08cac630b83fe7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>