aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
Commit message (Collapse)AuthorAgeFilesLines
* mouse synthesis: don't say the left button is pressed during a releaseShawn Rutledge2013-05-041-1/+1
| | | | | | | | | Follows the same reasoning as Iefe63cd753f9f8bb04278fd04a4d728e3deda25e in qtbase: buttons should have only the buttons which are still pressed. Change-Id: I894df43254eb1b1ce173fd7acc7190e9765beb48 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Made Canvas blur better match the one in HTML 5 Canvas.Samuel Rødal2013-05-032-34/+70
| | | | | | | | | | | | | | | | | | | | | Fixed blur being too faint by fixing the weight to correctly match the amount of pixels being sampled based on the blur radius, and by not multiplying and flooring to int inside the sampling loop which leads to excessive rounding down errors. The "half" value in the previous implementation was also wrong due to using integer division instead of floating point division, which caused the blur being slightly offset down and to the right. By not calling scanLine() and constScanline() repeatedly and by only applying the weight once in the single-weight case we can also gain a slight performance improvement. Also, make sure blur radii below 2 don't get floored to 0. Change-Id: Ibe15d0f51c919594b168923485c051d21f8d7822 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fixed wrong rendering offset / clipping with shadowBlur in Canvas.Samuel Rødal2013-05-031-74/+125
| | | | | | | | | | | | | | | | If the item being rendered didn't have a bounding rect starting in the origin the shadow path would be get an additional offset equal to the distance of the item from the origin. Also, the stroke's shadow did not take the pen width into account, causing clipping artifacts. Combine all the common shadow generating code into a single function, and avoid rendering into an intermediate image that is then blitted into a larger image. Task-number: QTBUG-30914 Change-Id: I16c7c15897ab8e2d46f37da835f75f97fe680863 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Canvas: Do not apply transform to text twiceFrederik Gladhorn2013-05-031-1/+0
| | | | | | | | | | The path already has the transform, no need to apply it a second time manually. Task-number: QTBUG-30501 Change-Id: Iedcb2e2f85a1f9eeac8e6264e00536c43bf16ddb Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Enable touch events on Mac for MultiPointTouchAreaMorten Johan Sørvig2013-05-032-0/+30
| | | | | | | | | | | | | | Enabling touch events on a window causes scroll event lag so we want to avoid avoid it as far as possible. Enable/disable on scene changes, similar to what we do for WA_AcceptTouchEvents for widgets. Task-number: QTBUG-28483 Change-Id: I2e5b5e2b093cccfc5253f7228f5ec0c588c60371 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Enable touch events on Mac for PinchAreaShawn Rutledge2013-05-032-0/+30
| | | | | | | | | | | | Enabling touch events on a window causes scroll event lag so we want to avoid avoid it as far as possible. Enable/disable on scene changes, similar to what we do with WA_AcceptTouchEvents for widgets, and in change I2e5b5e2b093cccfc5253f7228f5ec0c588c60371 for MultiPointTouchArea. Change-Id: I8cd8d172ffd93cfc4ec115917cc8662202f3b069 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Remove from hover list on destructionAlan Alpert2013-05-031-2/+1
| | | | | | | | | | | | | | When hoverEnabled is unset the item remains in a hovered state until the mouse leaves. In this circumstance, the item could be destroyed without cleaning up the reference in the hovered items list. To catch this and similar circumstances, the item is removed from the list when destroyed, regardless of hoverEnabled status. Task-number: QTBUG-30962 Change-Id: I982ab8c9e1077fecc885fd166d70bbbbbe8fc179 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Liang Qi <liang.qi@digia.com>
* Protect against null item at QQuickItemView::destroyingItemAlbert Astals Cid2013-04-301-2/+4
| | | | | Change-Id: I92317d8f5a6d6f60160139f7486ffa8ec5985656 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Added doc and test for active and requestActivate in QQuickWindowLiang Qi2013-04-301-0/+16
| | | | | | | | Autotest is included. Change-Id: I0f8614b502f1e51cab5612fee283c929e078108b Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Liang Qi <liang.qi@digia.com>
* Don't eat Back button in TextEditPaul Olav Tvete2013-04-302-0/+20
| | | | | | | | | | | | On Android, Key_Back is used to change to the previous state in-app, as well as to exit the application. QTextControl does not react to the back button, so it should not accept the event. Task-number: QTBUG-30752 Change-Id: I010d36c93f14384b96fb0b2f0015c57a2a3d2497 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* QQuickScreen.name can change at runtimeShawn Rutledge2013-04-302-1/+4
| | | | | | | | | It's generally a constant but the attached property doesn't always have its QScreen at startup, so in practice every property needs a notifier. (Followup to Id777caf6cef1df5bc01757605e3085151170760b ) Change-Id: Ia3a321f98dc49b7e75f6eceb8f16b153c73a3134 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* TextEdit: Better support of QTextTable and inline imagesPierre Rossi2013-04-303-39/+72
| | | | | | | | | | | | | | | | | | | | Fix some issues with incremental updates found while playing with the Quick Controls textedit demo. -Grouping text blocks into a single text node is fine as long as it doesn't cross the boundary of a child frame (e.g. a table), otherwise all that node logic collapses. -Text tables are hard to split in a sensible way, ensure we treat them as one text node for the sake of simplicity. -Inline images can cause several text nodes to have the same apparent start position. Beef up the rewinding logic in markDirtyNodesForRange. Change-Id: Ib4518bcd9303035fa00d9f4b16da7ca6c88e2313 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Add more geometry properties to the Screen attached propertyShawn Rutledge2013-04-292-3/+91
| | | | | | | | | desktopAvailableHeight is useful for positioning windows, and logicalPixelDensity is useful for ensuring that touch controls are a reasonable size even on very high-resolution displays. Change-Id: Id777caf6cef1df5bc01757605e3085151170760b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Fix hover after press eventFrederik Gladhorn2013-04-271-1/+2
| | | | | | | | | | | | | | | When a mouse press event was rejected, we would unconditionally cancel the hover and claim that the mouse is not contained any more. Instead check if the mouse left and only then cancel the hover state. Task-number: QTBUG-30783 Change-Id: I5fac6f3a1f2807ef03e07982c603492d40d2a249 Reviewed-by: Florian Boucault <florian@boucault.net> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* No longer apply pending changes when accessing ItemView propertiesAlan Alpert2013-04-265-7/+41
| | | | | | | | | | | | | Applying changes in the getters can lead to binding loops, and is currently inconsistently applied. Removing the applyPendingChanges calls from remaining getters, and adding a forceLayout() function for cases where the immediate-apply behavior is needed. Task-number: QTBUG-30555 Parts-of-patch-by: Albert Astals Cid Change-Id: I64632601e02f2a53060296ab7739577a749d916f Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au> Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
* Implement QQuickWindow::grabWindow() for isVisible=falseGunnar Sletta2013-04-261-1/+36
| | | | | | | Webkit uses this for testing. Change-Id: I4539e169a02592fb6c0062903917d4dd23a4303c Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Simplify setting of hoverFrederik Gladhorn2013-04-261-5/+1
| | | | | Change-Id: I620dad5a07749a25c97f5c17e8f7f552593cfd2d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fixed segmentation fault when setting shadowBlur in Canvas element.Samuel Rødal2013-04-261-1/+1
| | | | | | Task-number: QTBUG-30882 Change-Id: I6c941394527bac62c0d2792acf5cf223279babc7 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Re-implemented itemChange must always call QQuickItem::itemChangeShawn Rutledge2013-04-261-4/+14
| | | | | | | | | | Documentation for that fact, and the windowChanged signal. Fix existing QQuickItem subclasses which didn't call QQuickItem::itemChange. Examples should rather connect to the windowChanged() signal. Change-Id: Ieddcdbe69f849ddb120b64be9c5e0a21393b0ed9 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Implement a basic accessible text interfaceFrederik Gladhorn2013-04-262-0/+7
| | | | | Change-Id: Ic8a807f9de66d2d13da1193fe6e2abb7ccccb2a2 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Initialize lastPosAlbert Astals Cid2013-04-261-1/+1
| | | | | | | | | I was valgrinding a scene with a flickable and i come to see that in some ocassions we use lastPos before initializing it in QQuickFlickablePrivate::viewportAxisMoved Change-Id: Ibfeeefc00f62493163d5d44f676bec79a4c004c2 Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
* Mark the canvas texture dirty when we change it.Gunnar Sletta2013-04-261-0/+1
| | | | | | | | | Because the texture is the same instance and the rect is the same, the early-out checks in QSGSimpleTextureNode will abort. Task-number: QTBUG-30666 Change-Id: I0e6a1fd3d4de33436057e8cdf62dc0e7964b5c21 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Disable native glyph rendering on embeddedGunnar Sletta2013-04-253-3/+6
| | | | | Change-Id: I71769affe8f0138dd65f3b94fb27176bd069ab8d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Doc: Replace some references to NokiaSze Howe Koh2013-04-241-2/+2
| | | | | | | Link to internal QDoc pages, or to qt-project.org Change-Id: I5d9adae711213873ab57ccfc5bb2d8f74cf5689b Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Create links to Qt Quick 1Sze Howe Koh2013-04-242-5/+5
| | | | | | | | | | | Point to the porting guide, so that users who search for the old names will be directed to an explanation of the name change. Also made some new links to Qt Quick 2, and changed "favour" -> "favor" (Sanity Bot complained) Change-Id: If30c8d619d8fdb9df72b7b5f3efd356f1e07b23a Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QQuickTextEdit: make the update logic work with multiple text framesPierre Rossi2013-04-241-2/+5
| | | | | | | | | | | | | We can't assume that the text nodes are added in order since we're iterating over all the blocks of a text frame before processing its child text frames. The only way for all this not to collapse is to sort the text nodes once we're done each time we're replacing/adding new ones. Task-number: QTBUG-30349 Change-Id: Ia5d804f7f196b2348fd68fdd62a6585c189baaa4 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Doc: Fix module name formatSze Howe Koh2013-04-232-2/+2
| | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation Qt3D -> Qt 3D QtLocation -> Qt Location QtScript -> Qt Script Change-Id: Id59cb209e0e0407d564de0bfaab73990e64a02e6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Qt Quick: Fix module name format (Pt 2/2)Sze Howe Koh2013-04-231-1/+1
| | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation Attempt to differentiate between the whole module ("Qt Quick") and the QML import ("QtQuick") by encoding the latter with monospace font. There are places in the text where both representations are valid. Change-Id: If398304757e0a5106542c09099e1814084e54c5c Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Qt Quick: Fix module name format (Pt 1/2)Sze Howe Koh2013-04-236-18/+18
| | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation Attempt to differentiate between the whole module ("Qt Quick") and the QML import ("QtQuick") by encoding the latter with monospace font. There are places in the text where both representations are valid. Change-Id: Id6e157a4191aaa4e23a9cd5c76abfe902fe43d33 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Use the platform theme's password mask character for text input fields.Mitch Curtis2013-04-232-4/+6
| | | | | | | | Task-number: QTBUG-29871 Change-Id: I3b15dfab5ca6455df465c502c93aac7b85a64531 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Expose nextItemInFocusChain in QQuickItemLiang Qi2013-04-233-6/+37
| | | | | | | | | Convenient for other use cases related with tab focus chain. Autotest is included. Change-Id: I1ba6317e20edacc2b672bc5b78e3fcd29ac80bdc Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* TextInput: Fix cursor navigation with maskFrederik Gladhorn2013-04-231-1/+1
| | | | | | | | | | | | | | text().length() was used to check if a cursor movement to the right was valid. The problem is that with a mask and not text set yet (inputMask: "#0:00;*") pressing the right arrow would not move the cursor. The input and other functions use the actual d->m_text since that includes the mask length. Task-number: QTBUG-30740 Change-Id: Ic225778e5a49d80b754b63d0eb4a438eaa9818e2 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fixed crash in QQuickCanvasItem.Samuel Rødal2013-04-231-15/+14
| | | | | | | | | | | The d->contextInitialized variable is useless as it gets out of sync with d->context when the latter is set to 0. Simply checking that d->context is non-null fixes some crashes. Task-number: QTBUG-30810 Change-Id: I474a807a402396b170ba45ae7546781eea92b481 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix lupdate-warning "Cannot invoke tr() like this".Friedemann Kleint2013-04-233-3/+3
| | | | | Change-Id: I3ded3d9ab9fa202a3133c53fd6e17a8354481d0c Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Fix crash in repeater when model gets deletedFrederik Gladhorn2013-04-182-3/+3
| | | | | | | Task-number: QTBUG-200461 Change-Id: Ia8e48668960ac005cf773bf6f53da40f1c753b9b Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* docs: Remove warning that is no longer applicable.Frederik Gladhorn2013-04-181-2/+0
| | | | | Change-Id: I1d7359b48ab4bb6001171901ab55d4c5030fb1f9 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Silence a warning for unused variable in QQuickTextNode.Pierre Rossi2013-04-172-5/+5
| | | | | | | | | | | While refactoring it seems the position was forgotten. As it is exposed in addTextLayout, we should try to pass it along when initializing the selection engine. Task-number: QTBUG-30338 Change-Id: Id8d9221efe0027315ba1d48c47c9ea2ecd8d7561 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Remove dead code.Gunnar Sletta2013-04-172-35/+2
| | | | | | | | | | | | | | | The renderWithoutShowing was a piece of functionality that we experimented on long ago and it never quite worked and has it currently only adds bloat. It would be sensible to be able to render a window without showing it on screen, such as for testing purposes, but then it should be done through proper public API and thouroughly supported cross platform. Change-Id: I6bea7335f769c038a8167bad77c2dba171359be9 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix for Positioner attached propertyFilip Piechocki2013-04-161-13/+31
| | | | | | | | | | | Modified Positioner attached properties update - original code was trying to update visible and not visible items by looking only at the positionedItems array, which was wrong as that array contains only visible items. Hidden ones are stored in unpositionedItems array so second loop was added to affect these items also. Task-number: QTBUG-30477 Change-Id: If03abb76f4da708884a7e2cf6ade83c09eca45bf Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* fix typo in warningGunnar Sletta2013-04-161-1/+1
| | | | | Change-Id: I5f70ad30b9b1ba6551c9c8c76b87c2f3f2ea8aa9 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* TextInput: Fix cursor heightGabriel de Dietrich2013-04-161-4/+10
| | | | | | | | | | | On many platforms, the current cursor looks too tall. The logic used in this patch is inspired by what we have in QTextLayout::drawCursor(). It still looks too tall on Mac, but so it does in Qt Widgets. QQuickTextInput::positionToRectangle() has also been updated for consistency. Change-Id: I69b8ad246238d54db370db639a319a3edba6d78a Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Don't relayout if item is removed from sceneAlan Alpert2013-04-151-1/+2
| | | | | | Task-number: QTBUG-28160 Change-Id: I208f213e2de6b530dd0965b301d046aee0182d9a Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* a nested Window automatically becomes transient for its parentShawn Rutledge2013-04-105-5/+115
| | | | | | | | | | | | | | | | If you declare Window { Window {}} or Window { Item { Window {}}} the inner window will automatically become transient for the outer one. The transient relationship must be set before the inner window becomes visible though, so declaring visible: true doesn't always work, depending on initialization order. It's OK if you assign visible (or call show()) later on when the user needs to see the transient window for the first time. Also added documentation. Change-Id: I888c3b9da6d44d11516227c085bcc12a5ccb5e81 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Fix new warnings in qtdeclarative (found by GCC 4.8)Thiago Macieira2013-04-091-0/+1
| | | | | | | | | qqmlproperty.cpp:1561:35: warning: typedef ‘VMEMO’ locally defined but not used [-Wunused-local-typedefs] qquickglobal.cpp:1017:13: warning: ‘initialized’ defined but not used [-Wunused-variable] qquicktextnode.cpp:245:6: warning: unused parameter ‘position’ [-Wunused-parameter] Change-Id: I48c5486953278dc960249f68e0e122d108f56e07 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Version new property and signalLiang Qi2013-04-082-2/+3
| | | | | | | | activeFocusOnTab and activeFocusOnTabChanged in QQuickItem. Task-number: QTBUG-30446 Change-Id: I973df95d690b8e533b5cc108d8e083a2fed8528a Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Remove resize hook from QSGRenderLoop, exposureChanged is enough.Gunnar Sletta2013-04-041-2/+0
| | | | | | | | | After much back and forth, I think we have settled on the right approach in QtGui, which is that resizeEvent is pretty much useless as the action happens on the following exposeEvent(). Change-Id: I5e87bda89853907d041f56acf9a2895e540c41f0 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* QQuickTextEdit: render inline images after change 48798Pierre Rossi2013-04-041-1/+14
| | | | | | | | | | | The refactoring in QQuickTextEdit from this change: https://codereview.qt-project.org/#change,48798 accidentally broke rendering of inline images. Revive the ProtectedLayoutAccessor trick to get the proper format and properly extract the image from it. Change-Id: I445914efcea1012daa79d594aa1e828b1039b988 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Version new signalsAlan Alpert2013-04-021-2/+2
| | | | | | | | | | | New signals added as a workaround need to be versioned as new. However, because they're used just to override the property's signals and are forwarded to the old signal you can still use the old signal names from QML. Consequently, this revision shouldn't need to be exposed to QML. Change-Id: I80407852f0a5063866c5f4334cfd0285f00d5578 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Use distance fields for text on retina displaysGunnar Sletta2013-04-023-4/+10
| | | | | Change-Id: I6d3f3e7e4813155f2abb3edc51b145fb709c485b Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fix distance field antialiasing for retina displays.Gunnar Sletta2013-04-023-3/+11
| | | | | | Change-Id: I01d7d41a4e70822555bae453978dbe92fbb5c98d Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>