summaryrefslogtreecommitdiffstats
path: root/src/widgets/graphicsview
Commit message (Collapse)AuthorAgeFilesLines
* Use SPDX license identifiersLucie Gérard2022-05-1653-2014/+106
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QWidgetTextControl: port to new-style connects (faster)David Faure2022-05-102-13/+10
| | | | | | | | | | | | | | | This speeds up creating a QGraphicsTextItem by 14% in an optimized build Before: 0.070 msecs per iteration After: 0.060 msecs per iteration Those connects were showing up when profiling, because of the string parsing that is necessary when using SIGNAL/SLOT macros. The stacktrace was connect() => decodeMethodSignature() => argumentTypesFromString() => QArgumentType constructor => qMetaTypeInternal(const char*). Pick-to: 6.3 6.2 5.15 Change-Id: I3cf5655c5450f121005140bdb587fafa083cce6a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Avoid rubberband artifacts under fractional DPR scalingEirik Aavitsland2022-05-041-1/+1
| | | | | | | | | | Expand the rubberband repaint area with one pixel to account for rounding on screens with fractional device pixel ratio. Fixes: QTBUG-102717 Pick-to: 6.3 6.2 Change-Id: Iede638d48dfbc3156b02ada28dfe99719b9d5efa Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QtWidgets: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-05-024-12/+20
| | | | | | Task-number: QTBUG-98434 Change-Id: I310ea8f19d73a79d985ebfb8bfbff7a02c424360 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtWidgets: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-261-2/+2
| | | | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Change-Id: I133b80334b66e0a5ab9546dd8e1ff0631e79601e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Rest of QtBase: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERNMarc Mutz2022-04-072-5/+3
| | | | | | | | | | | | | | | | It's one of our best tools to improve compile times. In some places, we can't do the change, yet, because there's no .cpp file for the header file. Also mark Q_DECLARE_METATYPE macros that are in the wrong place. We shouldn't have Q_D_M markup for public classes in .cpp or _p.h files. Fixes: QTBUG-102206 Change-Id: Iec0a39e4745571b24d07dacc87593321967c10e3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Graphicsview: Avoid background clearing glitches under fractional DPREirik Aavitsland2022-04-061-0/+5
| | | | | | | | | | | | | | | | | | | QGraphicsView enables autoFillBackground on the viewport widget, so the dirty area is cleared before repaint. Then QGraphicsView fills the same area with the background color. However, under fractional DPR scaling, the scaled version of the dirty rect may end up covering only a fractional part of the pixels on the edges. If antialising is enabled, such pixels will be only partially filled with the background color, leaving the clear color partially visible as glitches. This can be seen in the dragdroprobot example. Fix by disabling AA during background filling, as it has no purpose then anyway. Task-number: QTBUG-96223 Pick-to: 6.3 6.2 5.15 Change-Id: Ica00997141701faa0cf368caced84ae50ba017d0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: fix documentation for QGraphicsItem::setAcceptedMouseButtons()Christian Ehrlicher2022-04-021-1/+1
| | | | | | | | | | Fix the documentation to pass Qt::NoButton instead 0 to QGraphicsItem::setAcceptedMouseButtons() since 0 is no longer accepted by QFlags. Change-Id: Ib98d509382e5b5407a07c74565adb7ee5afbb35f Pick-to: 6.2 6.3 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* Refactor: use lambdas for visitor pattern in QGraphicsSceneBspTreeVolker Hilsheimer2022-03-182-72/+26
| | | | | | | | | | This way, the visitor implementations are directly where they are used, without the need for a virtual function call. The allocation of the visitors on the heap was anyway overkill (they could just have been allocated on the stack where they were used). Change-Id: Ic41fd285e3a45daaf2e17aa5aeee07e754127a00 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* When clearing selected items, iterate over a copy of the QSetVolker Hilsheimer2022-03-181-2/+4
| | | | | | | | | | | | | | | | Selection change handlers of the items might call a method that implicitly recreates the selectedItems QSet, which then invalidates the iterators of the ranged for loop, resulting in crashes. Iterate over a copy of the set instead. Add a test case that crashen without the fix. Fixes: QTBUG-101651 Pick-to: 6.3 6.2 Change-Id: I6da6f4043fe1906b0186931a37283f635cb5a404 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Widgets: Do not depend on transitive includesFabian Kosmale2022-03-171-0/+1
| | | | | Change-Id: Idfd7af066264dd38375d45771693a536a1985607 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Don't include qeventpoint_p.h from qevent_p.hMarc Mutz2022-01-142-0/+2
| | | | | | | | | | | The header no longer uses QMutableEventPoint. Fix TUs that relied on the transitive include. Task-number: QTBUG-99615 Pick-to: 6.3 Change-Id: Iae4ff34ea708304fcd365fd763875dd4a97a1cf8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QMutableEventPoint: add static overloads of settersMarc Mutz2022-01-082-3/+3
| | | | | | | | | | | | | | These overloads don't require a cast from QEventPoint to QMutableEventPoint, thus avoiding undefined behavior. Port easy users of QMutableEventPosition::(const)from() to the new API. Pick-to: 6.3 Task-number: QTBUG-99615 Change-Id: I4e9228322134ef7c712ca478ee8286466efc3585 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QGraphicsItem: Update input context after InputMethod eventJarkko Koivikko2021-11-271-0/+1
| | | | | | | | | | | | Without updating the input context, the input method goes out of sync with the text control. Fix by updating the input context after InputMethod event. Fixes: QTBUG-98544 Pick-to: 6.2 5.15 Change-Id: Idfb99bb0f886249cdab923b8dbed96277800c064 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Avoid painting outside boundaries when printing QGraphicsProxyWidgetEirik Aavitsland2021-11-091-0/+4
| | | | | | | | | | | Implement clipping to widget geometry when rendering to other paintdevices. Fixes: QTBUG-98026 Pick-to: 6.2 5.15 Change-Id: I5652bdb8cc052ae34f05ea7963943d2b5b28e220 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* widgets: Fix typos in source code commentsJonas Kvinge2021-10-153-9/+9
| | | | | | Pick-to: 6.2 Change-Id: I22f71a53b0f7f0698450123343e25548c889c3e2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Tidy up in QGraphicsWidget::resize()Edward Welbourne2021-10-141-37/+28
| | | | | | | | | | | Simplify various conditions. Eliminate duplication from an overly-complex if/else cascade. Move the set-up of a QGraphicsSceneResizeEvent to only happen if it's going to be used. Change-Id: Ie51aa5de5f2bd1603478ae0cda0fd4279334f45a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Eliminate use of goto in QGraphicsWidget::resize()Edward Welbourne2021-10-141-17/+20
| | | | | | | | Get rid of the gotos by packaging the wrap-up code in a QScopeGuard. Thanks to Volker Hilsheimer for suggesting that solution. Change-Id: I71bebf59263ce05f111d1fcfcec93f4635a35428 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix typo: alignment has an n in itEdward Welbourne2021-10-141-2/+2
| | | | | Change-Id: If64edd32c5084984227b3c366932b3129df94b31 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* widgets: Fix typos in documentationJonas Kvinge2021-10-125-23/+24
| | | | | | Pick-to: 5.15 6.2 Change-Id: I6b77f0ec043d08da3b7958d780dce9595daf97a6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Forward touchEvents to children inside QGraphicsProxyWidgetVolker Hilsheimer2021-09-062-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reapplies the fix from 1ecf2212fae176b78c9951a37df9e33eb24d4f2d, using QApplication::translateRawTouchEvent to dispatch the touch event received by the QGraphicsProxyWidget to the relevant child widgets under each touch point. In addition, limit the implicit grabbing of each touch point before sending the event to those cases where we have to: touch pads, and if the target widget comes from a closest-widget matching. And don't call the QTouchEvent override of QEvent::setAccepted() on QTouchEvent instances in QGraphicsView classes, as this will override each event point's acceptance state. This way, we can identify which touch points have been accepted after event delivery, any only implicitly grab those points that were. Otherwise, touch points not accepted by a proxied widget hierarchy will still be part of an accepted event, and be grabbed by the viewport of the QGraphicsView. This would then lead to infinite recursion when the QGraphicsProxyWidget passes the TouchUpdate event on to each touch point's grabber. Re-activate the test case, and extend it with more combinations. Refactor touch-event recording to make it easier to test multi-touch scenarios. Task-number: QTBUG-45737 Fixes: QTBUG-67819 Pick-to: 6.2 Change-Id: Id5611f4feecb43b9367d9c2c71ad863b117efbcb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Port to QImage and QPixmap deviceIndependentSize()Morten Sørvig2021-09-011-2/+2
| | | | | | | | | Replace the “size() / devicePixelRatio()” pattern with a call to deviceIndependentSize(). Change-Id: I9d9359e80b9e6643e7395028cd43e3261d449ae7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Revert "Forward touchEvents to children inside QGraphicsProxyWidget"Volker Hilsheimer2021-08-301-6/+7
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 1ecf2212fae176b78c9951a37df9e33eb24d4f2d. The fix is not correct after all. TouchBegin goes to the correct widget with the fix, but following TouchUpdate and TouchEnd events now go to the viewport, as QApplication::translateRawTouchEvent always gives precedence to the widget that Qt recorded to be the touch grabber, which is the viewport. This results in infinite recursion, as the proxy widget trying to send the touch events to the embedded widget (expecting that translateRawTouchEvent will split it up) ends up sending the events back to the viewport. Leave the added test case as QEXPECT_FAIL, reactivate the (never run, hence unnoticed) test that the fix broke. Pick-to: 6.2 6.1 Task-number: QTBUG-45737 Task-number: QTBUG-67819 Change-Id: I4810affb3cd066743ae94ab7beb2f0c06b60d211 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QGraphicsView: send timestamp information through QGraphicsSceneEventVolker Hilsheimer2021-08-264-0/+34
| | | | | | | | | | | | | | | | | Qt relies on event timestamp information to detect double click events. The information was not passed through QGraphicsSceneEvent, so the synthesized QMouseEvent delivered for the second press of a double click to an embedded widget was never recognized as a double click. This requires addition of a new setter/getter to QGraphicsSceneEvent. Event though not all QGraphicsSceneEvent instances will have a valid timestamp, this provides us with more flexibility than adding the API to several QGraphicsSceneEvent types (mouse, touch, wheel). Pick-to: 6.2 Fixes: QTBUG-96009 Change-Id: I343f25902286157f6d6670641dfad9c92dd44250 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Refactor QApplication::translateRawTouchEvent to take a QTouchEvent*Volker Hilsheimer2021-08-261-3/+1
| | | | | | | | | | | | Both call sites just pass the data from an existing QTouchEvent through, so just pass the QTouchEvent through instead. Amends 20d4f45a132606f7a910050d468519108486e9cf. Pick-to: 6.2 Change-Id: If3b9508b83311889b58e109e7f64743985b8b178 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Forward touchEvents to children inside QGraphicsProxyWidgetVolker Hilsheimer2021-08-261-8/+9
| | | | | | | | | | | | | | | | | | | | Just sending the event to the embedded widget is not enough, we have to perform hit-testing for the different touch points, and send the event to the child widget under the point. Fortunately, QApplicationPrivate::translateRawTouchEvent provides the logic that generates multiple events for groups of touch points. Since that helper always sent events spontaneously, add an optional parameter to allow sending of non-spontaneous events. Add a test case that simulates touch events to different widget configurations inside a QGraphicsProxyWidget. Fixes: QTBUG-67819 Task-number: QTBUG-45737 Pick-to: 6.2 6.1 5.15 Change-Id: Iffd5c84c64ee2ceadc7e31863675fdf227582c81 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QGraphicsProxyWidget: forward Window(De)Activate eventsVolker Hilsheimer2021-08-241-0/+4
| | | | | | | | | | | | | | | | | | The nested widget might be a QGraphicsView as well (documented to be supported), and QGraphicsScene maintains it's own activation status by counting Window(De)Activate events. We need to make sure that the embedded widget is informed about its activation status so that deeper nested children can receive focus. Forward WindowActivate/Deactivate events to the nested widget, which will pass it on to all its children. Add test case, which without this fix fails when verifying the inner scene's isActive state, or later when testing that focusInEvent is delivered to the embedded widget. Fixes: QTBUG-94091 Pick-to: 5.15 6.1 6.2 Change-Id: I4e0ecef50685ed081d15c7f76b6c1a4a40ed2682 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix QScroller::scrollTo failing in QGraphicsView with movable itemChunLin Wang2021-08-201-1/+1
| | | | | | | | | | | When forcing software scrolling through QScroller::scrollTo, it will start from (0, 0). QGraphicsViewPrivate::canStartScrollingAt should consider the locationof points, not just the flags of item. Fixes: QTBUG-70255 Pick-to: 5.15 6.1 6.2 Change-Id: Iebdd5568baa3bdb41c705204dadb2895cfe9c0e2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QGraphicsProxyWidget: fix propagation of high-precision eventsVolker Hilsheimer2021-08-164-3/+104
| | | | | | | | | | | | | | | | | | | | | | | | | In order to fix QTBUG-95552 properly we have to add APIs to QGraphicsSceneWheelEvent that informs QGraphicsProxyWidget about whether the event is a high-precision event where Qt grabs the wheel. If it is, then the wheel grabber will be the QGraphicsView's viewport, and any wheel event sent to any widget will be grabbed by it. This results in infinite recoursion, partly fixed in change I78400ceae8da7a4e22a988c06ed58f99f1a979f4. The proper fix is to re-grab the wheel by the embedded widget if it (or any of its children) accepts the ScrollBegin event (and if not, return the grab to the QGraphicsView). This fixes the scenarios that failed in the test case, so now scrolling through nested widgets and scrolling in nested widgets works as the user would expect. Fixes: QTBUG-95552 Pick-to: 6.2 Change-Id: I3e1f31cbff999c70f8c63c034f77cd2ae567d7e3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Don't crash in high-precision wheel scrolls on a QGraphicsProxyWidgetVolker Hilsheimer2021-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For high-precision wheel scrolling sequences, the widget that gets the first (typically ScrollBegin) event grabs the wheel. Qt directs all future wheel events within the same sequence (i.e. until ScrollEnd) to that widget. QGraphicsView passes wheel events through to the item under the mouse, and QGraphicsProxyWidget implements wheelEvent to forward a synthesized QWheelEvent to the embedded widget. Since QGraphicsView's viewport has already grabbed the wheel, any forwarded event would end up back in QGraphicsView, resulting in infinite recursion (if the assert doesn't fail first in debug builds). The correct fix requires that QGraphicsProxyWidget knows that this is a high-precision wheel event, allowing it to adjust the wheel grabber temporarily to the embedded widget. However, QGraphicsSceneWheelEvent doesn't provide this information. To fix the infinite recursion, mark the generated event as synthesized by Qt (but still send it spontaneously to enable propagarion within the proxy widget hierarchy). In QApplication's notification routine, interpret such events then to override the wheel grabber. Add a test case for the various scenarios. This 6.1 compatible fix does not pass all situations. A follow up commit that introduces the missing APIs to QGraphicsSceneWheelEvent then fixes those as well. Task-number: QTBUG-95552 Pick-to: 6.1 6.2 Change-Id: I78400ceae8da7a4e22a988c06ed58f99f1a979f4 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix various -Wdeprecated-enum-float-conversions around the codeMarc Mutz2021-07-271-1/+1
| | | | | | | | | | | In two cases, it was as easy as replacing an unnamed enum's values with constexpr variables. In the case of QSimplex, I opted for qToUnderlying(), as the enum made sense on its own. Change-Id: Ifcf5be14bd2f35e50adabdbd7ecdb2e83f6bf5b4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Consistent indentation for all Q_PROPERTYsAndreas Buhr2021-06-243-9/+18
| | | | | | | | Task-number: QTBUG-94407 Pick-to: 6.2 Change-Id: I8c97a0b2de2bed78456322be271724fc47479d83 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Move overrideCursor() from QApplication to QGuiApplicationSze Howe Koh2021-06-191-3/+3
| | | | | | | | The transfer occurred in Qt 5 Pick-to: 5.15 6.1 6.2 Change-Id: Id3428809d89c804112d9dc02f2a476cb03bd2c98 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Use \deprecated instead of \obsoletePaul Wicking2021-05-263-4/+4
| | | | | | Task-number: QTBUG-93990 Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix compiler warning, explicitly use 64bit shiftVolker Hilsheimer2021-05-071-1/+1
| | | | | | | | | | | | | | | The 1 literal is an int, shifted by an int, and then passed into resize, which takes a 64 bit value. This makes MSVC complain about warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) Silence that warning by explicitly making the 1 a 64bit long long. Change-Id: Ica354166de4adae20e05e176dc72b7ccd1af053f Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Consistently check for nullptr in QGraphicsTextItem::inputMethodQueryVolker Hilsheimer2021-03-191-8/+10
| | | | | | | | | | | | If dd->control is nullptr, then it's nullptr all the way, so don't dereference it in the calls to dd->controlOffset. Fixes static analyzer warning 9c33d9bc9b8cf438dccb63aa52afcbe0. Pick-to: 6.1 6.0 5.15 Change-Id: I7a61b6438422373678d4fcb66255b750c550724d Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QGraphicsWidget: don't dereference nullptrVolker Hilsheimer2021-03-031-1/+1
| | | | | | | | | | | | | Unlikely that one item is nullptr and the other item doesn't have a scene, but we do already test for the scene pointer, so don't continue if it's nullptr. Fixes static analyzer warning f59576ecf6618447c4f9c7be93fc737f Pick-to: 6.1 Change-Id: I6d436bb1211ddd412821d6978bab25192033f5e5 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QGraphicsWidget: Check for nullptrs in focus chain handlingVolker Hilsheimer2021-03-031-2/+4
| | | | | | | | | | | | | | The while loops terminate if focusAfter becomes nullptr (unless we break earlier), so don't dereference those pointers without checking first. Fixes static analzyer warnings 979f2d508db4d5838f6c9b296120ce60 and 481f2ec7b5851bf19414478428f944b7 Pick-to: 6.1 Change-Id: I60fc5999907fe3b3146d7047ee1eff197719ab31 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Add nullptr checks to QGraphicsView classesVolker Hilsheimer2021-03-032-19/+23
| | | | | | | | | | | | | | The styleInfo parameter defaults to nullptr, and the scene can evidently be nullptr since we test for it before ungrabbing the mouse. Fixes static analyzer warnings fbd03604cc701651595a2ea33c5562b4 and 30fcb05194f3a2d121fc57b05e0ccf10 Pick-to: 6.1 Change-Id: I8e9d4fe4055115c366ada1cbb22a8f0839ba41da Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix z-value of QGraphicsItems being ignored during drawQiang Li2021-02-281-1/+1
| | | | | | | | | | | | | | | In QGraphicsScene's function draw, don't copy the children into a const copy (to prevent detaching in the loops), as they might get sorted. Instead, use a const reference. Amends e349f787d595aa343ca86af94159b6730d55b8d5, which introduced the bug by making a copy of the unsorted list. Fixes: QTBUG-81316 Pick-to: 6.0 6.1 Change-Id: Iab9b87e75178a883806088a9db234c7a2aaa9301 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-071-61/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-302-2/+2
| | | | | | | | | | | | | | 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. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Replace qt_make_unique with std::make_uniqueAllan Sandfeld Jensen2020-11-231-5/+3
| | | | | | | We can depend on C++14 now. Change-Id: Iee9796cd22dbfbb70d4bdb25f0eee1662a026d6d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Allow QMutableSinglePointEvent to be copy- and default-constructedVolker Hilsheimer2020-11-172-6/+5
| | | | | | | | | | | | | | | | | 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>
* Adjust code format, add space after 'if'Zhang Sheng2020-11-162-2/+2
| | | | | | Change-Id: Ice081c891ff7f4b766f49dd4bd5cf18c30237acf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Doc: Add missing brief statements for \property documentationTopi Reinio2020-11-121-2/+2
| | | | | | | | ... where applicable. Fixes: QTBUG-88232 Change-Id: I835df434765caededd35d5114965b4a1663e7942 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix QGraphicsView's abuse of QEvent's d-pointer in Leave event handlingVolker Hilsheimer2020-11-112-7/+12
| | | | | | | | | | | | | | QGraphicsSceneEvent carries a widget pointer, and we can add a new event type. Assert that QGraphicsScene doesn't get Leave events from elsewhere. This was the only "usage" of QEvent's d-pointer in Qt, so with this gone we can reduce the size of QEvent by 8 bytes. Change-Id: I0513daf742de9084d0469d55b7a7f41b667e8081 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Rename remaining QEvent variables to m_ convention; init m_reservedShawn Rutledge2020-11-101-3/+3
| | | | | Change-Id: I08694657b7c9d2713d0cb33519698dbba3bfdffa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* InputMethod should call reset() function when proxywidget lost focusZhang Hao2020-11-041-1/+12
| | | | | | | | | | fix When the preview of input Chinese appears,the proxyWidget lose focus and does not call the reset method of inputMethod. Fixes: QTBUG-88016 Pick-to: 5.15 Change-Id: I82a66207b0d2046d768430ac3e93df86c1ed3681 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix Clang compiler warnings (-Wrange-loop-analysis)David Skoland2020-10-171-3/+3
| | | | | | | | | | | | | | | In a macOS environment, Clang throws a number of compiler warnings about loop variables when building qtbase. See task for more info about the environment. This changes a handful of loop variables, like QJsonValue references into QJsonValueRefs. Task-number: QTBUG-87216 Pick-to: 5.15 Change-Id: I26006efd7c75c2d56ebc7f7efb4c9bdcabe92e8b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>