summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsview
Commit message (Collapse)AuthorAgeFilesLines
* Performance issue with QGraphicsItem::ItemClipsChildrenToShape.Bjørn Erik Nilsen2010-05-051-0/+57
| | | | | | | | | | | | | If the child rect is bigger than the parent rect and parent has the ItemClipsChildrenToShape flag set, then by updating the child, the whole child rect is marked as dirty, resulting in a much larger update area than required. This has a major impact on performance in Orbit/HB, where e.g. item-views typically consist of a container item that clips its children/items to shape. See attached video in QTBUG-9024. Auto test included. Task-number: QTBUG-9024
* QGraphicsView drawing artifacts due to rounding errors.Bjørn Erik Nilsen2010-05-031-15/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-05-011-2/+24
|\
| * Ensured that WA_InputMethodEnabled was set before FocusInEvent was sent.Jan-Arve Sæther2010-04-291-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When focusInEvent is called we need to ensure that WA_InputMethodEnabled is set, since FocusInEvent might lead to that QInputContext::setFocusWidget is called (with the QGraphicsView as the widget parameter). However, if the widget still does not have WA_InputMethodEnabled set yet it will assert in QInputContext::setFocusWidget (it requires that the widget has the flag set). This was a problem for the morbit bridge, where Dui requires the attribute to be set (while Orbit actually does not require) Task-number: QTBUG-10276 Reviewed-by: jasplin Reviewed-by: Alexis Menard
* | Fixes wrong QGraphicsView's viewport cursor reset.Yoann Lopes2010-04-211-0/+28
|/ | | | | | | | The cursor was reset even when it had not been previously saved. Autotest included. Task-number: QTBUG-7438 Reviewed-by: bnilsen
* Fixes wrong composition mode for cached backgrounds in Graphics View.Bjørn Erik Nilsen2010-03-031-0/+34
| | | | | | | | | | | This change partially reverts commit a589005f and therefore fully reverts 68be6457. We cannot assume that only opaque pixels are painted in drawBackground(). Regression against 4.5. Auto-test included. Task-number: QTBUG-8168 Reviewed-by: trond
* GV: Update issues if drawItems() is overridden and IndirectPainting is used.Bjørn Erik Nilsen2010-02-241-0/+26
| | | | | | | | | | | | | Problem was that the cached view bounding rect was never updated when overriding QGraphicsScene::drawItems or QGraphicsView::drawItems, without calling the base class implementation. The same for 'updateAll' boolean. We also have to make sure there are no unpolished items before we draw. Regression against 4.5. Auto-test included. Task-number: QTBUG-7880 Reviewed-by: yoann
* Update copyright year to 2010Jason McDonald2010-01-072-2/+2
| | | | Reviewed-by: Trust Me
* Fixes bug when using AnchorUnderMouse for GraphicsView transformation.Yoann Lopes2009-12-181-0/+97
| | | | | | | | | | | We now automatically enable mouse tracking on the viewport of the GraphicsView when setting AnchorUnderMouse as transformationAnchor or resizeAnchor. Autotest included. Task-number: QTBUG-6835 Reviewed-by: bnilsen
* Fixed qgraphicsview autotest build for winscw.Miikka Heikkinen2009-12-151-10/+10
| | | | | | | NokiaX86 compiler doesn't like QCOMPAREs unless the compared pointers are cast correctly. Reviewed-by: Janne Anttila
* Fixes painting issues when scaling a QGraphicsView.Yoann Lopes2009-11-201-0/+39
| | | | | | | | | 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 tst_QGraphicsView::inputMethodSensitivity autotestOlivier Goffart2009-11-171-0/+9
| | | | | | | | | The problem was that the scene was not notified it lost the focus when it was disconnected from the view (with setScene) So when it got back the focus, nothing was updated because the scene thought it still had the focus. Reviewed-by: jasplin
* Revert "Always set a clip on the painter in QGraphicsView."Andreas Aardal Hanssen2009-11-111-72/+0
| | | | | | | | | This reverts commit 4bf7f90a27377f439e86d6175e5e3cdebd131be0. The change is already reverted in kinetic-declarativeui. Reviewed-by: Warwick Allison Reviewed-by: bnilsen
* Always set a clip on the painter in QGraphicsView.Andreas Aardal Hanssen2009-11-051-0/+72
| | | | | | | | | | | | | | | | | | | | This allows items to check painter->clipRegion() to find out what the imposed clip is, in order to cull elements that don't need to be painted. This is an alternative approach to getting the same information from QStyleOptionGraphicsItem::exposedRect. It's better because it's a pull operation, but it's slightly worse because it doesn't include the complete system clip, and because QRegion has integer resolution only (whereas QGraphicsItem's coordinate uses qreal. A better approach may be to access QPainter's combined clip region; this option is open for future versions of Qt. Original patch by Warwick (which is why he's on reviewed-by), but the patch was modified to operate in device instead of logical coordinates. Reviewed-by: jasplin Reviewed-by: Warwick Allison
* Merge commit 'widget/4.6' into origin/4.6Olivier Goffart2009-10-301-0/+53
|\ | | | | | | | | Conflicts: src/gui/effects/qgraphicseffect.cpp
| * Stabilize tst_QGraphicsView::optimizationFlags_dontSavePainterState2Bjørn Erik Nilsen2009-10-281-2/+6
| | | | | | | | | | Make sure the view is painted, otherwise the transforms are identity and comparisons don't make sense.
| * Wrong worldTransform() on the painter in QGraphicsScene::drawForeground.Bjørn Erik Nilsen2009-10-231-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The painter's worldTransform() is updated for each item we draw, and when the DontSavePainterState optimization flag is set, this change is not protected by save() and restore(). After all the items are drawn, it means the painter is left with the last drawn item's transform. We therefore have to make sure it is reset back to whatever it was before the items were drawn. Auto-test included. Task-number: QTBUG-4973 Reviewed-by: alexis Reviewed-by: andreas
* | Change all valid Task-Tracker references to bugreports.qt.nokia.com reference.Warwick Allison2009-10-291-1/+1
|/
* Test fixes for Windows Mobile.ninerider2009-10-202-96/+120
| | | | | | | | Accounting for double resolution devices on Windows Mobile in the test data sets (tst_qgraphicsview_2.cpp). Skipped a test involving mouse tracking (tst_qgraphicsview.cpp). Reviewed-by: Joerg
* Fix graphicsview test on Cocoa.Olivier Goffart2009-10-131-1/+5
| | | | | | | | | | 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
|
* Fix GraphicsView test on macOlivier Goffart2009-10-121-1/+7
| | | | On mac, we always get full update.
* GraphicsView tests on macOlivier Goffart2009-10-121-2/+4
| | | | When a widget is shown we get two paint avent on Mac
* Merge commit 'origin/4.5' into 4.6Joerg Bornemann2009-10-061-0/+1
|\ | | | | | | | | Conflicts: tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
| * tst_QGraphicsView::task245469_itemsAtPointWithClip Windows mobile fixJoerg Bornemann2009-10-061-0/+1
| | | | | | | | | | | | | | | | We must make sure that the graphics view scene is centered to make this test work. On Windows mobile, the widget was too wide and the scene wasn't centered. Reviewed-by: thartman
* | Stabilize tests on X11Olivier Goffart2009-10-051-7/+5
| |
* | Stabilize graphicsview testOlivier Goffart2009-09-301-1/+3
| |
* | Stabilize and speedup QGraphicsItem and QGraphicsView and ↵Olivier Goffart2009-09-301-28/+36
| | | | | | | | QGraphicsProxyWidget test
* | Merge commit 'origin/4.5' into 4.6Andreas Aardal Hanssen2009-09-281-0/+47
|\| | | | | | | | | | | | | | | | | Reviewed-by: Joao Conflicts: src/gui/graphicsview/qgraphicsview.cpp src/gui/widgets/qspinbox.cpp tests/auto/qgraphicsview/tst_qgraphicsview.cpp
| * QGraphicsItem with parent flag ItemClipsChildrenToShape not visibleAndreas Aardal Hanssen2009-09-281-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regression against Qt 4.4. Children of items with ItemClipsChildrenToShape would only be discovered if the view's expose region contained the outer bounding rect of all items, _if_ there was at least one item in the scene that enabled ItemIgnoresTransformations. The reason for this bug is that the presence of an untransformable item causes the item lookups to go through a different path (QGraphicsViewPrivate::itemsInArea()). This function had the bug that it didn't correctly discover children of clip-items. Because of this, in the provided test case you could "work around" the bug by either removing the clip flag, or the transformation flag. Task-number: QTBUG-4151 Reviewed-by: Alexis
| * Update license headers again.Jason McDonald2009-09-082-8/+8
| | | | | | | | Reviewed-by: Trust Me
* | Stabilize GraphicsView and QFocusEvent testOlivier Goffart2009-09-251-33/+46
| |
* | Fix the compilation error for tst_qgraphicsview on S60.Liang QI2009-09-241-8/+24
| | | | | | | | | | | | static_cast from QGraphicsView* to QWidget*. Change QPlastiqueStyle to QWindowsStyle for some platforms like S60. Reviewed-by: Jason Barron
* | Stabilize more testOlivier Goffart2009-09-221-5/+8
| |
* | Small improvements to some autotests.Denis Dzyubenko2009-09-181-114/+45
| | | | | | | | | | | | | | This should improve qgraphicsview, qgraphicsitem and qtableview autotests on slow window managers on X11. Reviewed-by: trustme
* | Slightly better code for the test.Alexis Menard2009-09-151-5/+6
| | | | | | | | | | | | Then the test doesn't leak. Reviewed-by:ogoffart
* | Fix QGraphicsView::scrollAfterResize autotest on Mac.Alexis Menard2009-09-151-3/+6
| | | | | | | | | | | | | | | | | | The auto-test was failing because it calculate the scrollbar indent using style primitives. It's very fragile and doesn't work on MacOS style (and may not work on other style too). Since we don't test style stuff here, we can just apply the plastique style for this test. Reviewed-by:TrustMe
* | Stabilize Graphics View testsOlivier Goffart2009-09-101-5/+21
| | | | | | | | Reviewed-by: Jesper
* | Only active QGraphicsScenes can have active input focus.Andreas Aardal Hanssen2009-09-091-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | More robust graphicsview testOlivier Goffart2009-09-091-3/+1
| |
* | Make the QGraphicsViews more rebost regarding slow window managerOlivier Goffart2009-09-091-12/+23
| |
* | Update license headers again.Jason McDonald2009-09-092-8/+8
| | | | | | | | Reviewed-by: Trust Me
* | Added comment to QEXPECTED_FAIL. See commitGabriel de Dietrich2009-09-021-3/+3
| | | | | | | | | | | | 54226926faa44ec532efd0745e0ff64781202844 for more information. Reviewed-by: ogoffart
* | Fail in tst_QGraphicsView::task259503_scrollingArtifacts is expected. AddingGabriel de Dietrich2009-09-021-0/+1
| | | | | | | | | | | | | | QEXPECTED_FAIL. See commit 54226926faa44ec532efd0745e0ff64781202844 for more information. Reviewed-by: trustme
* | Merge branch '4.5' into 4.6Thiago Macieira2009-08-312-26/+26
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * Update tech preview license header.Jason McDonald2009-08-312-26/+26
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-112-2/+2
| | | | | | | | Reviewed-by: Trust Me
* | Merge branch '4.6'Thiago Macieira2009-08-271-0/+60
|\ \ | | | | | | | | | | | | Conflicts: src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
| * | Regression found in 4.5.2 and 4.6: artifacts when scrolling during animation.Gabriel de Dietrich2009-08-261-0/+60
| | | | | | | | | | | | | | | | | | | | | Auto-test submitted. Task-number: 259503 Reviewed-by: bnilsen
* | | Introduce QGraphicsItem::ItemIsPanel, light-weight window.Andreas Aardal Hanssen2009-08-261-12/+12
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ItemIsPanel allows items that act like windows. They can be activated and deactivated just like windows and focus is handled just like with windows. The main difference is that panels are more light-weight. There's less built-in functionality (e.g., clicking a panel doesn't automatically activate nor raise it). This patch also introduces QGraphicsItem::panel(), QGraphicsItem::isPanel(), and QGraphicsItem::isActive(), as well as QGraphicsScene::activePanel(), QGraphicsScene::setActivePanel(). and QGraphicsScene::isActive(). Regular windows (QGraphicsWidgets with Qt::Window set) are also panels, with added functionality. The ItemIsPanel flag is set automatically for windows. Reviewed-by: brad