summaryrefslogtreecommitdiffstats
path: root/src/widgets/graphicsview
Commit message (Collapse)AuthorAgeFilesLines
* Introduce QInputDevice hierarchy; replace QTouchDeviceShawn Rutledge2020-06-161-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have seen during the Qt 5 series that QMouseEvent::source() does not provide enough information: if it is synthesized, it could have come from any device for which mouse events are synthesized, not only from a touchscreen. By providing in every QInputEvent as complete information about the actual source device as possible, we will enable very fine-tuned behavior in the object that handles each event. Further, we would like to support multiple keyboards, pointing devices, and named groups of devices that are known as "seats" in Wayland. In Qt 5, QPA plugins registered each touchscreen as it was discovered. Now we extend this pattern to all input devices. This new requirement can be implemented gradually; for now, if a QTWSI input event is received wtihout a device pointer, a default "core" device will be created on-the-fly, and a warning emitted. In Qt 5, QTouchEvent::TouchPoint::id() was forced to be unique even when multiple devices were in use simultaneously. Now that each event identifies the device it came from, this hack is no longer needed. A stub of the new QPointerEvent is added; it will be developed further in subsequent patches. [ChangeLog][QtGui][QInputEvent] Every QInputEvent now carries a pointer to an instance of QInputDevice, or the subclass QPointingDevice in case of mouse, touch and tablet events. Each platform plugin is expected to create the device instances, register them, and provide valid pointers with all input events. If this is not done, warnings are emitted and default devices are created as necessary. When the device has accurate information, it provides the opportunity to fine-tune behavior depending on device type and capabilities: for example if a QMouseEvent is synthesized from a touchscreen, the recipient can see which touchscreen it came from. Each device also has a seatName to distinguish users on multi-user windowing systems. Touchpoint IDs are no longer unique on their own, but the combination of ID and device is. Fixes: QTBUG-46412 Fixes: QTBUG-72167 Task-number: QTBUG-69433 Task-number: QTBUG-52430 Change-Id: I933fb2b86182efa722037b7a33e404c5daf5292a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Long live std::pair!Giuseppe D'Angelo2020-06-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make QPair an alias for std::pair, and qMakePair just a forwarder towards std::make_pair. Why? Fundamentally to ditch a bunch of NIH code; gain for free structured bindings, std::tuple and std::reference_wrapper compatibility, and so on. Breakages: * Some that code manually forward declares QPair. We don't care about it (<QContainerFwd> is the proper way). * Some code that overloads on std::pair and QPair. Luckily it's mostly centralized: debug, metatypes, testing macros. Just remove the QPair overload. * Usages of qMakePair forcing the template type parameters. There are a handful of these in qtbase, but only one was actually broken. * std::pair is NOT (and will never likely be) trivially copiable. This is agreed to be a mistake done by practically all implementations in C++11, can can't be fixed without breaking ABI. Some code using QPair assuming it's trivially copiable may break; exactly one occurrence was in qtbase. * QMetaType logic extracts the type names in two different ways, one by looking at the source code string (e.g. extracted by moc) and one via some ad-hoc reflection in C++. We need to make "QPair" (as spelled in the source code) be the same as "std::pair" (gathered via reflection, which will see through the alias) when compared. The way it's already done e.g. for QList is by actually replacing the moc-extracted name with the name of the actual type used in C++; do the same here. On libc++, std::pair is actually in an inline namespace -- i.e. std::__1::pair; the reflection will extract and store "std::__1::pair" so we need an ad-hoc fix to QMetaType. [ChangeLog][QtCore][QPair] QPair is now an alias to std::pair, and does not exist as a class in Qt any more. This may break code such as functions overloaded for both QPair and std::pair. Usually, the overload taking a QPair can be safely discarded, leaving only the one taking a std::pair. QPair API has not changed, and qMakePair is still available for compatibility (although new code is encouraged to use std::pair and std::make_pair directly instead). Change-Id: I7725c751bf23946cde577b1406e86a336c0a3dcf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Unexport private classes that are no longer used outside QtWidgetsVolker Hilsheimer2020-06-081-2/+1
| | | | | | | | Address ### Qt 6 comments for QFramePrivate, QAbstractScrollAreaPrivate, and QGraphicsTransformPrivate. Change-Id: I9407c03247c7ea41decce6f9c289c16ad8bf0c3f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Phase 2 of removing QDesktopWidgetVolker Hilsheimer2020-06-082-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove QDestopWidget public header, simplify the implementation that maintains a Qt::Desktop type QWidget for each QScreen, and turn QWidget's initial target screen into a QScreen pointer. QApplication::desktop() now takes an optional QScreen pointer, and returns a QWidget pointer, so that applications and widgets can get access to the root widget for a specific screen without having to resort to private APIs. QDesktopWidgetPrivate implementations to look up a screen for an index, widget, or point are now all inline functions that thinly wrap QGuiApplication::screens/screenAt calls. We should consider adding those as convenience APIs to QScreen instead. Note that QWidget::screen is assumed to return a valid pointer; there is code that handles the case that it returns nullptr (but also code that trusts that it never is nullptr), so this needs to be defined, verified with tests, and asserted. We can then simplify the code further. Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Replace calls to deprecated QEvent accessor functionsShawn Rutledge2020-06-082-27/+27
| | | | | | | Many of these were generated by clazy using the new qevent-accessors check. Change-Id: Ie17af17f50fdc9f47d7859d267c14568cc350fd0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix UB in QGraphicsScene::wheelEvent()Lars Knoll2020-05-291-1/+2
| | | | | | | | | | | operator--() would iterate before begin() if the list was empty. This is UB, and will crash in Qt 6, where begin()/end() can return an iterator pointing to a nullptr if the list is empty. Change-Id: I39c3a8ebb09fcad75d42019b02426ac5ac05eed9 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Export the highlighter function so that we can use it in QtSvgWidgetsVolker Hilsheimer2020-05-291-4/+1
| | | | | | | That allows us to remove the copy of that function in QtSvgWidgets. Change-Id: I99d54408781c99b877c4df8fc9fc5f4139dcebb2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Reduce QDesktopWidget API to bare minimumVolker Hilsheimer2020-05-151-1/+1
| | | | | | | | | | | | | | | | | The class is documented as obsolete, and the majority of APIs is marked as deprecated. In this first phase, remove all explicitly deprecated APIs and trivial implementations. The test case is complete removed; what's left when code that uses any of those deprecated methods is removed is not testing anything meaningful. For some methods, there is no practical replacement using QScreen yet, and QDesktopWidget is still used in QWidget internals. Those require refactoring to only use QScreen before the rest can be removed. Change-Id: I8f7c968ec566820077221d37b817843758d51d49 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix potential memory leak by adding a virtual destructor to AnchorVertexVolker Hilsheimer2020-05-121-17/+18
| | | | | | | | | | | | | | | | | | The subclass AnchorVertexPair is allocated and passed around as pointers to AnchorVertex, and placed in lists that are then later cleaned up via qDeleteAll. This very likely results in memory leaks, as the compiler- generated ~AnchorVertexPair destructor is never called. Add a virtual destructor. Since there now is a vtable generated for AnchorVertex, remove the m_type member (which is only used for string generation in debug builds) and make toString virtual instead. Change-Id: I2cf184c0b1da1bd59b056a0f696a0e5479d4cb4e Fixes: QTBUG-84094 Coverity-Id: 218707 Pick-to: 5.15 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove dead code from src/widgetsVolker Hilsheimer2020-05-112-13/+0
| | | | | | | | Code that's removed via QT_VERSION(6, 0, 0) check is already no longer compiled. Change-Id: I70865f330a6260ac2e9cf2770d599a5b6f7bb7d4 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QGraphicsAnchorLayout: port to QHVContainer [4/4]: sweep Orientation -> ↵Marc Mutz2020-05-093-76/+73
| | | | | | | | | | Qt::Orientation This part of the patch changes all remaining occurrences of the local versions of Orientation to Qt::Orientation. Change-Id: Ic9ec19b8f069f614061f319abd30841e10cdd626 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QGraphicsAnchorLayout: port to QHVContainer [3/4]: Orientation as alias for ↵Marc Mutz2020-05-091-24/+3
| | | | | | | | | | | | | | Qt::Orientation There would still be too many renames, so keep the locally-defined names 'Orientation', 'Horizontal', and 'Vertical' as deprecated forwarders to Qt::Orientation, Qt::Horizontal and Qt::Vertical, resp. Follow-up patches will remove these, then, completely. Change-Id: Ifae926a38086027ad8fe4ad07d1d089c03f9508d Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QGraphicsAnchorLayout: port to QHVContainer [2/4]: edgeOrientation()Marc Mutz2020-05-082-10/+10
| | | | | | | | | | | | Port edgeOrientation() and all its callers from Orientation to Qt::Orientation. This function is singled out, since one caller is performing a conversion from Orientation to Qt::Orientation, which, if left unchanged, would cause an off-by-one bug. Change-Id: I37365195ea9552243822803b095a3926a28e7dd0 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QGraphicsAnchorLayout: port to QHVContainer [1/4]: local QHVContainerMarc Mutz2020-05-073-41/+47
| | | | | | | | | | | | | | | | | | This part of the patch changes the definitons of the member variables from 'C arrays of extent 2' to QHVContainer and fixes the code where ints were used to index into the array. To not drown in renames, keep the locally-defined enum 'Orientation', and create a local version of QHVContainer whose index operator is overloaded for both Qt::Orientation and the local 'Orientation'. Follow-up patches will remove these, then, completely. After this patch, NOrientations is no longer used, and consequently removed. Change-Id: I2a241520fce4beeb87fc0e26cd6ab18f324a956a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QGraphicsAnchorLayout: rename AnchorData::{orientation -> isVertical}Marc Mutz2020-05-072-11/+12
| | | | | | | | | That's basically what it is, and we don't want to extent the storage from one to two bits when porting QGraphicsAnchorLayoutPrivate::Orientation to Qt::Orientation later on. Change-Id: I965164141e8d08dbf190e2cd71d9bb7a272b1fda Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Clean up some more mixed enum/int mathGiuseppe D'Angelo2020-05-071-2/+2
| | | | | | | | | Add casts when necessary, and replace a bitwise trick with the proper function call. Pick-To: 5.15 Change-Id: I8b3109781af1e7fdc5d1c4c3fafe43394c81d71d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QGraphicsGridLayout: simplify a loop over Qt::Orientation valuesMarc Mutz2020-05-051-3/+1
| | | | | | | | Instead of selecting a Qt::Orientation value based on the integer loop variable, just loop over the possible Qt::Orientation values directly. Change-Id: I25b6f0d49c9b5a7e16e974dcc37668f801e65224 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Port QT_NO_TOOLTIP to QT_CONFIG(tooltip)Joerg Bornemann2020-04-215-8/+10
| | | | | | | | | | | | We remove the QT_NO_TOOLTIP check from qstandarditemmodel.h, because as the 'tooltip' feature is in QtWidgets, we cannot use it properly in QtGui. Also this affects just two non-virtual inline methods, i.e. it has no effect on library size. Task-number: QTBUG-82785 Change-Id: Ic166f14fb1cf3e9dd789573a6b9db6a87fb50e10 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@kdab.com> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Remove deprecated members from graphics view classesVolker Hilsheimer2020-04-169-261/+8
| | | | | Change-Id: Ia192de674b1085edcf4a88cdeada6df89b442ddd Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-111-4/+0
|\ | | | | | | | | | | | | Conflicts: tests/auto/network/socket/platformsocketengine/platformsocketengine.pri Change-Id: I22daf269a8f28f80630b5f521b91637531156404
| * Remove more calls to deprecated TouchPoint functionsShawn Rutledge2020-04-091-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Followup to ed3ed0b9db97a8fab0c03add23228b6b0a96f171 68916fede41d1eca5d07eb6b1db518d41a007616 and 3c159957f863cf8d367a9261e7016e52cd0348c1. In QWindowSystemInterfacePrivate::fromNativeTouchPoints() and QWindowSystemInterfacePrivate::toNativeTouchPoints() we continue using struct TouchPoint's QRectF area as storage for the screen position + ellipse diameters; as the comment says, this is _unrotated_, meaning that rotation is stored separately, and area should not be construed as the bounding box of the rotated ellipse. (In Qt 6 we can make the QPA touchpoint look the same as the QTouchEvent::TouchPoint to eliminate the need to calculate the center of the rect.) In QGraphicsScenePrivate::updateTouchPointsForItem(), setRect() sets the position and the ellipse diameters, but the latter is redundant because the purpose of this function is to localize a touchpoint to the coordinate system of a particular QGraphicsItem. Ellipse diameters should stay the same. In QApplicationPrivate::updateTouchPointsForWidget(), as in QGraphicsScene, we are localizing touchpoints to a widget and to the screen that the widget is shown on, so only the position needs to be set, while preserving the sub-pixel resolution that mapFromGlobal(QPoint) loses. Fixes: QTBUG-83403 Change-Id: I61d29e14cbe38567767b164af6ae895082c5e1a1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-04-083-6/+6
|\ \
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-083-6/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/doc/src/cube.qdoc src/corelib/global/qlibraryinfo.cpp src/corelib/text/qbytearray_p.h src/corelib/text/qlocale_data_p.h src/corelib/time/qhijricalendar_data_p.h src/corelib/time/qjalalicalendar_data_p.h src/corelib/time/qromancalendar_data_p.h src/network/ssl/qsslcertificate.h src/widgets/doc/src/graphicsview.qdoc src/widgets/widgets/qcombobox.cpp src/widgets/widgets/qcombobox.h tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro tests/manual/diaglib/debugproxystyle.cpp tests/manual/diaglib/qwidgetdump.cpp tests/manual/diaglib/qwindowdump.cpp tests/manual/diaglib/textdump.cpp util/locale_database/cldr2qlocalexml.py util/locale_database/qlocalexml.py util/locale_database/qlocalexml2cpp.py Resolution of util/locale_database/ are based on: https://codereview.qt-project.org/c/qt/qtbase/+/294250 and src/corelib/{text,time}/*_data_p.h were then regenerated by running those scripts. Updated CMakeLists.txt in each of tests/auto/corelib/serialization/qcborstreamreader/ tests/auto/corelib/serialization/qcborvalue/ tests/auto/gui/kernel/ and generated new ones in each of tests/auto/gui/kernel/qaddpostroutine/ tests/auto/gui/kernel/qhighdpiscaling/ tests/libfuzzer/corelib/text/qregularexpression/optimize/ tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/ tests/libfuzzer/gui/text/qtextdocument/sethtml/ tests/libfuzzer/gui/text/qtextdocument/setmarkdown/ tests/libfuzzer/gui/text/qtextlayout/beginlayout/ by running util/cmake/pro2cmake.py on their changed .pro files. Changed target name in tests/auto/gui/kernel/qaction/qaction.pro tests/auto/gui/kernel/qaction/qactiongroup.pro tests/auto/gui/kernel/qshortcut/qshortcut.pro to ensure unique target names for CMake Changed tst_QComboBox::currentIndex to not test the currentIndexChanged(QString), as that one does not exist in Qt 6 anymore. Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
| | * Doc: replace deprecated references to QGLWidgetChristian Ehrlicher2020-03-203-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Remove references to the deprecated QGLWidget and replace it with QOpenGLWidget. Change-Id: Ia31df42ab61c25e9ce46f4491267d2c64910f55c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Override virtual method in private class instead of downcastingVolker Hilsheimer2020-04-082-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move QGraphicsView specific code into reimplementation of now virtual (and const) canStartScrollingAt. Remove unhelpful comment. Change-Id: Ib4799e48ac4f85748c77c52d29511a0490303676 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QGraphicsView: consistently use ranged for and iteratorsVolker Hilsheimer2020-04-085-147/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - replace random access with ranged for - replace foreach with ranged for - add qAsConst where possible - iterate directly over QMap, rather than the keys (address FIXME comment) - add some const to ensure that code has no side effects on containers or indices used in different places Change-Id: I6199fd6edd5e4426c6c7fee0ff64ec9421a64cd5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Constify parameter in QGraphicsItem/Object debug streaming operatorVolker Hilsheimer2020-04-082-7/+5
|/ / | | | | | | | | | | | | | | Address FIXME comment. Change-Id: I55b6e458f2aead9baac8ab3bba7009ad993863e6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Remove QGuiAction again and split QAction implementation up insteadVolker Hilsheimer2020-03-292-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Duplicating the number of classes is a high price to pay to be able to have some QAction functionality behave differently, or be only available in widgets applications. Instead, declare the entire API in QtGui in QAction* classes, and delegate the implementation of QtWidgets specific functionality to the private. The creation of the private is then delegated to the Q(Gui)ApplicationPrivate instance through a virtual factory function. Change some public APIs that are primarily useful for specialized tools such as Designer to operate on QObject* rather than QWidget*. APIs that depend on QtWidgets types have been turned into inline template functions, so that they are instantiated only at the caller side, where we can expect the respective types to be fully defined. This way, we only need to forward declare a few classes in the header, and don't need to generate any additional code for e.g. language bindings. Change-Id: Id0b27f9187652ec531a2e8b1b9837e82dc81625c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-114-0/+4
|\| | | | | | | Change-Id: Ibee5acec72a1a1769d4bc5f23f56c7dc8d4cf3cb
| * Add default arguments to QPainterPath methods using transformJarek Kobus2020-03-064-0/+4
| | | | | | | | | | | | | | Fixes: QTBUG-82602 Change-Id: Id82f145ffb33e6d4ef9b81282ad14657b1c8fbd0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Remove various traces of QGLJohan Klokkhammer Helsing2020-02-281-1/+1
| | | | | | | | | | | | | | | | Removed friend declarations, some check etc. Task-number: QTBUG-74408 Change-Id: I1c5b46a564beee2c1d894678b908803f91df68aa Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Get rid of QMatrixJarek Kobus2020-02-286-210/+1
| | | | | | | | | | | | Task-number: QTBUG-81628 Change-Id: Iad66bfdf49b9ee65558a451108c086fc40dc3884 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-02-266-19/+40
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/bearermonitor/CMakeLists.txt examples/network/CMakeLists.txt src/corelib/tools/qlinkedlist.h src/sql/kernel/qsqldriver_p.h src/sql/kernel/qsqlresult_p.h src/widgets/kernel/qwidget.cpp src/widgets/kernel/qwidget_p.h tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/tools/moc/allmocs_baseline_in.json Change-Id: I21a3c34570ae79ea9d30107fae71759d7eac17d9
| * QGraphicsView: Clear the rubber band when dragMode changesVolker Hilsheimer2020-02-252-14/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | Without this change, and ongoing rubber-band selection will not be cleared when the dragmode property changes (e.g. because of a key press) which leaves a rubber-band displayed on the view. Move the rubber-band-clearing code from mouseReleaseEvent into a private helper that is then called from setDragMode. Change-Id: I32c15f7fe4ef2b8002ef5dd58e22f4bb30dd2409 Fixes: QTBUG-65186 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * Merge remote-tracking branch 'origin/5.14' into 5.15Friedemann Kleint2020-02-243-4/+6
| |\ | | | | | | | | | Change-Id: Ibe5b4aa249863a54007180f3684dc5ce1b23cb7b
| | * Fix wrong DPI used by QStyle::pixelMetric()Friedemann Kleint2020-02-223-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Pass on the option or the widget in order to ensure usage of the correct DPI for High DPI scaling. Task-number: QTBUG-82356 Change-Id: I5df903a83f88adebd143e514e2fead367d39f015 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| * | QGraphicsProxyWidgets: document that using OpenGL comes with limitationsVolker Hilsheimer2020-02-212-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation already states that high-performance scenarios are not a usecase that mixes well with QGraphicsProxyWidget. However, we can generally not test or support all combinations of widgets and styles with an OpenGL viewport. That Qt's basic framework code has to be graphicsview aware is already unfortunate enough; adding more special checks all over the place hurts maintainability, makes the general usecase slower, and poorly serves use-cases that are beyond of what QGraphicsProxyWidget was designed for. Change-Id: Iff43ead292240f7b068dcf9206bb3bee3031b1dc Fixes: QTBUG-63687 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Introduce QGraphicsLayoutItem::isEmpty()Jan Arve Sæther2020-02-254-24/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change does basically two things: * Renames QGraphicsGridLayoutEngineItem::isIgnored() to QGraphicsGridLayoutEngineItem::isEmpty() to be consistent with QLayoutItem::isEmpty() * Creates a new public API function QGraphicsLayoutItem::isEmpty() so that there is a public method of overriding the behavior. Change-Id: I771a8fb429f9764a75e220f0ff9d07f578f981d3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Remove QLinkedListSona Kurazyan2020-02-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QLinkedList has been moved to Qt5Compat. Remove and stop mentioning it in docs, examples (the docs & examples for QLinkedList itself will be moved to Qt5Compat) and remove the corresponding tests. Also remove QT_NO_LINKED_LIST, since it's not needed anymore. Task-number: QTBUG-81630 Task-number: QTBUG-80312 Change-Id: I4a8f1105cb60aa87e7fd67e901ec1a27c489aa31 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-02-131-6/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/graphicsview/boxes/scene.h src/corelib/Qt5CoreMacros.cmake src/corelib/Qt6CoreMacros.cmake src/network/ssl/qsslsocket.cpp src/network/ssl/qsslsocket.h src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp src/testlib/CMakeLists.txt src/testlib/.prev_CMakeLists.txt tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp Disabled building manual tests with CMake for now, because qmake doesn't do it, and it confuses people. Done-With: Alexandru Croitor <alexandru.croitor@qt.io> Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
| * | QGraphicsItem: optimize setCursor() for large number of graphic itemsAlexander Neundorf2020-02-031-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch optimizes setCursor() by invoking view->items(position) only if the current graphics item is under the mouse cursor. If it is not, setting the cursor for this item should not have any effect on the actually currently visible mouse cursor, so there should be no reason to call _q_setViewportCursor() at all in this case, so it is not necessary to query for all the items under the cursor position. In my use case this gives a significant performance improvement from slow behavior to almost immediately (Linux with X11). My scenario is that I have many rectangular graphic items next to each other in a graphics view, and there is the functionality to add one more graphics item (a "handle") to one of those rectangular graphics items, and then for this new "handle" a new graphics item will be added on each of the other existing rectangular graphics items. The ctor of the "handle" graphics item calls setCursor(Qt::OpenHandCursor). QGraphicsItem::setCursor() calls view->item(cursorPosition), and then updates the visible cursor according to the top most graphics item under the cursor. So assuming that there are e.g. 1000 rectangular graphics items next to each other, each showing e.g. 5 "handle" graphic items, adding one more "handle" graphics item will add one graphics item on each of the 1000 rectangular items, so 1000 times view->items(cursorPos) will be called, at the beginning with 6000 graphic items (1000 rectangles and 5000 handles) already in the scene, for the last one with 6999 items in the scene (999 "handles" have been already added), from which the ones under the cursor have to be found. This is basically O^2 complexity. With the patch it changes to linear regarding the number of rectangular graphics items. Change-Id: I9836fc710a8f11d01a94930ea64c6c946e0db282 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devSimon Hausmann2020-01-284-5/+21
|\| | | | | | | | | | | Change-Id: Ia5727ce68001bcaab467f5fae3a4933d1217015f
| * | Deprecate all methods that use QMatrixJarek Kobus2020-01-284-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use QMatrix in implementation classes anymore. Task-number: QTBUG-46653 Fixes: QTBUG-81627 Change-Id: I4806c1302e42645dc6a608062c8d9c336ae8629b Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-284-20/+20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsettings.cpp src/corelib/kernel/qvariant.cpp src/corelib/serialization/qjsoncbor.cpp src/corelib/serialization/qjsonvalue.cpp src/corelib/tools/tools.pri src/gui/image/qimage.cpp src/gui/kernel/qguivariant.cpp src/widgets/kernel/qshortcut.cpp tests/auto/tools/moc/allmocs_baseline_in.json tests/auto/tools/moc/tst_moc.cpp src/opengl/qglframebufferobject.cpp Done-With: Edward Welbourne <edward.welbourne@qt.io> Done-With: Leander Beernaert <leander.beernaert@qt.io> Change-Id: Ie7f5fa646c607fe70c314bf7195f7578ded1d271
| * | Doc/QtWidgets: replace some 0 with \nullptrChristian Ehrlicher2020-01-262-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace some 'is 0' or 'are 0' where 0 referes to a nullptr with 'is \nullptr' and 'are \nullptr' Change-Id: I5ff46185b570bdfc7d20d18a47fd9174771ad8e5 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
| * | Replace most use of QVariant::type and occurrences of QVariant::TypeOlivier Goffart2020-01-234-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-0917-223/+231
|\| | | | | | | | | | | Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
| * | Tidy nullptr usageAllan Sandfeld Jensen2019-12-0617-221/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | QGraphicsItem: Fix mouse tracking with modal panelsPaul Olav Tvete2019-12-051-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the case where a mouse tracking item is added to the scene while a modal panel is blocking. In order to optimize event delivery, mouse tracking is enabled for the view only when an item that needs it is added. This means that we cannot use itemAcceptsHoverEvents_helper(), since that returns whether the item _currently_ needs hover events, and we need to know whether it will need them in the future. [ChangeLog][QtWidgets][QGraphicsView] Fixed a bug where hover events would not be delivered if the item was added while blocked by a modal panel. Fixes: QTBUG-77233 Change-Id: Ifc95869f2cc9c8c048330928ef8a13cd27cfd0f9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-256-20/+14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qhash.h src/gui/kernel/qevent.h src/widgets/kernel/qshortcut.cpp src/widgets/kernel/qshortcut.h Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620