aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items
Commit message (Collapse)AuthorAgeFilesLines
* Add a length property to TextEdit.Andrew den Exter2011-11-292-0/+22
| | | | | | | | | | This returns the length of the unformatted text in a TextEdit which should be cheaper to query than the length of the text property and meaningful in the context of the selection and cursor properties. Task-number: QTBUG-18949 Change-Id: Ia25c4553693923f97d299f1fdb8bfcf7f5937b13 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Initial window implementationAlan Alpert2011-11-296-4/+172
| | | | | | | | | Includes adding a color property on QQuickCanvas. Note that most Window related properties come from the QWindow inheritance. Task-number: QTBUG-19799 Change-Id: I00f6c90a1e2a5c85d787793d6edac2cd7d5309ab Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Add a getFormattedText function to TextEdit.Andrew den Exter2011-11-282-0/+31
| | | | | | | | The same as getText except it include formatting tags if the TextEdit has a rich text format set. Change-Id: I601e8d396254ab6105aa7d105e25b14fcf69c4e5 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix multiline eliding and support eliding when height is set.Martin Jones2011-11-282-89/+100
| | | | | | | Task-number: QTBUG-22920, QTBUG-22116 Change-Id: Ibe78ce1b0b438eec32955b986a8740f173cd082f Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Removed ShaderEffectItem and qt_ModelViewProjectionMatrix.Kim Motoyoshi Kalland2011-11-284-26/+0
| | | | | | | | | | ShaderEffectItem was replaced by ShaderEffect, and qt_ModelViewProjectionMatrix with qt_Matrix a while ago. The old names were kept working for a transition period, but it's now time to remove them completely. Change-Id: Ife030d2122250784fe2ec80b1f8645301b0165d0 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix crash calling VisualDataGroup.setGroups during initialization.Andrew den Exter2011-11-251-1/+2
| | | | | | | | A VisualDataModel's meta type is constructed in componentComplete(), avoid accessing it before then. Change-Id: Ic9fdfa3c458d5da3014289b777f74df87aa97103 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove ints from mouse event handling.Martin Jones2011-11-252-12/+12
| | | | | Change-Id: Icda13ae3644dc274e08e626545df75d3e561cf87 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Add getText(), insert(), and remove() functions to TextEdit.Andrew den Exter2011-11-252-0/+64
| | | | | | | | | | The getText() function provides access to the plain text content of a TextEdit, and the insert() and remove() functions allow the text content to be edited inline instead of having to assign an edited string to the text property to make any change. Change-Id: Id4edf0312358e2d2db45e4c649b7bd3d22f02ffa Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Improve performance on touch event delivery.Martin Jones2011-11-242-7/+47
| | | | | | | | | | | | We continuously constructed and sorted the paint ordered items for every touch event (and paint), even though the list in most cases is identical to the childItems list, and when it is different it rarely changes. Detect when we can just use the childItems list directly, and otherwise cache the ordered items list. Change-Id: I5db0f19fc021d0c95aa6f8372ae47e6ce138d5ad Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Propegate the smooth property to the textureproviderGunnar Sletta2011-11-241-0/+1
| | | | | | | Task-number: QTBUG-22880 Change-Id: I693a44e87fb87bc92e1647f6158d23986f98623a Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* QQuickTextInput - Remove nonexisting method from headerPekka Vuorela2011-11-241-1/+0
| | | | | | Change-Id: I48aa6efec784ea3ae937636083f6ce211521bfc6 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* TextInput elements not to have tentative commit in inputMethodQueryPekka Vuorela2011-11-241-1/+1
| | | | | | | | Tentative commit should not be part of surrounding text, it's already a property of the input method. Change-Id: I64aec9763fb20770b6729f7f59dcbe23cf5a6718 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fixed assert during QQuickCanvas::hideEvent().Kim Motoyoshi Kalland2011-11-242-18/+3
| | | | | | | | Also fixed a memory leak in the non-threaded renderer so that it is on par with the threaded one. Change-Id: Ie3111730a9d10085c83f7aafceda240419b722cd Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Get rid of unused inputMethodQuery and inputMethodEvent functions in ↵Joona Petrell2011-11-242-41/+0
| | | | | | | | | | | | QQuickCanvas * in Qt5 input method events and queries are meant to be sent directly to QInputPanel::inputItem() instead of the focused QWindow * protected inputMethodEvent was actually never called by QWindow::event() like it called other specialized event functions Change-Id: I68cced106808098c320841d6a17a0cc170a8369f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* v4: Get rid of dependency on QQuickAnchorLine typeKent Hansen2011-11-231-0/+9
| | | | | | | | | | | | | Delegate the meta-type id query and value comparison to QDeclarativeMetaType. Register a comparison function for QQuickAnchorLine in QQuickItemsModule, so that not even QDeclarativeMetaType needs to know the type declaration. (This is needed in order to be able to move the items to a separate library.) Change-Id: I6404d01b74143946ae0a79fa18d1777b675e4194 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix PathView insertion/removal/move item offsetMartin Jones2011-11-231-23/+20
| | | | | | | | | | Fix item positioning post model changes and add auto tests. Also fixes crash when inserting items before currentIndex, causing offset to increase beyond item count. Task-number: TBUG-22785 Change-Id: I17000ba497a190554c8b137a72b7e6551e8a0e56 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix inserting before the visible area into cache bufferBea Lam2011-11-222-4/+8
| | | | | | | | | | Items being inserted after the visible index must be created, even if they aren't in view (e.g. are in the cache buffer) otherwise they will not appear at the correct index in the visibleItems list. Task-number: QTBUG-22772 Change-Id: I235dc766a6abf4988872bb70aa40cdc767df8c96 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Move path with highlightMoveDuration: 0Martin Jones2011-11-221-1/+3
| | | | | | | Task-number: QTBUG-22786 Change-Id: I10043bfa5d8c622fc4e7a25bcb1f96ef43d23890 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Adding custom easing curves to property animationsAaron Kennedy2011-11-211-1/+2
| | | | | | | | QDeclarativeEasingValueType gets the property customBezierCurve. This allows to define a custom easing curve as a cubic bezier curve. Change-Id: I33ae128ce29bba2834eedcbb90a9769a5391f997 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix compile.Friedemann Kleint2011-11-211-0/+1
| | | | | | | | | Fix breakage introduced by qtbase:dc0b588162951b3412e835d931637d74cb4e98b5, missing forward declaration of QInputMethodEvent. Change-Id: I0b659c97b15b651effb589611641e97156e385d3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Silence compiler warnings about unused variables (MSVC)Kai Koehne2011-11-212-3/+5
| | | | | | | Fixes most 'C4189: local variable is initialized but not referenced' warnings Change-Id: I8c5a1ba0a50dd3fcb22294e564425846362ee911 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Doc: Canvas doc review.Martin Jones2011-11-211-89/+75
| | | | | Change-Id: I6edf44c1db47ca58c426464f8e4c852bf71176f6 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* Don't leak objects when a VisualDataModel is destroyed before a view.Andrew den Exter2011-11-211-0/+2
| | | | | | | | | | If an item is still referenced by a view when the VisualDataModel is destroyed delete it, otherwise it will leak as the view have no interface to release it and deleting the item won't delete the package. Task-number: QTBUG-22672 Change-Id: I7b89962d724d7a391c97722638e03b7a186b8a8f Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Fix Qt Declarative namespace compilation.Toby Tomkins2011-11-211-0/+2
| | | | | Change-Id: Ib3294278985cd43e40610dacd7b69bf98ff4d788 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* GridView sometimes lays out one less column than expectedMartin Jones2011-11-211-33/+39
| | | | | | | | | | If the cellWidth/cellHeight was not a whole number the wrapping was unreliable. Calulate column positions more robustly, i.e. avoid comparing values subject to rounding errors. Task-number: QTBUG-21846 Change-Id: Ic3a90b36d542ce8af49461bd524e4405c74aece5 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Copy QSGEngine functions to QQuickCanvas.Gunnar Sletta2011-11-183-1/+207
| | | | | | | | | | | | Long term we intend to remove the QSGEngine class all together so this is the first step. It duplicates some of the logic but doesn't break anything. Also including an example on how to use it in examples/declarative/openglunderqml Change-Id: I69ed93ec5fa1b5c4c746169306d38f8d6ce80477 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Parent delegate items to PathView.Andrew den Exter2011-11-181-0/+2
| | | | | | | | | This is consistent with ListView and GridView and ensures the items live only as long as the view and are deleted on application shutdown where deferred delete events are discarded. Change-Id: I77174b2725310d068fbba89b57e0da59619ef22a Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fixed QQuickShaderEffect::lookThroughShaderCode(), added autotest.Kim Motoyoshi Kalland2011-11-172-12/+18
| | | | | Change-Id: I1e4a1589e1482c21eedab4cd052c16b6653344fb Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Add debug description to shader effectsGunnar Sletta2011-11-171-0/+4
| | | | | Change-Id: Icb6d45003f534c6e2d8d2382b408de0e368df29c Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Optimization for context2d paintingCharles Yin2011-11-173-13/+12
| | | | | | | Avoid pass painting state by value. Change-Id: I86529ee7357b6cadbaa941b296d7ad025977f2aa Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Use QQuickChangeListener for better performanceGunnar Sletta2011-11-162-9/+22
| | | | | Change-Id: Ia959cf905fd0a03f7f69b6b65b2eeed8e4a62153 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Change destruction order to avoid accessing deleted GL resourcesKent Hansen2011-11-161-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes a crash when a QQuickCanvas containing a Text item is destroyed. 202127f860208c21145e05685bc54219e1655dbd in qtbase fixed a resource leak with QOpenGLMultiGroupSharedResource; resources were not cleaned up correctly when the associated GL context (group) was destroyed. This exposed a bug where QSGDefaultDistanceFieldGlyphCache (used for Text items) relied on that leakage. In particular, the glyph cache stores a pointer to a GL resource that it doesn't own (m_textureData). If the GL context is deleted and there are no other contexts in the group, the group and its resources will be deleted. Subsequently, if the glyph cache accesses the resource pointer when the Text node is destroyed (via QSGDefaultDistanceFieldGlyphCache::releaseGlyphs()), we crash. The GL context is deleted when QQuickCanvasPlainRenderLoop is destroyed. By moving the deletion of the render loop object to the end of QQuickCanvas destructor, the canvas nodes get a chance to clean up the resources they use _before_ the resources are deleted. Task-number: QTBUG-22754 Change-Id: Ie8de19a139b4631a16203e63e731feed3d8d64cf Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Improved comments on threaded renderer a bitGunnar Sletta2011-11-161-3/+3
| | | | | Change-Id: I1ee3879bde219e0008d70117dbfdd14f7da31f18 Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Fix for moving multiple items to top of viewBea Lam2011-11-161-7/+11
| | | | | | | | | | Top item wasn't positioned correctly when moving multiple items backwards to the top of the view. Don't move visibleItems.first() if we've already repositioned the top item correctly. Task-number: QTBUG-22762 Change-Id: Ib216adea719044ee55349478237473ff3194a326 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Avoid calling maybeUpdate() during ShaderEffectSource cleanup.Kim Motoyoshi Kalland2011-11-161-0/+2
| | | | | | | | | markDirtyTexture() causes sceneGraphChanged() to be emitted from the renderer containing the ShaderEffectSource, which in turn causes QQuickCanvasRenderThread::maybeUpdate() to be called. Change-Id: I3c068e41501ed4cb2c5f4ff705ffd478743b4beb Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fixed deferred deletion of objects in the render thread loop.Kim Motoyoshi Kalland2011-11-161-1/+3
| | | | | | | processEvents() does not process DeferredDelete events. Change-Id: Iee8491b7c63a26af8e36f777d872115ab1b64763 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix refill where zero-size items are involvedBea Lam2011-11-161-8/+24
| | | | | | | | | | | | | 881091b5c0f1d2ead2b70e54f7ac2e4c17680b4e was incorrect since it meant that any items following zero-sized delegates would not be deleted as they scrolled up past the top of the view. refill() should be deleting these items as well as any zero-sized items before them. Task-number: QTBUG-22014 Change-Id: I10cd30bb85a8ec1ddaa2a1cbaa924192536ef6fc Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove unused code in qquickimplicitsizeitem.Martin Jones2011-11-163-68/+0
| | | | | Change-Id: I47ad98e0c515ddc5a9ac224048cdf396cce22699 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Add propagateComposedEvents property to MouseAreaAlan Alpert2011-11-153-6/+49
| | | | | | | | | While necessary, advanced event propagation isn't the common use case. Now needs to be explicitly enabled. Task-number: QTBUG-21081 Change-Id: Ibd8b4974934116dbfa32cc5e72037fd9b11015b4 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Make shader effects visible even if source is initially emptyGunnar Sletta2011-11-141-1/+6
| | | | | | | Task-number: QTBUG-21343 Change-Id: Iaa34d74d2458f0a9dc94c96ee13d3406e1d8f1cb Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
* Removed annoying warning about threadingGunnar Sletta2011-11-141-7/+0
| | | | | | | Task-number: QTBUG-21707 Change-Id: I7ea7c53f39e2474093d628b5a75a435353b87b87 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fixed assert during QML shutdownGunnar Sletta2011-11-141-0/+6
| | | | | Change-Id: I680af9ccb417d3162277b5740a129ecd77feee7f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Distance field glyph cache refactoring.Yoann Lopes2011-11-144-4/+0
| | | | | | | | | | | | | | | The distance field glyph cache is now an abstract class part of the adaptation layer. It can be implemented to define the way the glyphs are stored in graphics memory on a specific platform. The typical use case is for having a cross-process glyph cache. To implement a custom glyph cache, one has to override three pure virtual functions: requestGlyphs(), storeGlyphs() and releaseGlyphs(). The default implementation works the same way as before the refactoring (no cross-process cache). Change-Id: I6e231a119abbffbe36f5f0d690f0b8be0664ff4f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Improved QQuickShaderEffect::lookThroughShaderCode() performance.Kim Motoyoshi Kalland2011-11-141-28/+149
| | | | | | | | | Removed use of regexp. Skip comments and compiler directives in the shader code. Don't look through default shader code. Task-number: QTBUG-22423 Change-Id: Ie08cd8288ba7d7a33f1e3b0dc2ab5f2bedad04dd Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Fix memory leaks&uninitialized members in QQuickContext2D&QQuickContext2DTextureCharles Yin2011-11-143-0/+26
| | | | | | | | | | | 1) Delete m_buffer in QQuickContext2D::~QQuickContext2D 2) Add a default ctor for QQuickContext2D::State, although the reset() method is always called, but the valgrind still complains the "uninitialized" error, so add this to make an explicit initialization. 3) m_item in QQuickContext2DTexture is also not initialized. Change-Id: Ie6c74136342d7f0ff8dc268d5d6b976c95ff52f1 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Text.onLineLaidOut doc does not appearYann Bodson2011-11-141-27/+27
| | | | | | | | Task-number: QTBUG-22706 Change-Id: I2b8b7d4012e48ff4226f060a5ce38d2acdab0deb Reviewed-by: Yann Bodson <yann.bodson@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Don't clobber unified timer settingsAlan Alpert2011-11-141-1/+3
| | | | | Change-Id: Iee43b566180471e08d655a4d2af72e9586227532 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* GridView should re-layout if add/remove before visible indexBea Lam2011-11-113-8/+20
| | | | | | | | | | Unlike ListView, GridView must redo its layout if an item is added or removed from before the visible items, since it affects the column/row layout. Task-number: QTBUG-21588 Change-Id: Id333bc653033751c45d127973e94fae4580c55b0 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* PathView element's current item changes on insertion.Martin Jones2011-11-101-5/+18
| | | | | | | | | When inserting an item before the current item update the offset to ensure the current item doesn't change. Task-number: QTBUG-21320 Change-Id: I2375bc5098e7f83c33e7a0b123ed1b82f607055f Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Delete nodes in the render thread at shutdownAaron Kennedy2011-11-092-0/+33
| | | | | | | This fixes a crash on OS X and possibly other platforms. Change-Id: Ie8fc451b526d12d46133ef560c04e88c0b142b9a Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>