aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
Commit message (Collapse)AuthorAgeFilesLines
* Add missing Q_REVISIONAlan Alpert2013-06-231-1/+1
| | | | | | | This invokable method is new in Qt 5.1/QtQuick 2.1 Change-Id: I7d0e332b52a815ac0722e39db68ef1f190534a57 Reviewed-by: Liang Qi <liang.qi@digia.com>
* Fix compiler warning about unused parameterKai Koehne2013-06-101-1/+1
| | | | | | | | | | | Fix gcc compiler warning about unused parameter: qquickwindow.cpp:111:10: warning: unused parameter ‘e’ [-Wunused-parameter] This got introduced by commit 9d75626b Change-Id: Ia280fd9fdd584eed81f4d810311c56f5daee3e28 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Set incubation controller when a Window{} is loaded via QQmlApplicationEngineAlan Alpert2013-06-073-17/+47
| | | | | | | | | | | | | | | | | | | | | | | | This was the one convenience that was lost when transitioning templates from QQuickView + Item{} to QQmlApplicationEngine + Window{}. As the default window incubation controller was tied to the first window's frameSwapped, we could easily run into a situation where a secondary window required incubation while the first window was idle. This would then starve the incubation controller. Instead make it so that the renderloop emits "timeToIncubate" once it is done with a renderpass over all windows, so the incubator gets to run once and exactly once per vsync when animating. The incubator logic was also flawed in that it could post a lot of events to itself as a result of incubatingObjectCountChanged and thus starve system events while processing incubation requests. Now we start a timer and don't start it again until we have completed an incubation pass. Task-number: QTBUG-31203 Change-Id: Iea9e2c81efb46bb7875c70ccda0cdc4b3b3e58e7 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* doc fixAlan Alpert2013-06-061-1/+1
| | | | | | Task-number: QTBUG-31539 Change-Id: I527ed10231c112f8f1727fde093f7d661d492fa6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Added QQuickWindow::setDefaultAlphaBuffer()Shawn Rutledge2013-05-303-2/+34
| | | | | | | | | | | | | | All QQuickWindows will render using the same OpenGL context, so for a window to support transparency, the OpenGL context needs to be created with support for transparency from the very start. Therefore the application needs to call setDefaultAlphaBuffer() before creating windows. There are some relevant comments in QTBUG-20768 although the bug itself is not the same use case (it was already OK as long as the first window had a translucent color, because of setAlphaBufferSize in QQuickWindow::setColor()). Change-Id: I92e111c1a62c0d510821b646fd334e52254f8f57 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Doc fixes to the Positioners/Layouts documentationJan Arve Saether2013-05-302-9/+9
| | | | | | | | | | | * Add references to Qt Quick Layouts * Don't lie about that Positioners can resize the items * Rename title from "Item Layouts" to "Item Positioners" to avoid confusion with Qt Quick Layouts Change-Id: I43e3ad6e6d9e4b08a1233868c75f0efcab43f8c3 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Do not draw negative-size ShaderEffect(Source) items.Gunnar Sletta2013-05-282-3/+3
| | | | | | | | | | | | | | | We were a bit inconsistent here. A negative size Image element would not render at all, a negative size ShaderEffect would render mirrored and a negative size ShaderEffectSource would trigger an assert. Be consistent and not draw any of them. DropShadow from QtGraphicalEffects uses both a ShaderEffectSource and a ShaderEffect together, so keeping the behavior in ShaderEffect would make it render incorrectly. Task-number: QTBUG-31383 Change-Id: Ied5568d7edbc2aed96b00adfdc6aae09b6f2a7d9 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Prevent tab focus from wrapping endlesslyLiang Qi2013-05-271-4/+28
| | | | | | | | | | | | | | | | | | If there was no item that accepted focus, it would go into an endless loop. This also changes the default behavior of QQuickWindow. When there is not any activeFocusItem in the whole window, it means the contentItem got focused. The Tab/BackTab key will now focus the next item in the tab focus chain. Autotest is included. Done-with: Frederik Gladhorn <frederik.gladhorn@digia.com> Task-number: QTBUG-31344 Change-Id: I854292f89a327c493eec21969907c94aa9cfddcb Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix TextEdit content size calculationJ-P Nurmi2013-05-221-1/+3
| | | | | | Task-number: QTBUG-31154 Change-Id: I9d3e31352967b99b4bbb38f5819d3d093438ee37 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* QQuickTextControl: emit cursorPositionChanged() only if it changedJ-P Nurmi2013-05-221-1/+4
| | | | | | Change-Id: Id6fe03677e93119a63bfe87ade3cd333bf4890a1 Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Doc: Fix some broken linksSze Howe Koh2013-05-203-21/+21
| | | | | Change-Id: I1385a8947107a7c80b32306fc587aff45536a4ec Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Respond appropriately to textFormat changedAlan Alpert2013-05-171-0/+1
| | | | | | | | | | If the text has not changed when textFormat changes between states other than RichText, the text was not re-laid-out. This is necessary if the text includes control tags. Task-number: QTBUG-31191 Change-Id: I3c6f5343aa85e8337b90cf86748a696d5742e906 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Fix a warning when setActiveFocusOnTab(false) for root itemLiang Qi2013-05-171-1/+1
| | | | | | | | Task-number: QTBUG-31114 Change-Id: I4d6aac534fbc1e84593e4d7084e6a892eea4256c Reviewed-by: Caroline Chao <caroline.chao@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fix a crash in QQuickRepeater::clear()J-P Nurmi2013-05-161-5/+6
| | | | | | | Change-Id: Iedf45862323ca8233be155ce65cd3348abd0a8e5 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>
* Document Flickable.pixelAligned.Mitch Curtis2013-05-161-0/+12
| | | | | | Change-Id: I8ea85269c2666d18bf3c3815d2de0f90e9e0a3f4 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Make Canvas respect smooth: true/falseGunnar Sletta2013-05-151-0/+1
| | | | | | Change-Id: I6e68fcfc534aca139484a9b2970e61fb22688c58 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Fix warnings about unused parameters.Friedemann Kleint2013-05-152-0/+4
| | | | | Change-Id: I091a0369f2026ae820d623aadd13a3190d40a56b Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Fix documentation of QtQuick2::DragEvent::accepted, it's a bool.Sérgio Martins2013-05-151-1/+1
| | | | | | Change-Id: I4773b8b1c1f96279e34979534a1a53e724009e44 Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Doc: corrections, spelling, and ListView requirements commentsDavid Fries2013-05-151-1/+1
| | | | | | | | | | From the ListView comment I thought the model had to be derived from QAbstractListModel, but that's not the case, QAbstractListModel will work just fine, it just doesn't support specific cases such as trees. Change-Id: I59305006540ddc049e276cf412571373cbfa6c67 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix typos in QQuickDrag documentation.Sérgio Martins2013-05-141-5/+5
| | | | | Change-Id: Iab8c537e16e9767ddfd837503a340eb708aa6814 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Mac: respect the system settings in Full Keyboard AccessLiang Qi2013-05-142-1/+43
| | | | | | | Iterate all or not in nextPrevItemInTabFocusChain function. Change-Id: I95289b042f3d9924c28ffb9c8c7124c767addf2e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fix assertion in qt_create_image_data().Mitch Curtis2013-05-101-1/+1
| | | | | | | Don't compare qreal against int. Change-Id: Ic8970ed0a21a7d5d0f0ffd0ca37ee49b04f38d6c Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Don't fix up x/y while initializingAlan Alpert2013-05-101-0/+4
| | | | | | | | | | Any initial values leading to content outside the Flickable are likely to be explicitly set as initial property values. "fixing" them up will lead to just ignoring them. Task-number: QTBUG-30837 Change-Id: I3b2593605f16d73ba008bc6a6f067ab6020bcbe4 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Revert "Mac: respect the system settings in Full Keyboard Access"Liang Qi2013-05-082-37/+1
| | | | | | | | | This breaks Qt Quick Controls activeFocusOnTab autotests. This reverts commit 305616a60462b668c4d0b3d19302fa90469aceb5. Change-Id: Ided59ebe99659b23e950e8269ccaa8d7d44a4fdb Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* The resources property should be independent from QObjectThomas Hartmann2013-05-083-15/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Resources was a direct mapping of the QObject children. This led to problems since the QObject children can also contain other objects from other sources like attached properties. This patch decouples resources from QObject properties and also does not call setParent() anymore. The special case for QQuickWindow in data_append does rely on the fact that QObject::setParent() is called and the inner window becomes a QObject::child of the content item. So we keep the setParent for this special case. The children property does not take QObject ownership either. QObject ownership is handled by the VME. None of the documented QML use cases should be touched by this change. This is a cleaner solution then the ad hoc fix provided by https://codereview.qt-project.org/#change,54677 I changed also the test. The list count now has to be exactly 4. Change-Id: I5c119e333ee82e888aaac1da559fd63a875d08ee Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Add QQuickWindow::closing signal, and ability to ignore the eventShawn Rutledge2013-05-084-0/+85
| | | | | | | | | | | An application can implement onClosing() and set closeEvent.accepted = false to delay the closing (for example to prompt the user to save changes). Depends on change I9abed47fca02a002b78727f98d678a824854adfc in qtbase. Task-number: QTBUG-31019 Change-Id: Icfd4a03ecef3621bdbbee2e2c3157b897a9b6524 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Mac: respect the system settings in Full Keyboard AccessLiang Qi2013-05-082-1/+37
| | | | | | | Iterate all or not in nextPrevItemInTabFocusChain function. Change-Id: I14d40dbeda01ca470efe23886789383ff1d30c0f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Doc: Fix some broken snippet pathsSze Howe Koh2013-05-061-1/+1
| | | | | Change-Id: Ib79bfbea402b86e26a503de47383522317ca906b Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* 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>