summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove caching of QGraphicsItem::clipPath().Bjørn Erik Nilsen2009-11-251-158/+7
| | | | | | | | | 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.
* Fixes painting issues when scaling a QGraphicsView.Yoann Lopes2009-11-201-1/+1
| | | | | | | | | The problem was that the 'exposed rectangle' passed to the Item's paint() function was rounded to Int values, whereas the one passed to drawBackground and drawForeground was not. Autotest included. Task-number: QTBUG-5859 Reviewed-by: bnilsen
* Fix S60 input method not showing up in editable QGraphicsTextItemsSimon Hausmann2009-11-131-2/+3
| | | | | | | | Correctly set the ItemAcceptsInputMethod flag in setTextInteractionFlags. Reviewed-by: Andreas Reviewed-by: axis Reviewed-by: Janne Koskinen
* Merge commit 'widget/4.6' into oslo-staging-2/4.6Olivier Goffart2009-11-111-0/+1
|\ | | | | | | | | Conflicts: src/gui/painting/qbrush.cpp
| * QGraphicsTextItem: update when changing the color.Olivier Goffart2009-11-091-0/+1
| | | | | | | | | | Task-number: QTBUG-5418 Reviewed-by: Gabriel
* | Improvements to graphics effects API after review round.Samuel Rødal2009-11-101-3/+3
|/ | | | | | | | | | | | * 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
* More inDestructor checks.Warwick Allison2009-11-091-0/+9
| | | | | | Declarative tripped these (crashes). Reviewed-by:Aaron Kennedy
* Merge commit 'origin/4.6' into 4.6Olivier Goffart2009-11-061-0/+17
|\ | | | | | | | | Conflicts: dist/changes-4.6.0
| * Fix QT_NO_GRAPHICSEFFECTJørgen Lind2009-11-061-0/+17
| | | | | | | | Reviewed-by: paul
* | QGraphicsView: Fixes QGraphicsView::focusItem when scene is not activeOlivier Goffart2009-11-061-1/+1
| | | | | | | | | | | | | | | | | | When scene is not active, returns the item that would get the focus if the scene became active. This is more consistant with Qt 4.5 behaviour Reviewed-by: Andreas
* | Merge commit 'origin/4.6' into 4.6Olivier Goffart2009-11-051-5/+18
|\ \ | |/
| * Merge commit '51c9b68' into 4.6Morten Johan Sørvig2009-11-041-5/+18
| |\ | | | | | | | | | | | | | | | Conflicts: dist/changes-4.6.0 src/gui/kernel/qevent.h
| | * Gesture api review.Denis Dzyubenko2009-11-031-3/+3
| | | | | | | | | | | | | | | | | | Changes to the gesture api after the review. Reviewed-by: Jasmin Blanchette
| | * Added QGraphicsObject::ungrabGesture()Denis Dzyubenko2009-11-031-2/+15
| | | | | | | | | | | | | | | | | | | | | Oops, apparently we forgot to add a function for unsubscribing a graphics object from a gesture. Fixing it now. Reviewed-by: trustme
* | | Provide hook that's called when items' stacking order is changed.Andreas Aardal Hanssen2009-11-041-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | This is required by the QtDeclarative module. As an isolated change, this is just a noop. It takes effect when somebody reimpements the private virtual function. Reviewed-by: Alan Alpert
* | | Merge commit 'origin/4.6' into 4.6Olivier Goffart2009-11-041-0/+2
|\ \ \ | |/ /
| * | Merge commit 'origin/4.6' into featureJørgen Lind2009-11-021-14/+61
| |\ \
| * | | Fix LIBRARY and ICONJørgen Lind2009-10-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | However, compiling with QT_NO_ICON will still not work :( Reviewed-by: tom
* | | | Introduced QGraphicsItem::ItemSendsScenePositionChanges andJ-P Nurmi2009-11-031-4/+59
| |/ / |/| | | | | | | | | | | | | | | | | QGraphicsItem::ItemScenePositionHasChanged Merge-Request: 1945 Reviewed-By: Andreas
* | | Merge commit 'widget/4.6' into origin/4.6Olivier Goffart2009-10-301-8/+35
|\ \ \ | |_|/ |/| | | | | | | | Conflicts: src/gui/effects/qgraphicseffect.cpp
| * | Merge commit origin/4.6 into team-widgets/4.6Olivier Goffart2009-10-291-2/+21
| |\ \ | | |/
| * | Fix initial focus bug in ItemIsFocusScope.Andreas Aardal Hanssen2009-10-281-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The task provides an example that doesn't gain input focus when started. The fix contains two parts: one is to allow items with focus scope ancestors to become focus items even if the scope is inactive. The other is to fix up the focusItem pointers on reparent. Before, the focus scopes' focusItem pointers always pointed to itself, or the next scope. Now these items are treated no differently than other items in that respect. The change has a performance impact when reparenting a large subtree that has a sub focus item onto another item (one more dig). Task-number: QT-2331 Reviewed-by: Alexis Menard
| * | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-widget-team into 4.6Jan-Arve Sæther2009-10-281-0/+2
| |\ \
| | * | Let QGraphicsItem set QObjectPrivate::wasDeleted when appropriate.Andreas Aardal Hanssen2009-10-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows children of QGraphicsObject-derived classes to check if the parent is being deleted by checking the private flag wasDeleted. Reverts 37b16d5cbb4e7bc534f690ebf50434d228b5ecfc, p4 change 9681, to allow QGraphicsItem to set QObjectPrivate's wasDeleted member before entering QObjectPrivate's destructor. The original code was in there to let the user know, via the console output, that QObject was double-deleted (e.g., when placing QObject on the stack, and also giving it a parent, so that if the parent is deleted first, bang). Reviewed-by: Aaron Kennedy Reviewed-by: Bradley T. Hughes
| * | | Merge branch 'fixes' of ↵Jan-Arve Sæther2009-10-281-8/+40
| |\ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | git://gitorious.org/~fleury/qt/fleury-openbossa-clone into openbossa-fleury-fixes3 Conflicts: src/gui/graphicsview/qgraphicsanchorlayout_p.cpp src/gui/graphicsview/qgraphicsanchorlayout_p.h
| * | | Fix buglet in QGraphicsItem::stackBefore().Andreas Aardal Hanssen2009-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Alan. The stackBefore() implementation did not alter the insertion order if the two items' current Z values were different. The fix is to ensure it is updated, so that the stackBefore() operation takes effect should the Z values become equal in the future. Example: Current order: A-B-C-D A->setZValue(1); Current order: B-C-D-A (A moves to the end) D->stackBefore(A); Current order: B-C-D-A (unchanged, D is already before A) A->setZValue(0); Current order: D-A-B-C (now A moves back, and D moves in front) Reviewed-by: Aaron Kennedy
* | | | Added some optimizations to the blur and drop shadow GL filters.Samuel Rødal2009-10-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use ExpandToTransparentBorderPadMode since we can use GL_CLAMP_TO_EDGE to clamp to the texture. * Shrink the bounding rects reported by the blur and drop shadow filters (expanding by 2 * radius isn't needed). * Use a single-pass blur for radii <= 3 to avoid the overhead of rendering to an FBO. * Made the fast blur setting generate filters for only a predefined set of radii, and then use the actual blur radius to spread the sample points outwards. * Optimized the generated program to rely less on temporary variables, as those seemed to not be handled very well by certain GLSL compilers. Reviewed-by: Gunnar Sletta
* | | | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-10-281-1/+1
|\ \ \ \ | | |_|/ | |/| |
| * | | Doc: Fixed qdoc warning.David Boddie2009-10-271-1/+1
| | | | | | | | | | | | | | | | Reviewed-by: Trust Me
* | | | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-10-271-2/+21
|\ \ \ \ | |/ / /
| * | | Doc: Fixed qdoc warnings.David Boddie2009-10-261-2/+21
| | |/ | |/| | | | | | | Reviewed-by: Trust Me
* | | Options on how to get a pixmap from an effect sourceGunnar Sletta2009-10-271-6/+25
|/ / | | | | | | | | | | Usable for future optimizations. Reviewed-by: Samuel
* | doc: Relationship of QGraphicsObject::parent && QObject::parentKai Koehne2009-10-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | QGraphicsObject::parent is actually about the QGraphicsItem hierarchy, not the QObject hierarchy. This is similar to QGraphicsWidget, where 'QObject::parent() should always return 0'. Maybe the explanation in QGraphicsWidget class documentation on this topic should be merged into QGraphicsObject, too? Reviewed-by: Andreas Aardal Hanssen
* | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Gunnar Sletta2009-10-231-1/+20
|\ \
| * | Added debug operator for QGraphicsObjectDenis Dzyubenko2009-10-221-0/+17
| |/ | | | | | | Reviewed-by: Alexis Menard
| * Moved private function to test which graphic items is in front of the otherLeonardo Sobral Cunha2009-10-201-1/+1
| | | | | | | | | | | | | | This function is moved to graphicsitem private because it is needed by multi-touch event handling and is not specific to bsptreeindex. Reviewed-by: bnilsen
| * Add some docs that explicitly mentions how we handle cycles in the treeJan-Arve Sæther2009-10-201-0/+2
| | | | | | | | | | | | | | | | This was reported for QGraphicsAnchorLayout, but affects all QGraphicsLayout subclasses. However, since it is not even handled properly in QGraphicsItem::setParentItem() it should be fine that we don't try to deal with this issue. Thus, the layouts are "consistent" with graphics items when it comes to detection of cycles in the tree.
* | Added caching of graphics effect source pixmaps to speed up effects.Samuel Rødal2009-10-221-6/+21
|/ | | | | | | If an effect is applied repeatedly on the same source, just with varying parameters, we can save a lot by caching the source pixmaps. Reviewed-by: Bjørn Erik Nilsen
* Doc: Gesture API documentation review.David Boddie2009-10-121-2/+1
| | | | Reviewed-by: Trust Me
* Added documentation for the Gesture API.Denis Dzyubenko2009-10-121-2/+9
| | | | Reviewed-by: trustme
* A new implementation of the Gesture API.Denis Dzyubenko2009-10-091-0/+9
| | | | | | | Implemented gestures using gesture events and separate QGesture/QGestureRecognizer classes. Reviewed-by: trustme
* Doc: add \since 4.6 to new QGraphicsItem::PanelModality enum.Volker Hilsheimer2009-10-031-0/+1
|
* Update documentation for sorting / stacking order in Graphics View.Andreas Aardal Hanssen2009-10-021-32/+63
| | | | | | | | | | Remove all references to "elevation" and how items are sorted by their "z order". Now use "stacking order" and only refer to "z-value" when discussing sibling order. Move almost all sorting docs from the QGraphicsItem::setZValue() function to a general overview section in QGraphicsItem's class documentation. Reviewed-by: David Boddie
* Add support for modality to QGraphicsItem panels.Bradley T. Hughes2009-10-011-13/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This add QGraphicsItem::setPanelModality(), panelModality(), isBlockedByModalPanel() and the QGraphicsItem::PanelModality enum (enumerators are either SceneModal, PanelModal, or NonModal, which mirror Qt::ApplicationModal, Qt::WindowModal, and Qt::NonModal). Reviewed-by: ahanssen Squashed commit of the following: commit a980a1b9c2972c676f3a70e8577d4eace54a25b3 Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Wed Sep 30 14:42:01 2009 +0200 Fix tst_QGraphicsItem::modality_hover() test failures As pointed out by Andreas, QGraphicsScenePrivate::dispatchHoverEvent() already has all the logic needed to correctly dispatch the hover events when changing modality. All we need to do is store the last known mouse position, and call dispatchHoverEvent() when entering, changing, and leaving the modal state. commit ba41633c96ece8da3a8bbf9c7491c15b14f83f76 Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Wed Sep 30 14:40:59 2009 +0200 Fix tst_QGraphicsItem::mixedModality() failure When changing modality from SceneModal to PanelModal, we may need to send WindowUnblocked events in addition to the WindowBlocked events. commit d1076e315de10b1b2fb7617ebaee552c14e49c8b Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Wed Sep 30 14:33:21 2009 +0200 Update the expected events counts in tst_QGraphicsItem::modality_hover() HoverEnter and HoverMove always come in pairs, and should do so when entering or leaving modality as well. This means though that changing modality can cause spurious HoverMove events (as seen in this test). commit a29b098e4c391651ef61dd4714a66b22654e4628 Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Wed Sep 30 14:20:25 2009 +0200 Update tst_QGraphicsItem::mixedModality() to do more detailed checking The test looks for unwanted WindowBlocked/WindowUnblocked events now, making it easier to spot where the failure comes from. commit c1ae96126ed01d0e662bddf38ff161e50a804b1c Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Tue Sep 29 12:17:17 2009 +0200 Documentation for QGraphicsItem::PanelModality Document the behavior of the QGraphicsItem::NonModal, PanelModal, and SceneModal enumerators. Corrected a qdoc error in the isBlockedByModalPanel() documentation commit 02fec999e660180ff65bbbf79c8085e582879ed1 Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Thu Sep 17 10:31:44 2009 +0200 Add bool QGraphicsItem::isBlockedByModalPanel() This function can be used to figure out 1) if an item is modally shadowed and 2) which panel is blocking the item in question. This will make it possible to implement window-manager like behavior of activating/highlighting/animating modal panels when the user tries to interact with a blocked item (this will most likely need to be done by reimplementing QGraphicsScene::event()). commit eab9a975dcd71b68135325d479374108bd7f3b2a Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Wed Sep 16 14:38:55 2009 +0200 Block key events to the focus item if it is blocked by a modal panel. We don't want the event to propagate either, just stop propagating once we reach an item that is blocked. commit 038b61a10bb837b353f988cb0d1665dd53656cdb Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Tue Sep 15 12:40:27 2009 +0200 Add a test for click-to-focus behavior in the presence of modality Clicking on a widget should neither give it focus nor set it as the sub-focus item. commit 3bb3662556efe8d76af5a56e65b1df7a9f4b476a Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Tue Sep 8 09:08:42 2009 +0200 Newly blocked QGraphicsItem panels should lose implicit grabs when modality is enabled. If an item has an implicit grab when blocked by a modal panel, this grab is lost and no mouse events are sent until the mouse is released and re- commit 3be51be3da36e782a5a1f282c552064d5d490a71 Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Thu Sep 3 13:39:14 2009 +0200 Support changing modality from PanelModal to SceneModal or vice-versa Don't leave modality first, and then re-enter... this sends unnecessary events. commit bb0aea559ba01a8bbb03c0370a247ab902f561f5 Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Wed Sep 2 16:58:23 2009 +0200 Fix hover event delivery in the presence of modal panels Panels that are modally shadowed should not get hover events. When entering and leaving the modal state, GraphicsSceneHoverEnter and GraphicsSceneHoverLeave event should be send to the widgets that become or are no longer blocked. Auto-test included. commit cad00b1d9da19565e2d7ea2d30d37eb45005b5ae Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Wed Sep 2 10:45:20 2009 +0200 Fix tst_QGraphicsItem::modality_hover() test Don't send hover events to items that are modally shadowed. commit ae15df331901110e19eb2037f37ff7f84cd7cd16 Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Wed Sep 2 10:44:14 2009 +0200 Enable the ItemIsPanel flag in the modality_hover() test Otherwise the modality settings are ignored. commit 1580f43c8feabc3a2bf9c1450e1a8916e8940a4c Author: Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> Date: Fri Aug 28 15:20:37 2009 +0200 More work on QGraphicsItem::PanelModality. Added many tests. commit ed2064ad2ec8bc06d62cf1e931b973d5d92c0563 Author: Bradley T. Hughes <bradley.hughes@nokia.com> Date: Thu Aug 27 13:45:11 2009 +0200 Add support for modality to QGraphicsItem panels. This add QGraphicsItem::setPanelModality() and the QGraphicsItem::PanelModality enum (enumerators are either SceneModal, PanelModal, or NonModal, which mirror Qt::ApplicationModal, Qt::WindowModal, and Qt::NonModal). Reviewed-by: ahanssen
* Merge branch '4.5' into 4.6Thiago Macieira2009-09-291-7/+4
|\ | | | | | | | | | | | | | | Conflicts: doc/src/platform-notes.qdoc src/3rdparty/webkit/WebKit/qt/Api/qwebpluginfactory.cpp src/gui/graphicsview/qgraphicsitem.cpp tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
| * QGraphicsItem: cached embedded widget item is not repainted when widget is ↵Andreas Aardal Hanssen2009-09-291-16/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | updated When calling QGraphicsItem::update() on a cached item, the cache is meant to be invalidated. In the reported bug, the user had a fixed scene rect set for his scene, and removing an item caused the entire scene to be updated (marked as "all needs to be updated"). In this case, calling update() on the cached item did not cause the item's cache to be invalidated. The item's new appearance didn't show up until the next invalidation, which was the same call to update(), but this time without a preceeding full scene update. The fix is to always invalidate the cache, regardless. But only schedule a repaint of the item in some cases (e.g., in this case the whole scene was marked for update, in which case it's unnessary for this one item to schedule a repaint of itself). It's worth noting that in 4.6, removing an item be delete does not cause the whole scene to be updated, and because of that this error was not exposed. It's there nevertheless. Reviewed-by: bnilsen
* | Add QGraphicsItem::stackBefore(), and fix Z ordering bugs.Andreas Aardal Hanssen2009-09-251-2/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we changed the sibling stacking order to be defined (4.5) instead of undefined (4.2, 4.3, 4.4), the need to control this stacking order arose. Before we could just say the order was random, but stable, and the only way people could rely on order was to set Z. Now, when the default order is defined as "insertion order", people start relying on this order, and incidentally they want more control. In QML, the need to have insertion order semantics is very evident as the order you define the elements in QML more strongly implies a graphical stacking order than the imperative order they get when added in C++. This change adds QGraphicsItem::stackBefore(const QGraphicsItem *), which works similarily to QWidget::stackUnder(). It moves the item in front of the sibling item passed as an argument. While implementing this function, and writing tests for how this function behaves in combination with Z values, I found that the code we had for updating siblingIndex was broken in the case where you remove an item from the middle of the children list. In this case newly added items would be assigned the same sibling index order as one that's already in the list. So in order to get the tests to pass I had to fix this bug as well.. The approach is to sort the children list by insertion order, so that we can fix up the sibling indexes. Performancewise this has little implications. If there are gaps in the sibling index list, which only occurs if you remove an item from the middle of the children list, will the sibling index list be adjusted / corrected before used (for example, by stackBehind()). Multiple calls to stackBehind will be fast, and the list is flagged for resorting (including Z order). Reviewed-by: jasplin
* | Fix focus scope bugs, verified against examples in kinetic-declarativeui.Andreas Aardal Hanssen2009-09-221-18/+16
| | | | | | | | | | | | | | The C++ autotests have been updated to match the expected behavior of the examples that broke (e.g., listview.qml) in kinetic-declarativeui. Reviewed-by: Alexis
* | Merge commit 'origin/4.5' into 4.6Andreas Aardal Hanssen2009-09-221-2/+4
|\ \ | |/ | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp tests/auto/windowsmobile/test/tst_windowsmobile.cpp
| * Cached clip path not cleared correctly for ancestor that clips to shapeAndrew Christian2009-09-221-2/+4
| | | | | | | | | | | | | | | | | | Fix QGraphicsItem to clear clip path for items with an ancestor that clips to shape. Added autotest to demonstrate clipping path problem. Merge-request: 810 Reviewed-by: Alexis Reviewed-by: Andreas