summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem
Commit message (Collapse)AuthorAgeFilesLines
* Merge QGV delta from kinetic-declarativeui into master.Andreas Aardal Hanssen2009-08-171-0/+26
| | | | | | | | | | | | New flag: QGraphicsItem::ItemNegativeZStacksBehindParent, which makes it easy to toggle stack-behind based on the value of Z alone. Add interface initializations to QGV classes. Add a simple internal focus policy to QGraphicsItem to allow derived items to be focusable without allowing clickfocus. Reviewed-by: Alexis
* Fix focus proxy deletion bugs/crashes in QGraphicsItem.Andreas Aardal Hanssen2009-08-131-0/+42
| | | | | | | | | | | | | | | | | | | This change would have been much simpler if either QGraphicsItem inherited QObject, or if we had some similar QPointer-like class that supported QGraphicsItem. The issue is this: Each item can delegate another item to be its focus proxy. That item can be a parent or child, or something completely unrelated. Either of the two items can be deleted independently. The former solution was to store backpointers in a map in the scene. Problem is, the items may not be in a scene when this happens, they may be removed from the scene, and the items may be moved between two scenes. The bad part about this fix is that it adds another pointer to QGraphicsItemPrivate. Reviewed-by: Shane Kearns <shane.kearns@sosco.com>
* Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | Reviewed-by: Trust Me
* Merge branch '4.5'Bill King2009-08-051-0/+16
|\ | | | | | | | | | | Conflicts: src/gui/graphicsview/qgraphicsitem.cpp
| * Fix ancestor flags that are not correctly update when reparenting.Alexis Menard2009-08-041-0/+16
| | | | | | | | | | | | | | | | | | updateAncestorFlags was not reseting the flags if you change the parent that have for instance itemsClipChildrenToShape to a new one that doesn't have that flag. Task-number:258956 Reviewed-by:bnilsen
* | Added input hints to QGraphicsItem.jasplin2009-08-041-0/+13
| | | | | | | | | | | | | | | | | | This patch allows for input hints to be set on a QGraphicsItem. Input methods use such hints to define its appearance/behavior (e.g. to allow for numerical input only). Reviewed-by: ahanssen Task-number: 254493
* | Implement new transformation handling for graphics items.Lars Knoll2009-07-291-121/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of having separate rotationX/Y/Z, shearX/Y, etc. methods in QGraphicsItem turned out to be not giving us the flexibility we need and wanted. The new code now implements a different scheme, where we keep simple rotate (around z-axis), scale and transformOriginPoint methods, but remove the other ones. Instead we now have an additional list of QGraphicsTransform object. QGraphicsTransform is an abstract class that inherits QObject. Several specializations are provided and can be used to transform (and through property bindings animate) the item. Reviewed-By: Andreas
* | Add QGraphicsItem::ItemAutoDetectsFocusProxy and improve subfocus support.Andreas Aardal Hanssen2009-07-271-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you set this flag on an item, and descendant item that gains input focus will become this item's focus proxy. This simplifies how focus proxy items are assigned from QML; instead of binding the possible focusProxy property to a named child widget, this assignment happens automatically as you set the focus property of a descendant to true. As part of this change, QGraphicsWidget::focusWidget behavior has been improved and moved into QGraphicsItem. For example, if you set focus on an item that it's part of a scene, it can gain focus once the parent has been assigned (which is how object trees are built in QML). Autotests are included. Reviewed-by: Michael Brasser
* | Add QGraphicsItem::focusProxy(), focus proxy support.Andreas Aardal Hanssen2009-07-231-0/+120
| | | | | | | | | | | | | | | | | | Following QWidget's behavior, you can not assign any item in the same scene as a focus proxy for another item. Also supports nested focus proxies. You can only assign items in the same scene as focus proxies. Autotests are included. Reviewed-By: mbm
* | Make Graphics View auto-tests less dependant on WS.Bjørn Erik Nilsen2009-07-151-8/+19
| | | | | | | | | | | | | | Several auto-tests failed on the Mac because the view get two paint events on the first show. This is a bug in QWidget, but shouldn't make graphics view auto-tests fail. Also, there's no difference between update() and repaint() on the Mac.
* | Add auto-tests for QGraphicsItem::filtersChildEvents.Marius Bugge Monsen2009-07-141-0/+123
| |
* | Fix broken tst_QGraphicsItem::sorting.Bjoern Erik Nilsen2009-07-131-1/+2
| | | | | | | | | | A top-level window on Windows cannot have a smaller width than 120. Increase the width by 20 and expect another row of items to be painted.
* | QGraphicsItem not updated properly when moving parent.Bjørn Erik Nilsen2009-07-101-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | Found during manual testing (manualtests/graphicsview/movableitems). Moving a child item (via its parent) outside the viewport, and then back again didn't trigger an update on the child. Reason was that we had a cut-off checking the wrong bit (geometryChanged). This bit means exactly the same as the paintedViewBoundingRectsNeedRepaint bit, except that it doesn't propagate to the children (and that's the bug). We use paintedViewBoundingRectsNeedRepaint instead. Auto-test included.
* | Fixes broken item-lookup for untransformable items.Bjørn Erik Nilsen2009-07-101-0/+51
| | | | | | | | | | | | | | | | | | | | Found during manual testing (manualtests/graphicsview/untransformable). At some point it was not possible to click on an untransformable item. The problem was that none of the untransformable items were top-levels, and none of the transformable top-level items were in the same area, resulting in an empty list of estimated top-level items. Auto-test included.
* | Painting artifacts when moving an item with partial updates.Bjørn Erik Nilsen2009-07-101-0/+47
| | | | | | | | | | | | | | | | | | | | Found during manual testing (dndrobotinproxy). The problem was that the paintedViewBoundingRect was set to an empty rect because the partial update area didn't intersect with the viewport. The item itself was partially inside the viewport. Then, when the item was moved, its old area was not repainted due to this empty paintedViewBoundingRect. Auto-test included.
* | Rendering artifacts when hiding a QGraphicsItem.Bjørn Erik Nilsen2009-07-091-0/+11
| | | | | | | | | | | | | | | | | | | | The problem was that update() followed by hide() didn't work as expected because the update() caused all sub-sequent update requests to be discareded. This is correct, however, we have to make sure the ignoreVisible/ignoreOpacity bit is set properly; we won't process a hidden item otherwise. Auto-test included.
* | Fix a regression with extended style option items.Alexis Menard2009-07-011-0/+4
| | | | | | | | | | | | | | | | | | We basically passed an unitialized transform to construct the styleoptions for items that use the useExtendedStyleOption flag. We had an auto-test to cover that but for some reason view.show() was removed by me so the auto-test did nothing. oops. Reviewed-by:bnilsen
* | Merge branch '4.5' of scm.dev.nokia.troll.no:qt/qtSimon Hausmann2009-06-231-0/+11
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebKit/qt/ChangeLog tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
| * Add new auto-test QGraphicsItem::childrenBoundingRect2().Bjørn Erik Nilsen2009-06-231-0/+11
| | | | | | | | Reviewed-by: Andreas
* | Compile fix on HP-UXAndreas Aardal Hanssen2009-06-171-1/+1
| | | | | | | | Explicit casts make aCC happy.
* | Fix QGraphicsItem::ItemHasNoContents rendering of children.Andreas Aardal Hanssen2009-06-171-0/+27
| | | | | | | | | | | | | | The ItemHasNoContents flag was preventing items that clip their children from rendering their children at all. Fixed now. Reviewed-by: bnilsen
* | Merge license header changes from 4.5Volker Hilsheimer2009-06-161-2/+2
|\ \ | |/
| * Update license headers as requested by the marketing department.Jason McDonald2009-06-161-2/+2
| | | | | | | | Reviewed-by: Trust Me
* | Merge commit 'origin/4.5'Bjørn Erik Nilsen2009-06-121-0/+49
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp src/gui/graphicsview/qgraphicsitem.cpp tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp tools/linguist/shared/cpp.cpp translations/linguist_ja.qm translations/qt_ru.qm
| * QGraphicsItem::setOpacity(0.0) does not trigger an update of child itemsLeonardo Sobral Cunha2009-06-121-1/+50
| | | | | | | | | | | | | | | | Forwarding the ignoreOpacity flag to children in QGraphicsItemPrivate::fullUpdateHelper. This is a complementary fix to task 252913, partly fixed in commit 2e3a5ea44... Reviewed-by: bnilsen BT: yes
* | Fix sorting bug when using BSP tree index + add autotest.Andreas Aardal Hanssen2009-06-091-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use stable sorting to keep insertion order. This works fine as long as we sort a complete list of siblings in one go, and this list already has items in insertion order. But if we shuffle such a list, the only way to get proper sort order again (with insertion order intact), is if each item has a sibling index. We used to have this, but we don't have it anymore (as it's not needed for NoIndex mode). So until we separate the BSP index into a separate class and add this index there, we add this workaround which uses the toplevelitems list to ensure the items have the correct order. Reviewed-by: bnilsen
* | Ensure we use the correct static paintedItems list.Andreas Aardal Hanssen2009-06-091-6/+6
| | | | | | | | | | Fixes the zValue autotest, which regressed when the member list was added.
* | Revert 7aee2a7054d1ca280f6dfc9c46b3fe2ce403ccb3, fix render bugs.Andreas Aardal Hanssen2009-06-091-10/+62
| | | | | | | | | | | | | | | | | | | | This change introduced an unexpected interdependency for scenes with items that enable ItemStacksBehindParent, and that contain children that are transformed. There's a manual test for this, called clippingAndTransformations, which shows this problem. The bug has been fixed and this change also includes an autotest that covers exactly this problem.
* | Add ItemSendsGeometryChanges, replacing itemChangeEnabled().Andreas Aardal Hanssen2009-06-091-3/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | This flag toggles whether we should send notifications for setPos, setMatrix, and setTransform. It's off by default. Docs have been updated. All autotests pass. This change also cleans up a bit so that we both have readable code, and keeping the optimized path for when we need to send the notifications. By enabling this flag by default we are going to trigger regressions in end-user code. Reviewed-by: bnilsen
* | Auto-test to ensure moved items don't leave traces.Bjørn Erik Nilsen2009-06-091-0/+78
| | | | | | | | See also: 1c9032f29d4500b33622d7510b6361c99d9af296
* | Add another auto-test ensuring updates outside the brect are discared.Bjørn Erik Nilsen2009-06-091-0/+8
| |
* | Fix two regressions in Plasma. The painter state proctection was notAlexis Menard2009-06-091-0/+53
| | | | | | | | | | | | | | | | | | | | properly pass to drawItemHelper. The second is a double conversion to deviceTransform in createStyleOption of QGraphicsItem. Since the recursive drawing already give a transform in device mode we don't need to convert it two times. Reviewed-by:andreas
* | Add (back) properties to QGraphicsItem to change the transformations componentOlivier Goffart2009-06-091-0/+199
| | | | | | | | | | | | | | | | | | | | | | | | This reapply commit 8ad5020940f10d4ecc5c5e8b3b9656531cb84ef3 and its dependent change that has been reverted while rebasing the recursivepaint branch. With the new properties it is possible to easily animate transformations Reviewed-by: Andreas Documentation still need to be reviewed.
* | A partial QGraphicsItem update causes a full update to be discarded.Bjørn Erik Nilsen2009-06-091-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | E.g. item->update(QRectF(0, 0, 5, 5)); item->update(); The problem was that we discarded all update requests whenever the item was already marked as dirty. The dirty bit only means it has pending updates (which might be a full update). However, we have a separate bit for full updates (fullUpdatePending) so we have to check against that bit instead. Makes tst_QGraphicsProxyWidget::paintEvent happy. Another auto-test included.
* | QGraphicsItem discard updates when it shouldn't.Bjørn Erik Nilsen2009-06-091-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Once a _q_processDirtyItems call is queued, it means we at least have one item that is marked as dirty and we must reset it when the _q_processDirtyItems slot is called. The problem however, was that we didn't reset the item's dirty state if a full scene update occurred in between, i.e. item->update(); scene.update(); We don't have to calculate the item's dirty rect if a full scene update occurs in between, but we still have to reset its state. Auto-test included.
* | Ensure this test goes via QGraphicsScene::drawItems().Andreas Aardal Hanssen2009-06-091-0/+1
| | | | | | | | | | Enable QGraphicsView::IndirectPainting to make sure it detects which items are drawn.
* | Remove leftover code from merge conflict.Andreas Aardal Hanssen2009-06-091-126/+0
| |
* | Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qtSimon Hausmann2009-05-271-0/+36
|\ \ | |/ | | | | | | Conflicts: tests/auto/qtreeview/tst_qtreeview.cpp
| * Fixes for merge-request #407Leonardo Sobral Cunha2009-05-271-33/+37
| | | | | | | | Removed unused line and added task number to autotest.
| * Dont show children when parent is not visible in QGraphicsItemdiaulas2009-05-271-0/+32
| | | | | | | | | | | | | | | | | | When setVisible() is called on a QGraphicsItem, if the parent of that item was hidden, the child shouldn't be actually shown. Task-number: 197802 Reviewed-by: leo Reviewed-by: alexis
* | Fix the way the transform and the properties are marked as dirty in ↵Olivier Goffart2009-05-221-6/+44
| | | | | | | | | | | | QGraphicsItem Acknowledged-by: Thierry
* | Add properties to QGraphicsItem to change the transformations componentOlivier Goffart2009-05-221-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | With the new properties it is possible to easily animate. Setting a transform using setTransform is incompatible with thoses properties. Accessing thoses propeties if you set previously a transform will give you the default values. Acknowledged-by: Code made with Andreas. Documentation written with Thierry. This still need a more in depth code review and documentation review. But it is urgent to commit now because the Animation API integration depends on it.
* | Graphics View Optimization: Use a simple style option by default.Bjoern Erik Nilsen2009-05-151-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QStyleOptionGraphicsItem extends QStyleOption with three values: 1) matrix, 2) levelOfDetail, 3) exposedRect, and they all involve expensive QTranform operations when calculated. We pass style option(s) to drawItems() and paint(), but the extended values are usually not in use. We can therefore gain quite some nice speedup by making them opt-in with the QGraphicsItem::ItemUsesExtendedStyleOption flag. Additionally, QStyleOptionGraphicsItem::levelOfDetail has been obsoleted, and a new function QStyleOptionGraphicsItem:: levelOfDetailFromTransform(const QTransform &) has been added. Me and Andreas don't consider this change to be too controversial even though it changes the behavior. Auto tests still pass. Reviewed-by: Andreas
* | Merge branch '4.5'Thiago Macieira2009-05-141-0/+110
|\ \ | |/ | | | | | | Conflicts: tools/macdeployqt/shared/shared.cpp
| * Fix QGraphicsItem::deviceTransform() to also work with normal items.Andreas Aardal Hanssen2009-05-141-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QGraphicsItem::deviceTransform() returns the item-to-device transform, provided with the device-to-scene transform, and combining it with the item's scene transform. This function is meant to handle items that enable ItemIgnoresTransformations, but it happened to not work properly for items that _don't_ enable that flag. Unfortunately this bug is hard to work around for users from the outside, as it requires you to check if the item or any ancestor enables ItemIgnoresTransformations. The fix also removes unnecessary branchs inside QGV so that we use the same function for all items. Reviewed-by: bnilsen
* | Merge branch '4.5' of git@scm.dev.troll.no:qt/qtSimon Hausmann2009-05-061-2/+87
|\ \ | |/ | | | | | | | | Conflicts: src/gui/kernel/qcocoaview_mac_p.h src/gui/widgets/qmainwindow.cpp
| * QGraphicsItem::setOpacity(0.0) does not trigger an update.Bjoern Erik Nilsen2009-05-061-2/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that we discarded update requests for fully transparent items, which is correct, but we even did that when the update was issued from QGraphicsItem::setOpacity. We don't have to, and shouldn't, consider the opacity in that case. Whenever we reach the fullUpdateHelper call in setOpacity it means we have to do an update regardless of the current opacity (oldOpacity was not 0.0 if the currentOpacity is 0.0). Auto-test included. Task-number: 252913 Reviewed-by: Andreas
* | Fix bugs in QGraphicsItem::childrenBoundingRect()Andreas Aardal Hanssen2009-04-231-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | While working on layering in Graphics View I stumbled over this bug. The QGraphicsItem::childrenBoundingRect() function had an accumulating error caused by recursive adding of rectangles that individually were mapped to the local parent using QGraphicsItem::mapRectToParent() / QTransform::mapRect. This caused the brect to be way too large for items with children that are rotated (fex, alternating 45 and -45 degrees). The new version should be just as fast, but with no loss of precision. Reviewed-by: bnilsen
* | Merge branch '4.5'Rhys Weatherley2009-04-211-0/+77
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: src/gui/graphicsview/qgraphicsitem.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt.qdocconf
| * BT: Fix update regression for cached QGraphicsItem (Elastic Nodes stuck)Andreas Aardal Hanssen2009-04-211-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug in 4.5.0 where cached items that call update() after they have been moved or transformed failed to get a call to paint(), so the last cache image was used to draw. The easiest way to reproduce this bug is in the Elastic Nodes example. If you press, wait, then release, the nodes will consistently move to sunken state, then back to normal state. But if you click quickly while moving the mouse, the nodes will stay sunken. The bug was that the item was marked as dirty as a result of being moved, and when the mouse button was released, the node item's call to update() was discarded, as the item was "already dirty". The fix is to allow invalidation of the cache even if the item is marked as dirty. Reviewed-by: bnilsen