summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem
Commit message (Collapse)AuthorAgeFilesLines
* Fix subfocus when reparenting panels.Andreas Aardal Hanssen2010-07-081-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When reparenting an item into another, QGraphicsItem will fix the subfocus chain by first removing subfocus from the previous ancestors, and then optionally restoring the subfocus chain to the new ancestors of the reparented item. This allows item trees to be created and assigned a specific focus item before even added to a scene. The QGraphicsItemPrivate::setSubFocus function did not take into account that the root item might be in a different panel than the reparented item, which is the case when reparenting one panel into another. If so, setSubFocus must not mess up the new ancestor panel's sub focus chain. Otherwise (former behavior), the new ancestor panel's focusItem will point to the reparented panel's focus item. This in turn breaks an invariant; one panel's focusItem can never point to an item in another panel. The bundled test case shows this point: Create two panels that each have one child that sets focus. The first panel is added to the scene just to prepare, and verify that it's activated as expected, and its focus child immediately gains input focus. Then we create a second panel, which also has a focus child (but it doesn't have focus as its panel is not active). When we reparent the new panel onto the old one, we expect the new panel to be activated, and the child focus item to gain input focus. However, we also expect the parent panel's focus item to remain intact, so that when we hide the child panel, and the parent panel is reactivated, its original focus item regains focus. Former behavior was that the parent's focus item still pointed to the child panel focus item. This change only has effect when reparenting to or from a panel. Merge-request: 735 Reviewed-by: Yoann Lopes <yoann.lopes@nokia.com>
* Add a new (internal) flag QGraphicsItem::ItemStopsClickFocusPropagation.Bjørn Erik Nilsen2010-06-241-0/+54
| | | | | | | | | | | | | 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
* tst_qgraphicsitem: stabilize on X11Olivier Goffart2010-06-031-0/+1
|
* Wrong QGraphicsItem::childrenBoundingRect() when applying effects.Bjørn Erik Nilsen2010-05-271-0/+29
| | | | | | | | | Problem was that we used the children's raw bounding rect instead of using their effective bounding rect when calculating the bounds. Auto test included. Task-number: QTBUG-10756
* Fixes QGraphicsItem::scroll issuesBjørn Erik Nilsen2010-05-211-1/+84
| | | | | | | | | | | | | | | | | | | | The biggest and most important issue was that QGraphicsItem::scroll always accelerated the scroll without taking overlapping items or opacity into account, which caused drawing artifacts. We can only do accelerated scrolling if the item is opaque and not overlapped by other items. There's no (sane) way to detect whether an item is opaque or not (similar to Qt::WA_OpaquePaintEvent), which means we cannot support accelerated scrolling unless the item is cached into a pixmap (QGraphicsItem::setCacheMode). The second issue was that QStyleOptionGraphicsItem::exposedRect always contained the whole boundinRect() after an accelerated scroll (even with the QGraphicsItem::ItemUsesExtendedStyleOption flag enabled). Auto test included. Task-number: QTBUG-8378, QTBUG-7703 Reviewed-by: yoann
* Reset the dragDropItem to 0 when the item dies while dragging on top it.Alexis Menard2010-05-121-0/+24
| | | | | | | | If you drag something on top of an item and the former is deleted then we need to reset the dragDropItem pointer to 0. Task-number:KDE BUG 232182 Reviewed-by:leo
* QGraphicsView drawing artifacts due to rounding errors.Bjørn Erik Nilsen2010-05-031-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found during investigation of QTBUG-8820, and clearly visible in examples/graphicsview/diagramscene when slowly moving an item out of the viewport (left and top edge). Caused by two problems: 1) Using QRectF::toRect() instead of QRectF::toAlignedRect(). 2) Didn't adjust the item's bounding rect properly in drawSubtree(). QRectF::toRect() is completely useless since all the coordinates are rounded to the nearest integer. E.g. QRectF(-0.4, -0.4, 10.4, 10.4).toRect() -> QRect(0, 0, 10, 10), whereas toAlignedRect() returns QRect(-1, -1, 11, 11). Then when we have a proper aligned rect, we have to adjust it by 2 pixels in all directions (or 1 pixel in case of QGraphicsView::DontAdjustForAntialiasing). At first glance this adjustment seems too much, since one would assume adjusing the QRectF by 0.5 before using toAlignedRect() would be sufficient. That's sufficient in an untransformed world with pens using BevelJoin. However, the story is completely different as soon as the world is transformed or the pens use a different join. It's basically complicated (in some cases impossible) to calculate a pixel perfect aligned QRect, so instead we adjust by the amount of pixels required in the worst case. This commit also includes some optimizations for QRegion updates (since I anyways had to change the code). There's no point in using QRegion granularity if the viewport update mode is either FullViewportUpdate or BoundingRectViewportUpdate. Auto tests adjusted and new ones included. Task-number: QTBUG-10338
* Fix update issue when an item has an effect and child.Alexis Menard2010-04-271-0/+47
| | | | | | | | | | | | | | 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
* Fix QDeclarativeTextInput and QGraphicsView in regards of input methods hints.Alexis Menard2010-04-271-2/+50
| | | | | | | | | | | | | | | | | | When the echoMode changes for QDeclarativeTextInput we need to update the inputmethod hints. Also in QGraphicsView we need to update the input context installed on the view to make the former is aware of the change. For the input context framework the only way to deal with the current widget is focusWidget(). Unfortunately the widget that has the focus is the QGraphicsView so the input context don't know the real object QGraphicsView is actually focusing. We must keep in sync the inputMethodHints of QGV with the object QGraphicsView is focusing so the input context just called focusWidget()->inputMethodhints() to update itself. Task-number:QTBUG-9922 Reviewed-by:janarve Reviewed-by:bnilsen Reviewed-by:Michael Brasser
* Fixes keyboard shortcuts for QGraphicsTextItem.Yoann Lopes2010-04-201-0/+38
| | | | | | | | The event ShortcutOverride was not handled by QGraphicsTextItem. Autotest included. Task-number: QTBUG-7333 Reviewed-by: bnilsen
* Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-04-091-13/+10
|\ | | | | | | | | Conflicts: src/multimedia/audio/qaudioinput_win32_p.h
| * 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
| * \ 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
| * | | Remove qWait functions as it is used in QTRY_* macros.Toby Tomkins2010-04-011-327/+182
| | | | | | | | | | | | | | | | Reviewed-by: rohan mcgovern
* | | | Skip tst_QGraphicsItem::updateMicroFocus test on Windows and Mac as it does ↵Olivier Goffart2010-04-011-0/+4
| | | | | | | | | | | | | | | | not passes
* | | | Attempt to fix the test.Alexis Menard2010-03-311-2/+2
| | | | | | | | | | | | | | | | Reviewed-by:TrustMe
* | | | Add a QGraphicsItem::updateMicroFocus() to QGraphicsItem.Alexis Menard2010-03-311-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QGraphicsItem is no more lacking a way to notify the input method of a changed micro focus. Reviewed-by:denis Reviewed-by:simon hausmann
* | | | Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7David Boddie2010-03-302-2/+94
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/modules.qdoc mkspecs/common/symbian/symbian.conf src/gui/graphicsview/qgraphicswidget.h src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtGuiu.def
| * | | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-03-301-1/+80
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (47 commits) QScript: More missing APIShim QScriptEngine: Fix reentrency involving creation and desctructions of QScriptEngines Work-around Symbian 10.1's broken egl.h Add some #warnings to debug Symbian EGL build failure Don't detect EGLImage presence by testing function pointers Implement proper QStaticText support in QPaintBuffer Make QStaticText layout lazy Change QStaticText::setMaximumSize() to setTextWidth() Respect QPainter::pen() in QPainter::drawStaticText() QVarLenghtArray: add some API to be consistant to QVector Don't try to resolve EGLImage function pointers if they are defined Change ORs to ANDs when checking EGLImage extension defines Protect EGLImage function definitions in #ifdef Fix a bug in greek shaping causing infinite loops Define QT_NO_EGL in configure.exe improve mingw 64 bit support Fix build on Windows Round instead of ceil font metrics when ForceIntegerMetrics is enabled cetest: remove source file duplicates from cetest.pro Remove EGLImage create/destroy resolving from VG pixmap data ...
| | * | | itemChange() is now called when transformation properties change.Yoann Lopes2010-03-251-1/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When changing transformation properties (i.e., setRotation(), setScale(), setTransformOriginPoint()), itemChange() is now called to allow notification and change of the values. The flag ItemSendsGeometryChanges needs to be set to enable this. Autotest included. Task-number: QTBUG-8112 Reviewed-by: alexis
| * | | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.7Alexis Menard2010-03-251-0/+34
| |\ \ \ \ | | |/ / / | |/| | / | | | |/ | | |/| | | | | | | | | Conflicts: mkspecs/common/symbian/symbian.conf qmake/generators/symbian/symmake.cpp src/3rdparty/webkit/WebCore/WebCore.pro
| * | | Fix QGraphicsEffect cache when the item is not visible by the view.Alexis Menard2010-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't rely on the exposed rect since the item can be outside the view so we need to regenerate the complete pixmap. Task-number:QTBUG-8750 Reviewed-by:sroedal
| * | | Calling setX and setY should send itemSendGeometry/ScenePositionChanged eventsAlexis Menard2010-03-231-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SetX and setY were calling setPosHelper directly therefore events for itemSendGeometryChange and itemSendScenePositionChange were not sent properly. Task-number:QTBUG-9093 Reviewed-by:janarve
| * | | Display the itemSendScenePositionChange properly when debugging.Alexis Menard2010-03-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Also a harmless test added to check that the flag is actually set. Reviewed-by:TrustMe
| * | | Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Rohan McGovern2010-03-061-0/+68
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Revert "Fixes crash when destroying a QGraphicsItem."Yoann Lopes2010-03-031-57/+0
| | | | | | | | | | | | | | | | | | | | | | | | The patch was wrong. The new one is pushed into 4.6. The old one is reverted to avoid merge conflicts. This reverts commit a7ef2d899d711d750238a8d69284da808188b407.
| * | | Fixes crash when destroying a QGraphicsItem.Yoann Lopes2010-02-171-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When clearing the focus on an item, the focus was previously passed to the closest parent focus scope (if any). But the focus should go to the closest parent focus scope only if the item being cleared of the focus is itself a focus scope. This incorrect behavior leaded to invalid pointers in QGraphicsItem under specific circumstances, eventually leading to a crash when destroying the item. Auto-test included. Task-number: QT-2649 Reviewed-by: Andreas Aardal Hanssen
| * | | Merge remote branch 'origin/4.6' into qt-master-from-4.6Thiago Macieira2010-02-121-0/+2
| |\ \ \
| * \ \ \ Merge remote branch 'qt/4.6' into qt-master-from-4.6Qt Continuous Integration System2010-02-091-52/+97
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qcocoapanel_mac.mm src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
| * \ \ \ \ Merge remote branch 'qt/4.6' into qt-master-from-4.6Qt Continuous Integration System2010-02-011-0/+86
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qeventdispatcher_mac.mm src/gui/kernel/qt_cocoa_helpers_mac.mm src/gui/widgets/qmenu_mac.mm tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp tools/assistant/tools/assistant/centralwidget.cpp tools/linguist/lupdate/main.cpp
| * | | | | | Removing unused image from git in qgraphicsitem autotestLeonardo Sobral Cunha2010-01-201-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: trustme
* | | | | | | 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
* | | | | | 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
* | | | | 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