aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitem_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-041-3/+1
|\ | | | | | | Change-Id: I48764527fa1ab6d8d59c24552394459b1cdc58ee
| * Fix crash with window-less QQuickItemsSimon Hausmann2016-09-301-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark QQuickItem visual children directly in QQuickItem instead of relying on the item being a (grand) child of a window. [ChangeLog][QtQuick] Fix crash with QQuickItems created via JavaScript being garbage collected sometimes when they're not assigned to a window. This may happen even in qmlscene when between the creation of the root item and the assignment to the QQuickWindow the garbage collector runs. The previous approach of a persistent in QQuickView marking the visual item hierarchy relies on the existence of a view. The only thing left to do in the view and qml window implementation is enforcing the CppOwnership policy set on the content item in QQuickWindow by ensuring the presence of the JS wrapper, replacing the persistent with a weak value. This also introduces a new internal mechanism for QObject sub-classes to provide their own V4 JS wrapper types. Task-number: QTBUG-39888 Change-Id: Icd45a636a6d4e4528fc19165b13f4e1ca7967087 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Fix QQuickItem change listenersJ-P Nurmi2016-05-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | All listeners should get invoked, even if they remove themselves while iterating the listeners. An index-based loop would skip the next listener in the list. This change replaces the QPODVector with a QVector, so we can make a cheap copy before iterating the listeners. Change-Id: I2430b3763184a40ad1c5c3a68d36fecafcadb3ee Task-number: QTBUG-53453 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-271-3/+2
|\| | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickimagebase.cpp src/imports/layouts/plugin.cpp Change-Id: I5f48474df4034a1347ec74795c85d369a55b6b21
| * QML: Remove baselineOffsetValid flag from QQuickItem.Erik Verbruggen2016-04-201-3/+2
| | | | | | | | | | | | | | | | | | This flag was only used to return 0.0 when false, and baselineOffset when true. So initializing the baselineOffset to 0.0 does the same thing. Change-Id: Ia92b05761ea3a03175ae0078bf950a1b4da2d356 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Add support for mapping between item's and global screen coordinatesNikita Krupenko2015-12-101-0/+2
|/ | | | | | | | | | | | | | | | | | Added to Item mapToGlobal() and mapFromGlobal() methods, that maps from item's coordinate system to global screen coordinates and vise versa and accessible from QML. This allow to align window (which is a global object) in relation to Qt Quick item object. For example, this may be helpful to add a popup to a Qt Quick component. [ChangeLog][QtQuick][QQuickItem] Added support for mapping item's coordinates to global screen coordinates and vise versa. Task-number: QTBUG-28668 Change-Id: I0a90838f26c53b16d7a76953577492a942674572 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QQuickItemPrivate: added a accessibleRole()Liang Qi2015-10-211-0/+4
| | | | | | | Which is used in QAccessibleQuickItem. Change-Id: Ie9c9d59783c4af0c53a3ffe88046132fb6b5c0fd Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Don't send delayed mouse presses to ancestors of the replaying Flickable.Andrew den Exter2015-10-121-0/+1
| | | | | | | | | | | | | If a Flickable delayed a mouse press event and then replayed it later, ancestor items of that Flickable would receive the press twice: once when filtering events of the Flickable, and again when the event was replayed to a descendent of the Flickable. Extend the protection against a Flickable receiving that repeat event to all ancestor items so this doesn't happen. Change-Id: I438c146130c24a7d47e9e8712a1ab08f3d915a06 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
* Add isTabFence private flagGabriel de Dietrich2015-08-211-0/+8
| | | | | | | | | | | | When an item has this flag set, the user can't tab-navigate either out of it, or enter it. We use this flag to implement QQuickPanel as an item for platforms that only support one single top-level window. Change-Id: I1f4313912ae1c70217af0d4d21064932b50a9438 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add possibility to mirror ShaderEffectSource generated texturesMiikka Heikkinen2015-08-201-0/+6
| | | | | | | | | | | | | Using textures generated by ShaderEffectSource items (or Item.layer) with custom OpenGL code was non-intuitive due to mismatching coordinate systems, so added a possibility to control the generated texture orientation. [ChangeLog][QtQuick][ShaderEffectSource] Added possibility to mirror generated OpenGL texture. Change-Id: I7c03d8b6fbfc43d69812c15d244200fb8e7c7bb9 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Add EnterKey attached propertyKai Uwe Broulik2015-08-031-0/+25
| | | | | | | | | | | This adds an attached property EnterKey allowing to manipulate the Enter key appearance. [ChangeLog][QtQuick][Item] Added EnterKey attached property that allows to change the appearance of the Enter key on an on-screen keyboard Change-Id: Ic9a01b0217c317e4ed3a9eef1fa01f2f113f0294 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Port from Q_ENUMS to new macro Q_ENUM.Friedemann Kleint2015-06-191-4/+2
| | | | | | | | | | | Remove Q_ENUMS in favor of the new Q_ENUM macro which provides registration as meta enum and a debug stream operator. QQuickXmlListModel::Status is left unmodified as porting it creates a link error in tst_qquickxmllistmodel. Change-Id: Id5e6192c9f85e7c94332508fbd91873ddda31e1a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix usage of QtQmlDevTools private headers on OSX with framework buildsSimon Hausmann2015-03-161-1/+1
| | | | | | | | | | | | | | | | Previously this module borrowed its private headers from QtQml, so that when writing QT += qmldevtools-private, you'd get the private headers from QtQml. This doesn't work when QtQml is built as a framework. A cleaner solution is to give this module its headers proper by letting syncqt create the forwarding headers correctly (and consequently also include them in make install). In order for this to work, the included headers themselves cannot include any headers from QtQml, which this patch also takes care of, through a centralized inclusion of qv4global_p.h. Change-Id: I9bb8337956a2774cfaca6b338369face6c6ee785 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Use TabFocusBehavior in QStyleHints in QtQuickLiang Qi2015-02-121-1/+0
| | | | | | | | * QQuickItemPrivate::qt_tab_all_widgets was removed. * qt_tab_all_widgets in test was updated. Change-Id: I418d7a3edae0a4782a91289f6c0494ff5874d071 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/devLars Knoll2014-10-301-2/+2
|\
| * Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-291-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickaccessibleattached_p.h src/quick/items/qquickwindow.cpp src/quick/scenegraph/qsgthreadedrenderloop.cpp Change-Id: I8bf07487a75f9d1b0d6efa5914dd06875fc9654d
| | * Support Accessible.ignored on non-leaf itemsJan Arve Saether2014-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ignoring items with children will make the children appear as children of the parent of the ignored item. Since setAccessibleFlagAndListener now only sets the flag we also rename the function to just setAccessible Change-Id: I79fc311509a3e454b4698274c63ad0e879fb93e3 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
| | * Export QQuickKeyNavigationAttached as a part of the private APIOleg Shparber2014-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This change fixes linking problems when QQuickKeyNavigationAttached is used through private headers. Change-Id: I176a9551718d9ba25c160a3b1caa8872c88d39f3 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | | Move from a count of cursors, to storing whether or not a subtree has a cursor.Robin Burchell2014-10-291-3/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calculation of this is going to be slower (of course) as we have to recurse the children, but this only happens when unsetting a cursor or removing a child item from a tree that had a cursor. On the other hand, wasting 4 bytes per ExtraData plus padding is quite a large concern, and it was also forcing allocation of ExtraData for an entire tree that had a cursor set. This also reduces the size of ExtraData from 152 down to 144 bytes through reordering of members on x86_64. Change-Id: Iab14ee71c762285bf4448fc86399070263eb118d Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Remove the "groupNode"Gunnar Sletta2014-10-171-19/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We originally had the groupnode to simplify adding and removing clip / effect / opacity nodes to the item tree at a time when the renderer was a bit more trivial and only did a single pass over the tree during rendering. The runtime cost at the time was negligible. The QSGBatchRenderer has a bit more logic, so the extra node now costs a bit more. In addition to extra memory, we need to allocate shadow nodes for it and put those into the renderer's internal shadownode hash. This removal increases the performance of adding / removal of simple items by ~10% in addition to reducing the number of nodes in the scene graph by up to 1/3. Change-Id: I8cd64984f868d75820e25d33dfdbebd4d20651fe Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Resolve QQuickItemPrivate::beforePaintNode dynamically.Gunnar Sletta2014-10-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | It will be the 0 unless the item has a direct child with negative z, which occurs very rarely. Its presence complicates the algorithm used to solve QTBUG-34255 and it wastes 8 bytes per visual item. No difference could be noted in a benchmark animating 6000+ sprites. Task-number: QTBUG-34255 Change-Id: Id0a78a246f0d621a51c8caad23da02b55d59b9bb Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-111-19/+11
|\| | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickpainteditem.h src/quick/items/qquickshadereffectsource.cpp src/quick/items/qquickshadereffectsource_p.h Change-Id: If98096443afe85fc4370cef971eace050006a61b
| * Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* | Add Q_DECL_OVERRIDEAlbert Astals Cid2014-08-141-16/+16
|/ | | | | Change-Id: I2e64950aef710f943c3bc50bc9bf8a1f7fb58d28 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Introducing QQuickItem::sceneGraphInvalidated/sceneGraphInitializedGunnar Sletta2014-07-291-0/+1
| | | | | | | [ChangeLog][QtQuick][QQuickItem] Added signals sceneGraphInitialized and sceneGraphInvalidated Change-Id: Idaea88bc743f0637d093cf1ba7ac4f78acd7e6ad Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Make item.layer and item.layer.effect work inside positioners.Gunnar Sletta2014-05-081-0/+4
| | | | | | | Task-number: QTBUG-31269 Change-Id: Ic3bb76ea5a5055df614f2eaacd3031445f118ca7 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Notify about the focus reasonBerthold Krevert2014-05-061-1/+2
| | | | | | | | | KeyNavigation sets the focus reason always to Qt::OtherFocusReason. This should be changed at least for tab and backtab navigation. Change-Id: I27c654a202e2a80449dd5420460e413ca9cff75e Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Liang Qi <liang.qi@digia.com>
* Fix interaction of QQuickItems with the garbage collectorSimon Hausmann2014-01-061-0/+3
| | | | | | | | | | | | | | | | | The QObject ownership of QQuickItem objects is not accessible / mutable in QML, because the parent property maps to the (dynamic) visual parent. There are use-cases of creating QQuickItem objects without a QObject parent and to support this, the visual parent needs to mark its visual children in order to provide intuitive semantics. [ChangeLog][QtQuick][Import Behavior Changes] A QQuick Item is now strongly referenced by its visual parent item, so it doesn't require a QObject parent to stay alive. Task-number: QTBUG-35913 Change-Id: Ief2d40ac76298a0cf241ca73ff654c4ecfa12748 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-161-1/+1
|\ | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickitem.cpp src/quick/items/qquicktext.cpp tests/auto/quick/qquicklistview/tst_qquicklistview.cpp Change-Id: I0bc5786098193c2c40b6fd8905de75d90f6ed0cf
| * Size changes do not warrant a transform update.Gunnar Sletta2013-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | The size is not a part of the matrix, so the matrix does not need to be recomputed when the size of an element changes. The exception from this is when using transform origin which is already specialcased in the QQuickWindow::updateDirtyNode() function. Change-Id: I2c517880d39aa69232974f65da93333b7cba341d Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Support toggling antialiasing for Text and Rectangle.Michael Brasser2013-12-031-0/+4
| | | | | | | | | | | | | | Task-number: QTBUG-27968 Task-number: QTBUG-34366 Change-Id: Ic446ff4470abf21696e1764f902bd71e79762697 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Fix delivery of QEvents to QQuickItemsDaniel d'Andrada2013-11-291-10/+0
|/ | | | | | | | | | | Make them go through QObject::event() and comply to filtering from objects passsed to QObject::installEventFilter() Task-number: QTBUG-32004 Change-Id: Ib6972e7f5e588bee986ae5f2d69aa6fccb58af95 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Use one render loop per QQuickWindowGunnar Sletta2013-10-301-0/+7
| | | | | | | | | | | | | | | | | | | See the task for the full reasoning behind this patch. The threaded renderloop has been refactored to have one window per thread. This is mostly a simplification of the current code path where for loops over multiple windows are turned into if (window). The QSGContext has been split into two classes, QSGRenderContext for which there is one per OpenGLContext. The rest of the patch is name changes and a couple of cleanups in the hopes of simplifying this change. Task-number: QTBUG-33993 Change-Id: I31c81f9694d7da7474a72333169be38de62613c4 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Remove ancient and unused leftoversGunnar Sletta2013-10-221-6/+0
| | | | | Change-Id: Ia3a2aa2244748c2f3f2df8853f5bddfbbc4bc19f Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Make transform and opacity animators work when layer.enabled: trueGunnar Sletta2013-10-031-0/+3
| | | | | Change-Id: I6d9ece93a75782d524c211fc81a43f4311a38571 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Allow QtQuick private headers to be used with QT_NO_KEYWORDS.Jocelyn Turcotte2013-09-121-3/+3
| | | | | | | | | | | This is necessary for the QtWebEngine module. This also adds an empty nokeywords test using the same mechanism as qtbase/tests/auto/tools/moc/no-keywords.h to find conflicts at compile time. Change-Id: I9df541720797dd61f078178c2af68ead18ff8bfe Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Support opt-in QSGNode descriptions without breaking binary compat.Gunnar Sletta2013-08-121-4/+4
| | | | | | | | | | This define is quite useful for debugging scene graph internals, but it is disabled by default to conserve memory. For clarity, I renamed the define to QSG_RUNTIME_DESCRIPTION. Change-Id: Ie5ff44d67af38adc65d0d09255d8533dc7a33bff Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix -Wpedantic warningsAlbert Astals Cid2013-06-121-1/+1
| | | | | | | | Don't need these extra ; and give warnings with -Wpedantic Change-Id: I877fee2a6421b1aaa97ca3845a09d70f3b2b302b Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix -Wpedantic warningsAlbert Astals Cid2013-06-071-1/+1
| | | | | | | Don't need these extra ; and give warnings with -Wpedantic Change-Id: I877fee2a6421b151697ca3845a09d70f3b2b302b Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Mac: respect the system settings in Full Keyboard AccessLiang Qi2013-05-141-0/+3
| | | | | | | Iterate all or not in nextPrevItemInTabFocusChain function. Change-Id: I95289b042f3d9924c28ffb9c8c7124c767addf2e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Revert "Mac: respect the system settings in Full Keyboard Access"Liang Qi2013-05-081-3/+0
| | | | | | | | | 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-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Mac: respect the system settings in Full Keyboard AccessLiang Qi2013-05-081-0/+3
| | | | | | | Iterate all or not in nextPrevItemInTabFocusChain function. Change-Id: I14d40dbeda01ca470efe23886789383ff1d30c0f Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Expose nextItemInFocusChain in QQuickItemLiang Qi2013-04-231-0/+1
| | | | | | | | | 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>
* Support activeFocusOnTab in QQuickItemLiang Qi2013-03-121-2/+4
| | | | | | | | | | | | | | | | | | | Add activeFocusOnTab as property to QQuickItem. Setting the property allows automatic keyboard navigation between all elements that have it set. This key event handler will only be called after the QML key handlers, such as KeyNavigation and Keys, and the C++ key event handlers, such as keyPressEvent function. Algorithm is most done by Frederik Gladhorn, in cooperation with Gabriel de Dietrich. Done-with: Frederik Gladhorn <frederik.gladhorn@digia.com> Done-with: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Change-Id: I8b58be9c20d113661fe85d27bdb1af84340d9de5 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Merge branch 'stable' into devGunnar Sletta2013-01-171-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/qml/doc/qtqml.qdocconf src/quick/doc/qtquick.qdocconf Change-Id: I087fa14720995a5e53c43567dc4a3c29eb9992a9
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | | | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>