summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Update licenseheader text in source filesJyri Tahtela2011-05-131-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Introduce QGraphicsItem::ItemStopsFocusHandling flagMichael Hasselmann2011-03-161-3/+3
| | | | | | | | | | | | | | | | | | | | When set for an item, QGraphicsScene will skip focus handling for this item and everything underneath it (including focus-out). Allows users to reimplement custom focus handling. Use case: touch devices that implement panning. Here, focus-in has to happen only if no panning was triggered. Analogous, no focus-out should happen when panning was detected. Fixes the alternative proposal ("black holes for focus changes") of QTBUG-16343: QGraphicsView doesn't support focus change on mouse release. The previous test was only testing one scenario, which didn't give a good idea whether the flag was actually working as intended. Task-number: QTBUG-17505 Reviewed-by: Yoann Lopes Reviewed-by: Jan-Arve Sæther
* Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | Reviewed-by: Trust Me
* Don't emit activeFocusChanged() unless the active focus actually changedTor Arne Vestbø2010-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | We would previously call subFocusItemChanged(0) on the item as part of clearing the subfocus, even if the item in question would recieve a new subfocus item as part of setting the new subfocus. This resulted in the declarative item emitting activeFocusChanged(false) and then activeFocusChanged(true), which was affecting any animation or state bound to the activeFocus property of the item. We now stop clearing the subfocus when encountering an item that we know will get subfocus during the set-subfocus pass. We then set subfocus all the way to the root item, since the subfocus item itself might change. The effect of this is that the declarative item will only get one call to subFocusItemChanged(), passing the new subfocus item, instead of two. This means the declarative item can keep track of wherther ot not it had a subfocus item previously, and only emit activeFocusChanged() when the active focus goes from true to false or false to true. Task-number: QTBUG-15615 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Fixed many spelling errors.Rohan McGovern2010-10-251-2/+2
|
* Don't give focus to a FocusScope that has had focus explicitly cleared.Michael Brasser2010-10-111-1/+1
| | | | | | | If focus was explicitly cleared on a non-visible FocusScope, and then it was made visible, it would incorrectly grab focus. Task-number: QTBUG-13380
* Add sendParentChangeNotification to QGraphicsItemMarco Bubke2010-09-301-1/+3
| | | | | | | Fixes crash in creator. If flag is true notifications are sent. It is important that positioners work correctly and don't leak. Reviewed-By: Alexis Menard
* QGraphicsItem::childrenBoundingRect behavior breaks ↵Bjørn Erik Nilsen2010-09-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | QGraphicsEffect::sourceBoundingRect(). Context: QGraphicsEffect::sourceBoundingRect() returns: item->boundingRect() | item->childrenBoundingRect(); Problem was that item->childrenBoundingRect() adjusted the children's bounding rect with the children's ancestor effects (child -> root item), which means the source bounding rect was bigger than needed. We should only account for effects downwards in the hierarchy. root (has effect) | item (has effect) | child | grandChild Auto test included. Task-number: QT-3633, QT-3828 Reviewed-by: samuel
* Wrong bounding rect returned by QGraphicsEffect::boundingRect().Bjørn Erik Nilsen2010-09-161-10/+4
| | | | | | | | | | | | | | Regression after: f5c5e20a Problem was that the cached bounding rect was never invalidated. We can also remove the cached bounding rect in QGraphicsEffectSource because QGraphicsItem::childrenBoundingRect now clips by default. This basically means partially reverting above commit and invalidate whenever ItemClipsChildrenToShape flag changes. Auto test included. Task-number: Discovered while investigating QT-3633 Reviewed-by: samuel
* Completing the interface for children/data/resourcesThomas Hartmann2010-09-141-0/+1
| | | | | | | | This patch makes the handling of properties like children and data easier in Bauhaus. Especially in the case of property alias Reviewed-by: Aaron Kennedy
* QML focus API updates.Michael Brasser2010-07-211-0/+1
| | | | | | | | | The wantsFocus property has been renamed to activeFocus, to better reflect its value. Reading and writing the focus property is also now consistent -- this property represents focus within a scope. Other small changes were made to keep things consistent with the new naming. Reviewed-by: Aaron Kennedy
* Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-07-151-4/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.h src/3rdparty/webkit/WebCore/page/FrameView.cpp src/3rdparty/webkit/WebCore/page/FrameView.h src/3rdparty/webkit/WebCore/platform/ScrollView.cpp src/3rdparty/webkit/WebCore/platform/ScrollView.h src/corelib/plugin/quuid.cpp src/gui/dialogs/qfontdialog.cpp src/multimedia/audio/qaudiodevicefactory.cpp src/opengl/qgl.cpp src/openvg/qpaintengine_vg.cpp tests/auto/qxmlquery/tst_qxmlquery.cpp
| * Fixed missing clip when computing the graphics item effect source rect.Samuel Rødal2010-07-021-4/+10
| | | | | | | | | | | | | | | | | | | | If item clips children to shape we should take that into account when computing the source rect, to avoid creating unnecessary large source pixmaps which might have a significant performance impact. Task-number: QT-3551 Reviewed-by: Gunnar Reviewed-by: Trond
* | Add a new (internal) flag QGraphicsItem::ItemStopsClickFocusPropagation.Bjørn Erik Nilsen2010-06-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This flag allows you to create a non-focusable item that can be clicked on without changing the focus. This is also possible to achieve by using focus scopes / panels, however the implementation is then way more complex. Thew new flag is tailored for simple uses cases where you simply want to stop the propagation and nothing more. Auto test included. Task-number: QT-3499 Reviewed-by: yoann
* | Add a new qconfig feature GESTURESTasuku Suzuki2010-06-021-0/+2
| | | | | | | | | | Merge-request: 535 Reviewed-by: Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>
* | Performance issue with QGraphicsItem::ItemClipsChildrenToShape.Bjørn Erik Nilsen2010-05-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | If the child rect is bigger than the parent rect and parent has the ItemClipsChildrenToShape flag set, then by updating the child, the whole child rect is marked as dirty, resulting in a much larger update area than required. This has a major impact on performance in Orbit/HB, where e.g. item-views typically consist of a container item that clips its children/items to shape. See attached video in QTBUG-9024. Auto test included. Task-number: QTBUG-9024
* | Merge branch 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration ↵Qt Continuous Integration System2010-04-271-0/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into 4.7-integration * 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: (73 commits) Apply Rhys's fix to qpaintengine_vg.cpp to make it compile Attempt again at fixing the OpenVG paint engine build Revert "Attempt at fixing compile failure introduced by 4.6 merge in qpaintengine_vg.cpp" Attempt at fixing compile failure introduced by 4.6 merge in qpaintengine_vg.cpp Fixing the wrong QUrl usage When on Symbian use smaller files. correctly position glyphs for complex languages Removed inneccessary QGlyphLayout::offsets initialization. Fix mirrored characters for RTL text in Symbian QNAM: Add a code comment related to the cache tst_QSystemSemaphore::processes fixed for WinCE tst_qsystemsemaphore: fix deployment of lackey.exe for WinCE tst_qsharedmemory: create multiple instances of lackey.exe on WinCE tst_qsharedmemory: fix deployment of lackey.exe for WinCE fix compilation of tst_sharedmemory on Windows CE QtScript: regression with instanceof operator for QMetaObject wrappers examples/widgets/stylesheet fix mainwindow.ui QStyleSheetStyle: fix memory leak on base style change QNAM HTTP: Fixed a bug when getting empty files with pipelining Fix window transparency on Symbian. ...
| * \ Merge branch 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration ↵Qt Continuous Integration System2010-04-231-0/+7
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into 4.7-integration * 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: (71 commits) Revert "Attempt at fixing compile failure introduced by 4.6 merge in qpaintengine_vg.cpp" Attempt at fixing compile failure introduced by 4.6 merge in qpaintengine_vg.cpp Fixing the wrong QUrl usage When on Symbian use smaller files. correctly position glyphs for complex languages Removed inneccessary QGlyphLayout::offsets initialization. Fix mirrored characters for RTL text in Symbian QNAM: Add a code comment related to the cache tst_QSystemSemaphore::processes fixed for WinCE tst_qsystemsemaphore: fix deployment of lackey.exe for WinCE tst_qsharedmemory: create multiple instances of lackey.exe on WinCE tst_qsharedmemory: fix deployment of lackey.exe for WinCE fix compilation of tst_sharedmemory on Windows CE QtScript: regression with instanceof operator for QMetaObject wrappers examples/widgets/stylesheet fix mainwindow.ui QStyleSheetStyle: fix memory leak on base style change QNAM HTTP: Fixed a bug when getting empty files with pipelining Fix window transparency on Symbian. Tweak the 'normalGeometry' of the widget before setting it. Use QDesktopWidget as a status pane observer on Symbian. ...
| | * \ Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-04-211-0/+7
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: src/openvg/qpaintengine_vg.cpp src/script/bridge/qscriptqobject_p.h tests/auto/bic/tst_bic.cpp
| | | * No repaint when resizing graphics item with an effect.Bjørn Erik Nilsen2010-04-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that the item's cache was not invalidated from prepareGeometryChange(). We did invalidate the cache for all the ancestors, but not for the item itself. To avoid looping through the whole parent chain twice, we invalidate the item's cache before walking the parent chain. It would be nice to centralize the cache invalidating mechanism, but for now it's OK to solve it like this. Auto test included. Task-number: QTBUG-9551 Reviewed-by: samuel
| | | * Revert "Add a children private property needed for QML to support ↵Alexis Menard2010-03-311-67/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QGraphicsObject" This reverts commit 4be83fa7337c5a4eb7b0ce085aa5854af5d33252. Conflicts: src/gui/graphicsview/qgraphicswidget.cpp This drops the support of QML on top of 4.6
| | | * Revert "struct -> class, it's better."Alexis Menard2010-03-311-2/+1
| | | | | | | | | | | | | | | | This reverts commit 1d094129c0c3994df4e59cd9eda6981a7b131903.
| | | * struct -> class, it's better.Alexis Menard2010-03-301-1/+2
| | | | | | | | | | | | | | | | Reviewed-by:TrustMe
* | | | Fix update issue when an item has an effect and child.Alexis Menard2010-04-271-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a child marks its parent as dirty (and the parent has an effect) and they are not in a scene, they must not set fullUpdatePending to 1 because if the scene is in fullUpdate (not yet painted) then the item will not be processed by processDirtyItemRecursive so the fullUpdatePending flag will never be reset by resetDirtyItem. Any calls to update() will be then discarded because it will think that a full update is pending for the item. A full update will be done anyway by the scene and if not then markDirty will do its job when the parent will be added to the scene. Task-number:QTBUG-10037 Reviewed-by:bnilsen
* | | Avoid calling QGraphicsItem::setTransformOriginPoint() until neededMartin Jones2010-04-161-0/+1
|/ / | | | | | | | | Task-number: QTBUG-9772 Reviewed-by: Alexis
* | Bring support of anchors in QML for QGraphicsWidget derived classes.Alexis Menard2010-04-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | This commit add a extension object to bring the anchors property for a QGraphicsWidget. The actual implement uses a separate object for storing the anchor pointer. In the future it would be nice if the extension object is the anchor itself. Also there are two connects extra for QGraphicsWidget one can perhaps disappear with a later commit. Only baseline case is not supported because QGraphicsWidget don't have any concept of baseline. Reviewed-by:akennedy
* | Allow iteration over the Item.children propertyAaron Kennedy2010-04-071-1/+4
| | | | | | | | QTBUG-9645
* | Make QDeclarativeListProperty a classAaron Kennedy2010-03-301-1/+2
| | | | | | | | Apparently structs are not socially acceptable.
* | Test and fix order of transform application.Warwick Allison2010-03-261-0/+1
| | | | | | | | Remove Translate.z since Qt cannot sensibly support it yet.
* | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.7Alexis Menard2010-03-251-0/+67
|\ \ | |/ | | | | | | | | | | Conflicts: mkspecs/common/symbian/symbian.conf qmake/generators/symbian/symmake.cpp src/3rdparty/webkit/WebCore/WebCore.pro
| * Add a children private property needed for QML to support QGraphicsObjectAlexis Menard2010-03-241-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit adds a private property that QML can use to add children for a given item. This is a custom list that calls a callback which actually reparent the item instead of just appending in the list (otherwise it will mess up the state of QGraphicsView). This is needed because childItems() is pretty useless you get a list but if you append something on it then it adds that into a copy. Also the children property is the default property a concept used by QML. Width and Height private properties has been added in order to support better the integration with QGraphicsWidget in QML. The actual implementation is in the private class of QGI and QGraphicsWidget reimplements it to return the geometry. (In 4.7 QDeclarativeItem reimplements it too). This change should be harmless everything is private. Task-number:QT-2757 Reviewed-by:andreas
* | Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Rohan McGovern2010-03-061-1/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.exe examples/multimedia/audioinput/audioinput.cpp src/corelib/io/qfsfileengine.cpp src/gui/egl/qegl_wince.cpp src/gui/egl/qeglproperties.cpp src/gui/egl/qeglproperties_p.h src/gui/embedded/directfb.pri src/gui/kernel/qapplication_win.cpp src/gui/painting/qdrawutil.cpp src/opengl/qgl_p.h src/sql/drivers/odbc/qsql_odbc.cpp src/sql/drivers/odbc/qsql_odbc.h tests/auto/auto.pro tests/auto/qgl/tst_qgl.cpp translations/assistant_adp_ru.ts
| * Properly fixes crash when destroying a QGraphicsItem.Yoann Lopes2010-03-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | The focus is now properly cleared when hiding or showing focus scopes or when a child of a focus scope is destroyed. No change of behavior in how focus scope works for QML. Autotest included. Task-number: QT-2649 Reviewed-by: Andreas Aardal Hanssen
* | Merge branch 'master' of git:qt/qt-qmlThiago Macieira2010-02-251-1/+1
|\ \ | | | | | | | | | | | | Conflicts: src/declarative/graphicsitems/qdeclarativeparticles.cpp
| * | Change class prefix to from QmlXXX to QDeclarativeXXX, QmlGraphicsXXX to ↵Warwick Allison2010-02-241-1/+1
| |/ | | | | | | QDeclarativeXXX.
* | Fix a memory hole in QGraphicsItemPrivate.Alexis Menard2010-02-221-5/+6
|/ | | | Reviewed-by:bnilsen
* Adds convenience functions QGraphicsItemPrivate::isOpacityNullLeonardo Sobral Cunha2010-01-291-2/+8
| | | | | | | This should unify the error constant used along the code and enforce qreal to avoid unnecessary double conversions. Reviewed-by: bnilsen
* Fixes visibility update missing when doing setParentItem on graphicsitemLeonardo Sobral Cunha2010-01-261-0/+33
| | | | | | | | | | Calling setParentItem is causing the previous opacity/visible updates to be discarded because the dirty flags were not propagated to the new parent. Also removed some unnecessary 'markDirty' and 'update' calls. Task-number: QTBUG-6738 Reviewed-by: bnilsen
* Added optimization flag to QGraphicsItemPrivate.Samuel Rødal2010-01-251-0/+3
| | | | | | | Avoid traversing the whole child hierarchy when opacity changes unless there are children with graphics effects. Reviewed-by: Bjørn Erik Nilsen
* Fixed child items with graphics effects not inheriting opacity.Samuel Rødal2010-01-251-1/+5
| | | | | | | We need to invalidate the graphics source pixmap cache for both child items and parent items when changing the opacity of a graphics item. Reviewed-by: Bjørn Erik Nilsen
* QGraphicsWidget is painted twice on the inital show.Bjørn Erik Nilsen2010-01-221-0/+2
| | | | | | | | | | | | | Problem occured when doing something in the polishEvent() which eventually ended up as an update(). The problem was that in QGraphicsScene::addItem we scheduled a polish event after scheduling an update, resulting in update requests being processed before polish requests. Auto-test included. Task-number: QTBUG-6956 Reviewed-by: alexis
* Only send QGraphicsItem::ParentChange(d) notifications from setParentItem.Bjørn Erik Nilsen2010-01-211-1/+2
| | | | | | | | | | | | | | | QmlGraphicsItem doesn't need any parent change notifactions so we can call the helper class (QGraphicsItemPrivate::setParentItemHelper) direclty from QmlGraphicsItem::setParentItem. This avoids a lot of unnecessary instructions related to QVariant constructions as well as virtual function calls. I've made the variant pointers explicit in the declaration of setParentItemHelper so that we don't accidentally call setParentItemHelper from places where we need parent change notifications. Task-number: QTBUG-6877 Reviewed-by: alexis
* Improve performance of QGraphicsItem::setParentItem.Bjørn Erik Nilsen2010-01-211-3/+6
| | | | | | | | | The biggest optimization here is "updateAncestorFlags()". It's much faster to update all the flags rather than trying to enable/disable certain flags according to the current state. Task-number: QTBUG-6877 Reviewed-by: alexis
* Improved performance of translating device coordinate graphics effects.Samuel Rødal2010-01-131-0/+1
| | | | | | | | Don't invalidate the cache if we're only translating and the effect rect is fully contained within the device rect of the painter. Task-number: QTBUG-6901 Reviewed-by: Bjørn Erik Nilsen
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* Fix redraw bugs when using graphics effects in device coordinate mode.Samuel Rødal2009-12-101-0/+2
| | | | | | | | | | QGraphicsEffect::boundingRectFor() needs the source bounding rect in device coordinates. This patch fixes the documentation to reflect this, and fixes some internal usage of boundingRectFor() to ensure it always gets the device rect of the source. Task-number: QTBUG-5918 Reviewed-by: Bjørn Erik Nilsen
* Fixed memory leaks when removing a QGraphicsEffect from a QGraphicsItem or ↵Yoann Lopes2009-12-071-1/+4
| | | | | | | | | | | | | | QWidget with setGraphicsEffect(0). The effect was not deleted in that case, problem solved for both QGraphicsItem and QWidget. Autotest included. Task-number: QTBUG-5917 Reviewed-by: bnilsen
* Remove unused variables in QGraphicsItem and QGraphicsScene.Bjørn Erik Nilsen2009-11-251-1/+1
| | | | | maybeDirtyClipPath and ingoreClipping is not relevant anymore now that the cached clip path is removed.
* Remove caching of QGraphicsItem::clipPath().Bjørn Erik Nilsen2009-11-251-31/+1
| | | | | | | | | The cache was added in 4.5 and was useful at that time. With 4.6 it is not relevant anymore since the only use case for it is item-lookup releated to mouse events and collision detection, so the overhead of maintaining the cache is more pain than gain. All existing auto tests pass.
* Improvements to graphics effects API after review round.Samuel Rødal2009-11-101-1/+1
| | | | | | | | | | | | * Get rid of QGraphicsEffectSource from the public API, instead add convenience functions in QGraphicsEffect. This way we commit to less API, and are free to introduce a customizable QGraphicsEffectSource in a future release. * Move PixmapPadMode into QGraphicsEffect and tweak the names of the enum values. * Make QGraphicsBlurEffect::BlurHint into a bit flag, for extensibility. Reviewed-by: Bjørn Erik Nilsen