aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-alpha1Qt Forward Merge Bot2019-02-071-1/+1
|\ | | | | | | Change-Id: I5209d833e171c795556c075e2a5f964b59b6df2e
| * QQuickWindow: don't give exclusive grab to invisible or disabled ItemsShawn Rutledge2019-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | An Item might set itself invisible or disabled while handling a mouse press, as an alternative to rejecting the event. In earlier Qt versions (e.g. 5.6) it did not end up with a grab in such a case. Task-number: QTBUG-63271 Change-Id: I12f646e4217d773d396f380672420c85e6adcd52 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-013-1/+12
|\| | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4codegen.cpp Done-With: Erik Verbruggen <erik.verbruggen@qt.io> Change-Id: I3ae3d64317e4f3fccba6605f4c6da15479ca75e0
| * TapHander: do not "want" an eventPoint that is outside parent boundsShawn Rutledge2019-01-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far it was checking parentContains() on press, release, or when the gesturePolicy is WithinBounds, but not for each movement when the policy is DragThreshold (the default). This might explain most of the remaining warning noise: "pointId is missing from current event, but was neither canceled nor released" because it was possible for TapHandler to remember wanting a point that it should not have wanted, but without taking any kind of grab, and then complaining when that point was no longer present. Since it did not grab, it did not get the release, unless the release was part of an event containing a point that it DID grab. Fixes: QTBUG-71887 Change-Id: I26ce62279574cf6b0150f24e486f224a604ac6b1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * TextInput: Stop leaking password values to process memoryIvan Čukić2019-01-292-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The contents of a deleted QString can still remain in memory and can be accessible by tools that read the raw process memory. The same problem appears when the QString reallocates -- the old buffer gets deleted, but its contents will remain in memory. This means that a TextInput that serves as a password input field can leak parts of the password while the user is entering it (due to reallocation) and the whole password when the TextInput instance is destroyed. With this patch, the contents of the m_text string member variable will be zeroed-out before the TextInput is destructed. This is done only in the cases when the TextInput serves as a password field. Also, this patch reserves the space for 30 characters for m_text when the TextInput is used for password input. This is enough to make sure no reallocation happens in majority of cases as barely anyone uses passwords longer than 30 characters. [ChangeLog][QtQuick][TextInput/security] When the TextInput is used for password input, preallocate a buffer for the string that stores the entered value and zero-out the string on TextInput destruction to avoid leaking sensitive data to process memory Change-Id: I8f1f307b1cfc25ad51f48bae8509a258042a2e7f Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | QQuickTableView: use QMap instead of a QRect to keep track of loaded columnsRichard Moe Gustavsen2019-01-302-83/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TableView keeps track of which rows and columns that are loaded at any point by using a QRect called "loadedTable". loadedTable basically describes the top-left and bottom-right corner of the table that has been loaded (which also is what ends up visible on screen). But now that we prepare for making it possible to hide rows and columns, using just a QRect becomes to simple. A rectangle will only tell what the edges of the table are, but not if any of the rows and columns in-between are hidden and therefore not loaded. So a QRect(0, 0, 10, 10) will give us the impression that we have 10 visible columns on screen, but in reality, we might have a lot less. This patch will change this to instead use two QMaps to record loaded rows and columns. This will make it much more easy to deal with hidden rows and columns in upcoming patches. We use a QMap instead of a QHash/QSet to keep the list of columns and rows sorted, since we frequently still need to know the edges of the table, like before. Change-Id: I45736485c67042403b095e73b5f2effa411281d0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-296-149/+185
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/masm/yarr/YarrJIT.cpp src/qml/compiler/qv4instr_moth.cpp src/quick/handlers/qquicksinglepointhandler_p.h src/quick/handlers/qquicktaphandler.cpp src/quick/items/context2d/qquickcontext2d.cpp Done-With: Ulf Hermann <ulf.hermann@qt.io> Change-Id: I109453131f9f0a05316ae37c7d6ed1edc8c0f9d4
| * Canvas: Guard context pointer against external deletionUlf Hermann2019-01-231-144/+166
| | | | | | | | | | | | | | | | | | You cannot keep the context when reparenting the canvas item. Use a QPointer prevent dangling. Task-number: QTBUG-73113 Change-Id: Ie7021c6f0bb0d09923eb358dc7e51d6727e74a7a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Add handlers declared as Flickable children to its contentItemShawn Rutledge2019-01-224-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickItemPrivate::data_append() was not invoked when any kind of Pointer Handler was directly declared in a Flickable (or subclass) because QQuickFlickable redefines the default property to be its own flickableData property. So we need to repeat the special handling in QQuickFlickablePrivate::data_append() too. The handler must be added to the private->extra->pointerHandlers vector, so that QQuickItemPrivate::handlePointerEvent() will attempt to deliver events to those handlers. TapHandler seems OK (especially with its default gesturePolicy so that it does not do an exclusive grab). PointHandler seems OK. DragHandler competes with Flickable for the exclusive grab. pressDelay can help; or set acceptedDevices: PointerDevice.Mouse to allow the mouse to drag but not flick, and the touchscreen to flick but not drag. Fixes: QTBUG-71918 Fixes: QTBUG-73035 Change-Id: Icb97ed5230abe0cb6ec0230b5b5759a0528df7e8 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * Merge "Merge remote-tracking branch 'origin/5.12.1' into 5.12" into ↵Liang Qi2019-01-221-1/+1
| |\ | | | | | | | | | refs/staging/5.12
| | * Merge 5.12 into 5.12.1Kari Oikarinen2019-01-083-5/+19
| | |\ | | | | | | | | | | | | Change-Id: Ic746fbce93430867e2eda4bc7155d34e20a4aa2b
| | * | Fix regression in border-top with high-dpiAllan Sandfeld Jensen2019-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device pixel ratio was included twice. Task-number: QTBUG-72603 Change-Id: Idd1b75c3b1926a6381bf258c1b705be10c5575b9 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-221-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/quick/qquickpathview/tst_qquickpathview.cpp Change-Id: Ic1f5e219a255d0613f7654368a5ce3eccb8f0ee9
| * | | Documentation: Start using the \nullptr macroFriedemann Kleint2019-01-211-3/+3
| | |/ | |/| | | | | | | | | | | | | Task-number: PYSIDE-903 Change-Id: I0c4640eb20157673eabb131e8834e79cbbf95d5c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Add itemAtIndex to quick viewsPaolo Angelelli2019-01-177-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds itemAtIndex method to ItemView-derived views and to PathView. [ChangeLog][QtQuick][QQuickItemView] Added itemAtIndex() to GridView, ListView and PathView to fetch a visible delegate by index. Change-Id: Id8475d06c1481036984fe5109bb52cf2729b1c21 Fixes: QTBUG-72961 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Privately export QQuickImageTextureProvider, QSGTextureMaterialShaderPaolo Angelelli2019-01-152-33/+35
| | | | | | | | | | | | | | | | | | | | | | | | Without this, it becomes very difficult to reimplement updatePaintNode when subclassing QQuickImage Change-Id: Ib5decca3584c89ea4ab793367b63ca70a4267c87 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Fix QFont-related deprecation warningsFriedemann Kleint2019-01-083-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace QFontMetrics::width() by horizontalAdvance(), fixing: items/qquicktextcontrol.cpp:1001:80: warning: ‘int QFontMetrics::width(QChar) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/qquicktextinput.cpp:880:60: warning: ‘int QFontMetrics::width(QChar) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/qquicktextinput.cpp:1380:60: warning: ‘int QFontMetrics::width(QChar) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/context2d/qquickcontext2d.cpp:2980:57: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/context2d/qquickcontext2d.cpp:4060:36: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] items/context2d/qquickcontext2d.cpp:4063:36: warning: ‘int QFontMetrics::width(const QString&, int) const’ is deprecated: Use QFont::horizontalAdvance [-Wdeprecated-declarations] Change-Id: Ie97be4a6cf1ce087caeb4d83fe016fa1a471f3ec Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-231-1/+12
|\| | | | | | | | | | | Change-Id: I9c3d282c11a556e616c5e1ba1b51e88b741327f6
| * | Doc: velocity properties must be set to -1 when setting durationMitch Curtis2018-12-131-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is an important detail that was left out, causing confusion when a user tries to set e.g. highlightMoveDuration without setting highlightMoveVelocity to -1. Change-Id: Ida4042626fcc20105267a5d2a0babcb91eed1516 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | | Fix Keys.onShortcutOverride for TextEditJan Arve Sæther2018-12-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was not possible to override a shortcut with Keys.onShortcutOverride for TextEdit. This was because the ShortcutOverride event sent to the TextEdit was not passed on to the default event() implementation (of the base class) in the case that the QQuickTextEdit did not handle the ShortcutOverride event. Fixes: QTBUG-68711 Change-Id: I981738d8f92c77eadb8dd98b4245290d430525d3 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-126-17/+35
|\| | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp Change-Id: Ic1dace832ad4b29023d24808b8617b5dcc915eb5
| * | Fix missing strike outDaniel Engelke2018-12-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added <s></s> and <del></del> tag aka strike out to QQuickStyledText. QQuickStyledText covers the essential text decorations, apart from strike out. In order to use it, one had to switch to RichText, which comes with its own overhead and limitations. <s> for no longer accurate or no longer relevant content <del> for removed content Fixes: QTBUG-72376 Change-Id: I3c191d91d57afcc48090facc49d643f8ad708fb4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | TapHandler: ignore scroll events and native gesturesShawn Rutledge2018-12-101-4/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | During a 2-finger press (to emulate right click on a trackpad), the OS may also generate a QWheelEvent with ScrollBegin phase just in case scrolling starts. This must not prematurely deactivate the TapHandler. Also if a gesture or wheel event begins as the very first event after an application starts, ensure that subsequent mouse events are not mis-delivered as wheel or gesture events. Fixes: QTBUG-71955 Change-Id: Ic12e116483ab9ad37c4ac3b1d10ccb62e1349e0a Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * Ensure that each Event Handler has an Item parent rather than assertingShawn Rutledge2018-12-071-1/+5
| | | | | | | | | | | | | | | | | | | | QQuickItemPrivate::data_append() was already getting called, but the assert (that the parent was already an Item) was failing in case a handler was declared inside a Window or a Dialog. Fixes: QTBUG-71317 Change-Id: Ia497182e3b4a9722eee97a375f9ee5d4151108e6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Add dynamically-created Event Handlers to the relevant handlers vectorShawn Rutledge2018-12-073-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If any kind of Pointer Handler is created dynamically in JS by calling Component.createObject(), QObject::setParent() is called rather than passing the parent to the constructor, so QQuickItemPrivate::data_append() did not take care of adding the handler to QQuickItemPrivate's extra->pointerHandlers vector. We need to use the auto-parent mechanism (just as we did with handling dynamic creation of nested Windows in 8cb02e23abbefc9d020707fc1a2d8b6eb4e103b6). Added QQuickItemPrivate::addPointerHandler() to put the prepend() and implied setAcceptedMouseButtons() in one place. Fixes: QTBUG-71427 Change-Id: I3be3dd033c1c89e6e5b5c3463e1a720bbe963281 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Declare the enum so it can be passed to the QML sideAndy Shaw2018-11-301-0/+1
| | | | | | | | | | | | | | | | | | In order for the enum value to be passed to the QML side then it needs to be registered so it can be picked up. This fixes the signals using QQuickEventPoint::GrabTransition, such as PointerHandler's grabChanged. Change-Id: I387930d50f03fee867b3d869618525d44173b538 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-302-5/+11
|\| | | | | | | Change-Id: Ie977b1998eba8c9aa8582a96132bf1aa0ec55ca4
| * Prevent overly drawn-out animation when snappingMichael Brasser2018-11-291-1/+5
| | | | | | | | | | | | | | | | Don't trigger (potentially seconds long) animation to to fix very small errors in offset. Change-Id: Ibdba16e4fb7a1aff7577a29ab594af8aba231d6d Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
| * QQuickTableView: connect directly to the model, and not to the QPointerRichard Moe Gustavsen2018-11-281-4/+6
| | | | | | | | | | | | | | | | Fixes building with gcc 4.8.4 Change-Id: I61810102bba20c21321112c63e7197bbe05ec27d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | QQuickCanvas: Return millisecond timestamp in requestAnimationFrame callbackKai Uwe Broulik2018-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This matches common web browser behavior and allows using JS drawing libraries that advance frames based on this timestamp to work as-is within a QtQuick scene. [ChangeLog][QtQuick][Canvas][Important Behavior Changes] The requestAnimationFrame callback now gets passed a millisecond timestamp instead of seconds. Task-number: QTBUG-68278 Change-Id: Ibaf6a5df2beeb52d3c921f8cd14d1c519288663b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-246-23/+50
|\| | | | | | | Change-Id: I57e4b762dcccf2f7f6e4b659f6fc8c40465d3322
| * Fix vertical alignment of images in a text documentLars Knoll2018-11-224-13/+20
| | | | | | | | | | | | | | | | | | | | | | The vertical alignment was not calculated correctly in all cases, this should fix it by retrieving the height and baseline for the current text line and doing the calculation correctly in all cases. Change-Id: I5bb650ede46dc03d51bf0f64b77dc4ca77d30fd2 Fixes: QTBUG-59310 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Igor Bugaev <freedbrt@gmail.com>
| * Fix updating of text nodes in QQuickTextEditLars Knoll2018-11-221-1/+12
| | | | | | | | | | | | | | | | | | | | | | The update algorithm wasn't working correctly if there were two disconnected dirty regions in the textNodeMap. This could happend by e.g. programatically removing text at the beginning and appending at the end. Change-Id: I3de2c8efedb03c004c4c304d130360cbdb4485b7 Fixes: QTBUG-68863 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * QQuickText: Signal content height/width changes also when resettingUlf Hermann2018-11-202-9/+18
| | | | | | | | | | | | | | | | | | If we change the content height or content width to the initial one, we still need to signal the change. Fixes: QTBUG-71684 Change-Id: Idf6e3f89423eab3d8f5310c164c5acc5108e0d8b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Render inline custom text objectsAllan Sandfeld Jensen2018-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In QTextDocumentLayout inline objects are skipped if they have a frame and the frame-style isn't inflow. That inverted should be to only render it if it doesn't have a frame or is the frame-style is inflow. Fixes: QTBUG-32525 Fixes: QTBUG-70748 Change-Id: I259281ea45c9ba7295c6b3e116a941314ada22e5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Register Window.transientParent, track user-code overridingShawn Rutledge2018-11-132-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QtQuick "magically" guesses the transient parent relationship from nesting of declarations, it calls QWindow::setTransientParent(), which has been public C++ API all along. Now there is a new transientParent property; the setter is QWindowPrivate::setTransientParent(), which sets a flag. If the flag tells us that user code (e.g. QML) has set the transientParent property, we assume the user is overriding the magic, and we can also allow user code to set the window visible immediately, rather than waiting for its transient parent to become visible. Task-number: QTBUG-67903 Task-number: QTBUG-52944 Change-Id: Ia4d303263d387931d2051b2a950694a48ad5e541 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-092-1/+3
|\| | | | | | | Change-Id: I2ed93c9d5fa8ec9b075112618a2535535591a0e8
| * Fix null pointer access in QQuickOpenGLShaderEffectMaterialCacheJüri Valdmann2018-11-072-1/+3
| | | | | | | | | | | | | | | | | | | | | | If a QQuickWindow is destroyed without ever being rendered, then there won't be any QOpenGLContext in QQuickOpenGLShaderEffectMaterial::cleanupMaterialCache. Same goes for QQuickWidgetRenderControl. Fixes: QTBUG-65236 Change-Id: I2742505d147bc8444b46688170d33fbb2844f2ac Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-063-23/+31
|\| | | | | | | Change-Id: I85be5e6ef173fa733d7febd3209164bb31762e0d
| * Doc: Remove wrong return typeJoni Poikelin2018-11-021-1/+1
| | | | | | | | | | Change-Id: Iebd325afcfc0e892f970d450b59e0249d1fcb83f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * QQWindow: cancel touch->mouse synthesis when touch is ungrabbedShawn Rutledge2018-10-302-22/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, each time a new touchpoint is pressed, we would purposely forget which touchpoint was acting as the mouse, as part of "starting over" with event delivery. Conceptually "starting over" ought to mean as freshly as possible; but in practice, if a user was using one finger to interact with some mouse-only Item, and then presses a second finger (whether intentionally or not), (s)he doesn't want the first interaction to immediately end. The multi-finger DragHandler must be able to take over the grab from the Item which already had the grab; but it uses a passive grab in the meantime to track the movement, and normally takes over the exclusive grab only when its preconditions are met: the point has to move past the drag threshold. So we can wait until then to reset the touchMouseId. The concrete use cases are: double-tapping a map is supposed to zoom in, even if there is a MouseArea on top. And, while dragging a Slider inside a Flickable, you should be able to start dragging the Flickable with a second finger. In the first case the issue was that the MouseArea could grab while handling the synth-event, thus setting touchMouseId; then touchMouseId was immediately reset again while handling the second touchpoint, so the second touchpoint would also be offered as a synth-mouse event to various items. But while fixing that, we have to avoid this issue in the Slider-in-Flickable case: when the first touch press is delivered, Flickable takes the exclusive grab temporarily; after moving the touchpoint, the Slider's DragHandler steals the exclusive grab. Then we try to deliver the second touchpoint press: at this time, we don't want touchMouseId to be set, because we want to be able to deliver synth-mouse events for the second point so that Flickable can grab that one. So it must be that when DragHandler steals the grab, we can reset touchMouseId, because the only reason it was set was that Flickable had the grab. This result is achieved by having QQuickItem::touchUngrabEvent() call a new QQuickWindowPrivate::cancelTouchMouseSynthesis() function. It was already a good idea to have such a function since we always reset touchMouseId and touchMouseDevice at the same time. Also modify the docs to remind users that when subclassing QQuickItem and overriding mouseUngrabEvent() or touchUngrabEvent() they should call the base class implementation, to avoid bypassing this new functionality. Fixes: QTBUG-70998 Change-Id: I02894971e9047d4fa7ac9d062d6714c9183a8058 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * Merge remote-tracking branch 'origin/5.11' into 5.12.0Liang Qi2018-10-302-0/+10
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/settings/qqmlsettings.cpp src/quick/items/qquickwindow.cpp tools/qmlplugindump/main.cpp Change-Id: I3e5dae4de25b2da961a572b3a4bd151181d211c9
* | \ Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-014-6/+19
|\ \ \ | | | | | | | | | | | | Change-Id: I7a2b9bdb69512b2d52050d829b1b65f4fcd9d99d
| * \ \ Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-292-0/+10
| |\ \ \ | | |/ / | |/| / | | |/ | | | | | | | | | | | | | | | Conflicts: src/imports/settings/qqmlsettings.cpp src/quick/items/qquickwindow.cpp tools/qmlplugindump/main.cpp Change-Id: I96fedbc773a110374baed79a0b7de92d65df0ed6
| | * Warn, don't crash during nested delivery of mouse or touch pressesShawn Rutledge2018-10-132-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If during delivery of a mouse press, user code calls qApp->sendEvent() with another mouse press, then when delivery of the nested event is finished, we call QQuickPointerMouseEvent::reset(nullptr). Then when delivery of the original mouse press resumes, crashes are possible because most of the code assumes that QQuickPointerEvent::m_event is not null during delivery. Change-Id: Id65b1f2f64351e40d03bcd4f4d16693d616729da Fixes: QTBUG-70898 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | Fix backward QML compatibility for Flickable.isAtBoundaryChanged()Alexander Akulich2018-10-251-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QML code that imports any previous QtQuick version (e.g. 2.11) and connects to any of the four 'at boundary' properties (atXEnd, atXBeginning, atYEnd and atYBeginning) change notifier (e.g. atXEndChanged) stop working because the new signals available only with new import, but the older import has no idea that it could connect to the older notifier (isAtBoundaryChanged). Remove revision number from the notifiers of the four 'at boundary' properties to mostly fix backward compatibility until a better solution is available. Fixes: QTBUG-71243 Change-Id: I9b4c944c62e0c6c83ceed765b7cd99519e9cd109 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| * | Fix QML compatibility for Text.contentWidth/Height changed handlersAlexander Akulich2018-10-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The properties used to have a single notifier that name is different from the properties names. QML Engine always connects a handler to signal, if it exists and only if there is no such signal then it lookup for a property notifier. In commit e92f76cf9ea91e87ec2e3e68234899fd9c12142f we introduced new signals that match the names of the two property changes handlers, but the signals are not available on older import. Remove revision number from the notifiers of Text.contentWidth/contentHeight to fix backward compatibility until a better solution (such as extra engine logic like "if a signal that matches the handler is not available then check if there is a way to connect to a property notifier that matches the handler" Fixes: QTBUG-71247 Change-Id: I11fb6230d85218ef437816c60c8147b953d47241 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QQuickTableView QQuickFlickable: make destructors explicitly overrideYulong Bai2018-10-313-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make destructors explicitly override and virtual. Make QQuickTableView's setModel/model virtual, so that can be overridden for derived classes. Change-Id: Ieabc9add74a4725653a84b39f7e4c00c18a89f1d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Add QQuickTest::qIsPolishScheduled()Mitch Curtis2018-10-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verifying that an item was polished is quite common in Qt's auto tests: - The Qt Quick auto tests have a util function for it in visualtestutil.h (line 103). - "git grep polishScheduled -- tests/auto | wc -l" says that there are 269 usages of polishScheduled in Qt Quick auto tests, almost all of which look like this: QTRY_COMPARE(QQuickItemPrivate::get(item)->polishScheduled, false); - QQuickTableView's auto tests have their own function: #define WAIT_UNTIL_POLISHED \ QVERIFY(tableViewPrivate->polishScheduled); \ QTRY_VERIFY(!tableViewPrivate->polishScheduled) - More recently, QQuickMenu started requiring it (see menuutil.h). QQuickItem::polish() and QQuickItem::updatePolish() are both public functions, so the notion of polishing in Qt Quick is not new or hidden. This means that any user applications that have custom items that make use of the polish() => updatePolish() system will benefit from having a reliable method of testing their behavior. In addition, anyone wanting to simulate interaction with items in e.g. QQuickMenu will need this API if they don't want to use unreliable qWait() calls. With this in mind, this and the follow-up patch aim to standardise/ simplify the various private API checks and utility functions, and provide public API for users so that they can benefit from more reliable tests. When used together, the code will look like this: QVERIFY(QQuickTest::qIsPolishScheduled(item)); QVERIFY(QQuickTest::qWaitForItemPolished(item)); The follow up patch adds auto tests. [ChangeLog][QtQuickTest][QQuickTest] Added qIsPolishScheduled() function to allow checking if updatePolish() has been called on an item since the last call to its polish() function. This is useful to verify that a polish has been scheduled. Task-number: QTBUG-71224 Change-Id: I856a40321945c0070e4679e11e4812e0d7adc1f9 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-206-26/+76
|\| | | | | | | | | | | Change-Id: I939b8ddc8b24e9c9853a72eb22da317023c7a2c4