aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items
Commit message (Collapse)AuthorAgeFilesLines
* Say hello to QtQuick moduleKent Hansen2011-12-02138-67506/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change moves the QtQuick 2 types and C++ API (including SceneGraph) to a new module (AKA library), QtQuick. 99% of this change is moving files from src/declarative to src/quick, and from tests/auto/declarative to tests/auto/qtquick2. The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to a plugin, src/imports/qtquick2, just like it's done for QtQuick 1. All tools, examples, and tests that use QtQuick C++ API have gotten "QT += quick" or "QT += quick-private" added to their .pro file. A few additional internal QtDeclarative classes had to be exported (via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the QtQuick 2 implementation. The old header locations (e.g. QtDeclarative/qquickitem.h) will still be supported for some time, but will produce compile-time warnings. (To avoid the QtQuick implementation using the compatibility headers (since QtDeclarative's includepath comes first), a few include statements were modified, e.g. from "#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".) There's a change in qtbase that automatically adds QtQuick to the module list if QtDeclarative is used. Together with the compatibility headers, this should help reduce the migration pain for existing projects. In theory, simply getting an existing QtDeclarative-based project to compile and link shouldn't require any changes for now -- but porting to the new scheme is of course recommended, and will eventually become mandatory. Task-number: QTBUG-22889 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
* Remove QSGContext and QSGTexture from QDeclarativePixmapDataGunnar Sletta2011-12-0212-18/+18
| | | | | | | | | | | | | | | | | | | | | | | In order to cleanly support multiple windows we need to not have the QSGContext reference in QDeclarativeEngine and we need to be able to have one copy of the texture for each QSGContext that is not sharing when we have multiple windows. This also makes it easier to the release graphical resources from a running application, which is another feature that we want to eventually implement. This patch does remove an adaptation feature which is the decodeToTexture, which seemed like a good idea at the time but in hindsight has not been used for anything. Edit: resolved conflict in qquickimage.cpp Edit: updated QDeclarativePixmap testcase Edit: updated QQuickImage testcase Edit: Rebased on top of QDeclarativePixmapCacheChanges Change-Id: Ifc61dd8158d3f841437d029b6031a91196145517 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix pixmap leak in Text with embedded images.Martin Jones2011-12-021-1/+1
| | | | | | | Insert into hash with same key we use to lookup :-/ Change-Id: I1d70916fab578c8280a11b3a03fb7cfd6ad4d594 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Export QQuickFlickable to make it possible to use it as private API.Andras Becsi2011-12-011-1/+1
| | | | | | | | Make it possible for the QtWebKit WebView to use Flickable as a base class by depending on QtDeclarative private API for now. Change-Id: Ia7b8a4aa1c59b9a089b4beecb0d9af5cf8883f07 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Don't use deprecated methodAaron Kennedy2011-12-011-1/+2
| | | | | Change-Id: I480dc4de58ce54bec353d33cddd73b817c588304 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Made TextInput mouse events commit preeditPekka Vuorela2011-12-011-13/+29
| | | | | | | | | Similar to what was earlier done on QWidgets editors. Additionally updated tests to check QInputPanel::invokeAction instead of the obsolete QInputContext mouse handler. Change-Id: Ia2bd22eebdeed79cff7a4925129b28dd1500b1ad Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
* Fixed crash when updating Image.source and BorderImage.sourceGunnar Sletta2011-12-012-3/+5
| | | | | | | | We need to update the texture pointer in the scene graph node when the imagedata has changed. Change-Id: I0246626d3ebb66db9c5cf85fb1c2034ed233984f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Allow current item creation to interrupt async delegate creation.Martin Jones2011-12-011-1/+1
| | | | | | | Fixes unstable test tst_QQuickGridView::insertBeforeVisible(). Change-Id: Iebf02d3c4c202b300409be567906c64c02917dda Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Repeater delegates have no parent in Component.onCompletedMartin Jones2011-12-012-1/+10
| | | | | | | Task-number: QTBUG-22279 Change-Id: I5c0b4a9becfee06dfc4a52e546ad81fb0b6f238a Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Ensure flickable velocity is updated when under heavy load.Martin Jones2011-12-011-2/+8
| | | | | | | | | | | If the Flickable is forced to move very quickly due to highlight motion the smoothed velocity animation may not have an opportunity to run before being reset, resulting in the velocity not being updated. In this case just set the velocity directly since the motion is driven by an animation anyway. Change-Id: I1e5e9396f4c1cd12e95c6ac47941dad25e4aa897 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Don't update dependent anchors on destruction unless required.Michael Brasser2011-12-011-2/+5
| | | | | Change-Id: Ic088e800d5bbad0a819824a21b4c0bf430126786 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Cleanup and optimize QQuickContents.Michael Brasser2011-12-012-37/+41
| | | | | Change-Id: I12e51b431a7568bc80d8200d1c619373a72521c0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Non-blocking view delegate instantiation.Martin Jones2011-12-0116-403/+675
| | | | | | | Task-number: QTBUG-21792 Change-Id: I29a4028cd24eb55d4768aacaa3abbd1786061398 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Add QQuickItem::setImplicitSize()Michael Brasser2011-11-3010-43/+74
| | | | | | | | This allows us to batch up size changes better, leading to fewer layout recalculations. Change-Id: I423113fab78666a99ca05439f852f57c92f6f821 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Anchoring system optimizations.Michael Brasser2011-11-304-33/+157
| | | | | | | | | | Do a better job of only updating anchors when needed. For example, if an item is anchored to its parent, it shouldn't react when the parent moves, only when it resizes. Change-Id: I57b480631fc6e89ab214b3fd337478d2e6534044 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* 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>