summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |
* | Fix focus scope bugs, verified against examples in kinetic-declarativeui.Andreas Aardal Hanssen2009-09-221-7/+7
| | | | | | | | | | | | | | 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-0/+32
|\ \ | |/ | | | | | | | | 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-0/+32
| | | | | | | | | | | | | | | | | | 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
| * Revert "Added autotest to demonstrate clipping path problem"Alexis Menard2009-09-171-32/+0
| | | | | | | | | | | | This reverts commit e7042dea2431b8f64574d4e97eb896285b328c8b. Alexis : This should never have been here. E-mail is invalid.
* | Small improvements to some autotests.Denis Dzyubenko2009-09-181-0/+1
| | | | | | | | | | | | | | This should improve qgraphicsview, qgraphicsitem and qtableview autotests on slow window managers on X11. Reviewed-by: trustme
* | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6Tom Cooksey2009-09-171-9/+10
|\ \ | | | | | | | | | | | | Conflicts: tests/auto/qtwidgets/tst_qtwidgets.cpp
| * | Stabilize tst_QGraphicsItem::hoverEventsGenerateRepaints.Bjørn Erik Nilsen2009-09-171-9/+7
| | | | | | | | | | | | | | | Make the test independent of window activation; we're only interested in the behavior for hover events.
| * | Stabilize tst_QGraphicsItem::cacheMode on the Mac.Bjørn Erik Nilsen2009-09-171-0/+3
| | | | | | | | | | | | | | | Problem was that the window got activated *after* the items were added to the scene, causing two repaints on the viewport.
| * | Merge branch '4.5' of scm.dev.nokia.troll.no:qt/qt into 4.6Simon Hausmann2009-09-171-0/+32
| |\ \ |/ / / | | _ | | | | | | Conflicts: tests/auto/qimagereader/tst_qimagereader.cpp tests/auto/qtwidgets/tst_qtwidgets.cpp
| * Added autotest to demonstrate clipping path problemandyc2009-09-151-0/+32
| |
| * Update license headers again.Jason McDonald2009-09-081-4/+4
| | | | | | | | Reviewed-by: Trust Me
* | Fix a bug in FocusScopes; ensure subFocus is set correctly.Andreas Aardal Hanssen2009-09-151-0/+16
| | | | | | | | | | | | | | | | The bug was triggered by setting focus on a parent scope (which then passes focus to the innermost scope). Subfocus was set up for the first scope, but not the inner scopes. Reviewed-by: TrustMe
* | Support for focus scopes: QGraphicsItem::ItemIsFocusScope.Andreas Aardal Hanssen2009-09-151-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This feature is essential for Declarative UI, but does not add much value for C++ developers. A FocusScope provides a stack of focused widgets, and it ensures that the topmost item on the stack has focus if any of the items in the stack gains focus. When the topmost loses focus, focus is passed to the "parent" focus scope, and so on. You can get almost the same behavior using panels (ItemIsPanel), except panels impose other behavior, like stopping clickfocus propagation, and stopping event propagation in general. In a QML world you would typically use FocusScope for controlling focus locally, and panels when you need to maintain separate focus stacks. Reviewed-by: akennedy
* | Remove this line; which no longer has any effect.Andreas Aardal Hanssen2009-09-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | This line was added to fix crashes when deleting items that had a subFocusItem pointing to a child that was already deleted. This bug was fixed by ebb1162f54a29baeccb71d1e283146892629518f. After this, subFocusItem is always 0 at this point. The original change was eb3d5a73148cd7206c6b3b6672ed47b44611f745. Reviewed-by: TrustMe
* | Fix auto-test in QGraphicsItem.Alexis Menard2009-09-151-4/+2
| |
* | Fix update issues in QGraphicsView.Alexis Menard2009-09-151-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug appeared only when calling collidingItems right after setPos. When calling setPos on a parent the sceneTransform is mark as dirty, so when we paint the parent and its children if the scene transform of the parent was dirty then we update all children sceneTransform. In our case here, collidingItems call ensureTransform on one of the children which go recursively to the top most dirty item and update the sceneTransform. The problem is that all sibling children are not mark their sceneTransform dirty so next paint will skip them (since the parent is not dirty anymore). Task-number:260711 Reviewed-by:bnilsen
* | Fix crash/bug in QGraphicsItem's subFocus handling.Andreas Aardal Hanssen2009-09-091-0/+11
| | | | | | | | | | | | | | | | Removes dangling subFocusItem pointers when changing focus after reparenting. This change also includes a mini-optimization when adding focusable items to an inactive scene. Reviewed-by: brad
* | Only active QGraphicsScenes can have active input focus.Andreas Aardal Hanssen2009-09-091-9/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change ensures that only active scenes can have active input focus items. If you try to set input focus on items that are in an inactive scene, these items will gain input focus only when the scene is activated. For scenes attached to a view, this change should only fix the bug that you could have a blinking line edit in a scene when the view is inactive, meaning you couldn't type into the line edit. For scenes that have no view, you now must activate the scene in order to give the items active input focus. This will affect those who use QGraphicsScene with custom key and focus handling. Reviewed-by: brad
* | Remove ItemAutoDetectsFocusProxy from QGraphicsItem.Andreas Aardal Hanssen2009-09-091-71/+0
| | | | | | | | | | | | | | | | | | | | | | | | This change partially reverts f68fed388dcdba6ab6dad3af4933bcd3aa123cf8, which was an attempt at getting FocusRealms working. Turns out this approach is wrong. The flag behaves badly when reparenting, and the feature conflicts with plain old setting focus. Discussed with Aaron; this change was already reverted in the kinetic-declarativeui branch. Reviewed-by: TrustMe
* | Make the QGraphicsViews more rebost regarding slow window managerOlivier Goffart2009-09-091-2/+6
| |
* | Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | | | | | Reviewed-by: Trust Me
* | Fix crashes when moving descendents during destruction.Andreas Aardal Hanssen2009-09-041-0/+60
| | | | | | | | | | | | | | | | | | | | | | This fix prevents crashes in QGraphicsItem caused by calls to pure virtual functions as an item tries to access its dying parent. This happens when an item is moved by an ancestor during this ancestor's destructor. Autotests included. Reviewed-by: bnilsen
* | Fixed once-in-a-while failing tst_QGraphicsItem::selected test.Gabriel de Dietrich2009-09-041-1/+1
| | | | | | | | | | | | Added event information in QTest::mouse* warning message. Reviewed-by: Olivier