summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem
Commit message (Collapse)AuthorAgeFilesLines
* Did not include updated repaint number for parent item in revert.Toby Tomkins2010-04-061-1/+1
|
* Partially revert "Remove qWait functions as it is used in QTRY_* macros."Toby Tomkins2010-04-011-172/+314
| | | | | | | | | | Needs investigation of autotest failures on QWS, osx, win platforms. This reverts commit 741b75b8e595a26944ba8fca8835463787b02676. Conflicts: tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
* Merge commit 'origin/4.6' into 4.6-multimediaToby Tomkins2010-04-011-6/+83
|\ | | | | | | | | Conflicts: tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
| * Reverts using composition mode when using DeviceCoordinateMode cache.Yoann Lopes2010-03-261-7/+11
| | | | | | | | | | | | | | | | | | | | Going back to always blitting the newly painted areas to the cache (and not blending it like before). To avoid painting artifacts when the item is rotated and when it uses DeviceCoordinateMode cache mode, the entire cache is always repainted in that case. Task-number: QTBUG-7863 Reviewed-by: trustme
| * Prevents a useless repaint with QGraphicsItem cache mode.Yoann Lopes2010-03-251-0/+73
| | | | | | | | | | | | | | | | | | No repaint is triggered anymore when setting the cache mode to DeviceCoordinateMode when already using that mode. Also added an autotest for checking repaints when setting cache modes. Task-number: QTBUG-9391 Reviewed-by: ahanssen
* | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-multimedia-staging ↵Toby Tomkins2010-04-011-0/+34
|\ \ | |/ | | | | into 4.6-multimedia
| * Fix a crash when reparenting an item in QGraphicsView.Alexis Menard2010-03-241-0/+34
| | | | | | | | | | | | | | | | | | | | Before calling addItem we need to invalidate the depth otherwise if someone call anything relating to sorting when itemChange is called (because of the scene change for instance) then qt_closestItemFirst for example can crash because of an invalid state. Task-number:QTBUG-6932 Reviewed-by:janarve
* | Remove qWait functions as it is used in QTRY_* macros.Toby Tomkins2010-04-011-327/+182
|/ | | | Reviewed-by: rohan mcgovern
* Properly fixes crash when destroying a QGraphicsItem.Yoann Lopes2010-03-031-0/+68
| | | | | | | | | | | 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
* QGraphicsItem: Do not crash at exit if there is static QGraphicsItem.Olivier Goffart2010-02-081-0/+2
| | | | | | | | | | The DataStore could have been destroyed before. Even if having static QGraphicsItem is not really supported, it is better not to crash Task-number: QTBUG-7629 Reviewed-by: bnilsen
* Fix QTBUG_7714_fullUpdateDiscardingOpacityUpdate2 autotest in qws-linuxLeonardo Sobral Cunha2010-02-011-0/+2
| | | | | The two views were displayed on top of each other, so some repaints were not triggered.
* Fixes missing update when setting opacity on an item that had opacity 0.0Leonardo Sobral Cunha2010-01-291-0/+39
| | | | | | | | | | | We need to set the paintedViewBoundingRectsNeedRepaint flag when an item becomes visible again because when the item has opacity 0.0 the paintedViewBoundingRects struct can get set as outside of viewport, so the next time the item is set to visible again we need to diregard this cached data (otherwise the item will not be updated). Task-number: QTBUG-7714 Reviewed-by: bnilsen
* Avoids missing opacity updates by not propagating the ignoreOpacity flagLeonardo Sobral Cunha2010-01-291-0/+40
| | | | | | | | | | | | | | When doing a full update of a parent item, by setting one of these flags, QGraphicsItem::ItemIgnoresTransformations | ItemClipsChildrenToShape | ItemIsSelectable, the child items that were transparent would not be shown when setting their respective opacity to 1.0 We just need to set the ignoreOpacity flag when setting opacity to 0.0. This avoids propagating this flag to the child items when it's not needed. Task-number: QT-2653 Reviewed-by: bnilsen
* Cleanup in graphicsitem autotestLeonardo Sobral Cunha2010-01-291-52/+16
| | | | | | Unified multiple class definitions for MyGraphicsView and cleaned whitespaces. Reviewed-by: bnilsen
* Fixes visibility update missing when doing setParentItem on graphicsitemLeonardo Sobral Cunha2010-01-261-0/+86
| | | | | | | | | | 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
* Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | Reviewed-by: Trust Me
* Stabilize testOlivier Goffart2009-12-141-0/+1
|
* Fixes Graphicsitem transformation problems when grouping/ungrouping.Yoann Lopes2009-12-111-0/+30
| | | | | | | | | | | New transformation properties added in 4.6, such as rotation or transformOriginPoint were not taken into account in addTogroup and removeFromGroup. Autotest and manual test included. Task-number: QTBUG-5071 Reviewed-by: bnilsen
* Fix redraw bugs when using graphics effects in device coordinate mode.Samuel Rødal2009-12-101-2/+7
| | | | | | | | | | 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-0/+16
| | | | | | | | | | | | | | 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
* QGraphicsTextItem::setDefaultTextColor check change before calling update()Olivier Goffart2009-11-261-6/+11
| | | | | | | Some applications call setDefaultTextColor in the paint event. Task-number: QTBUG-6242 Reviewed-by: Gabriel
* Fix S60 input method not showing up in editable QGraphicsTextItemsSimon Hausmann2009-11-131-0/+3
| | | | | | | | Correctly set the ItemAcceptsInputMethod flag in setTextInteractionFlags. Reviewed-by: Andreas Reviewed-by: axis Reviewed-by: Janne Koskinen
* QGraphicsTextItem: update when changing the color.Olivier Goffart2009-11-091-0/+58
| | | | | Task-number: QTBUG-5418 Reviewed-by: Gabriel
* Merge commit 'origin/4.6' into 4.6Olivier Goffart2009-11-041-14/+0
|\
| * Fixed tst_qgraphicsitem::hitTestGraphicsEffectItem, caching makesGunnar Sletta2009-11-031-14/+0
| | | | | | | | | | | | testcase invalid... Reviewed-by: Samuel
* | Introduced QGraphicsItem::ItemSendsScenePositionChanges andJ-P Nurmi2009-11-031-0/+74
|/ | | | | | | QGraphicsItem::ItemScenePositionHasChanged Merge-Request: 1945 Reviewed-By: Andreas
* Merge commit 'widget/4.6' into origin/4.6Olivier Goffart2009-10-301-35/+142
|\ | | | | | | | | Conflicts: src/gui/effects/qgraphicseffect.cpp
| * Stabilize testsOlivier Goffart2009-10-291-1/+1
| |
| * Fix initial focus bug in ItemIsFocusScope.Andreas Aardal Hanssen2009-10-281-7/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix buglet in QGraphicsItem::stackBefore().Andreas Aardal Hanssen2009-10-261-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * QGraphicsLineItem leave traces when moving around (reg. against 4.5)Bjørn Erik Nilsen2009-10-231-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that QGraphicsLineItem's bounding rect is an empty rect (either width is 0 or height is 0), and when updating the item's old occupied area, we explicitly checked whether the rect was empty() or not. In case of being empty (rect.isEmpty()) we did nothing, which was the root of the problem. We can safely remove the rect.isEmpty() check without any significant loss of performance since the common case is that the rect is non-empty. And in the case of being empty, we'll bail out from QGraphicsViewPrivate::updateRect's highly optimized rect intersection. Auto test included. Task: QTBUG-4877 Reviewed-by: alexis
* | Adapt testcase to updates in QGraphicsPixmapItemGunnar Sletta2009-10-281-2/+2
|/ | | | Reviewed-by: TrustMe
* Moved private function to test which graphic items is in front of the otherLeonardo Sobral Cunha2009-10-201-0/+43
| | | | | | | 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
* Fix graphicsview test on Cocoa.Olivier Goffart2009-10-131-6/+14
| | | | | | | | | | Cocoa doesn't support regions update and always update the bounding rect (see comment in QWidgetPrivate::update_sys in qwidget_mac.cpp) Change tests that checked that we get the exact regions. Reviewed-by: MortenS
* QGraphicsView tests on X11Olivier Goffart2009-10-121-1/+1
|
* GraphicsView tests on macOlivier Goffart2009-10-121-1/+1
| | | | When a widget is shown we get two paint avent on Mac
* Stabilize tests on X11Olivier Goffart2009-10-061-3/+4
|
* Stabilize tests on X11Olivier Goffart2009-10-051-5/+3
|
* Fixed tst_qgraphicsitem.cpp compilation for Nokia X86 compiler.Janne Anttila2009-10-051-3/+3
| | | | | | | | | | | | Nokia X86 compiler is not able to resolve correct templated qCompare functionfor derived types. So implicit casting does nto work corectly. I have tried to add template specilations for qCompare also, but then compiler complainf about unambiguous functions. The promlem for now is fixed by adding explicit cast to same type against which the comparuion is done. Reviewed-by: TrustMe
* Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.6Alexis Menard2009-10-021-0/+41
|\ | | | | | | | | | | Conflicts: src/gui/graphicsview/qgraphicsscene.cpp src/gui/graphicsview/qgraphicsscene_p.h
| * Fix a bug when clipsChildrenToShape is set back to false.Alexis Menard2009-10-021-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | If you set the flag itemClipsChildrenToShape to true on a parent, an optimization was made in 4.5.0 to not add children of this parent in the index. But when you set the flag back to false all the sub-tree of the parent should be re-added to the index otherwise the index will never find all children. This code is not relevant for 4.6 since the index part of QGraphicsView has been refactored and handle this case with itemChange in QGraphicsSceneIndex. Reviewed-by:andreas
* | Stabilize tests on X11Olivier Goffart2009-10-021-1/+2
| |
* | Test stabilisation on X11Olivier Goffart2009-10-011-1/+1
| | | | | | | | | | | | for the Q3Table one, it sometimes fail with XPASS. There is no point trying to stabilize a failure on a test for a class we are not likely to touch anyway.
* | Add support for modality to QGraphicsItem panels.Bradley T. Hughes2009-10-011-4/+1013
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Stabilize more test on X11Olivier Goffart2009-09-301-5/+3
| | | | | | | | Each times the test are run, pulse show different failures.
* | Stabilize and speedup QGraphicsItem and QGraphicsView and ↵Olivier Goffart2009-09-301-189/+182
| | | | | | | | QGraphicsProxyWidget test
* | Merge branch '4.5' into 4.6Thiago Macieira2009-09-291-1/+30
|\ \ | |/ | | | | | | | | | | | | 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-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Stabilize more testOlivier Goffart2009-09-221-3/+3
| |