summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add a new qconfig feature GESTURESTasuku Suzuki2010-06-021-0/+13
| | | | | Merge-request: 535 Reviewed-by: Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>
* Redraw issues when removing a fully transparent QGraphicsItem from the scene.Bjørn Erik Nilsen2010-05-261-0/+18
| | | | | | | | | | | | | | This only happened with fully transparent ancestors (item's effectiveOpacity() == 0.0). Problem was that we didn't take into account the ancestors' opacity when removing an item from the scene. More specifically: The calculated effective opacity for the item was zero and we ignored update requests. We have to ignore the opacity if any of the ancestors' ignoreOpacity bit is 1, which means the opacity is set to 0 and the update request has not yet been processed. Auto test included. Task-number: QTBUG-10778
* Don't polish QDeclarativeItems.Warwick Allison2010-05-241-5/+9
| | | | | | | | Avoids unnecessary processing and assumptions we would not want to preserve in the future. Task-number: QTBUG-10217 Reviewed-by: Martin Jones
* Fixes wrong QGraphicsItemCache::boundingRect.Bjørn Erik Nilsen2010-05-211-10/+10
| | | | | | | | | | | | The boundingRect were in some cases not updated correctly, causing full item exposure. Another problem was that we used QRectF::toRect() instead of QRectF::toAlignedRect() when converting a QRectF to QRect. This commit also reduces the probability of doing pixmap scaling since we only pass an offset to QPainter::drawPixmap, instead of passing target and source rects. Task-number: Required by QTBUG-8378
* doc: Fixed many broken links.Martin Smith2010-05-191-1/+1
|
* Gestures in GraphicsView do not require a viewport to subscribe to gestures.Denis Dzyubenko2010-05-181-0/+29
| | | | | | | | | When a graphicsitem subscribes to a gesture the viewport is implicitly subscribed to it as well. Task-number: QTBUG-9849 Reviewed-by: Olivier Goffart Reviewed-by: Mikko Harju
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-05-131-9/+21
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.7-integration * '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (35 commits) Avoid running animation when loopCount == 0 Set the pictures for the examples of multitouch Compile fix on Windows. Remove an unnecessary assert. Documentation for the Pad Navigator Example. New Pad Nagivator example implementation. Skip definition of wintab functions in case of QT_NO_TABLETEVENT. Made curve tesselation be dynamically adjusted based on transform. Modified QPainter and QPixmap benchmarks to use raster pixmaps. Stabilize tst_QWidgetAction::visibilityUpdate Fix compiler warning in QT_REQUIRE_VERSION Stabilize tst_QColumnView::parentCurrentIndex Really fix tst_QDockWidget::taskQTBUG_9758_undockedGeometry on Linux Fix typos in Elastic Nodes example documentation. Made paint engine texture drawing work in GL ES 2 and updated docs. Opt out of visual-config size checks with extension Fix off-by-one in text layouts and widget size hints on Mac Stabilize tst_QDockWidget::taskQTBUG_9758_undockedGeometry Mark QFileDialog::Options as a Q_FLAGS fix tst_QDockWidget::taskQTBUG_9758_undockedGeometry on Linux ...
| * Performance issue with QGraphicsItem::ItemClipsChildrenToShape.Bjørn Erik Nilsen2010-05-051-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Pack Graphics View booleans in quint32 bit fields.Bjørn Erik Nilsen2010-05-051-8/+8
| | | | | | | | | | | | | | Reduces the memory footprint of a typical GV application by 27 * sizeof(bool). Nothing revolutionary, but you know, every byte counts :-) Reviewed-by: Jan-Arve
* | Fix for graphics widget in the background stealing declarative item's focusJoona Petrell2010-05-131-2/+2
| | | | | | | | | | Task-number: QTBUG-10584 Reviewed-by: Warwick Allison
* | Reset the dragDropItem to 0 when the item dies while dragging on top it.Alexis Menard2010-05-121-0/+4
|/ | | | | | | | 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-19/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+3
|\
| * Ensured that WA_InputMethodEnabled was set before FocusInEvent was sent.Jan-Arve Sæther2010-04-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Olivier Goffart2010-04-161-0/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebCore/page/FrameView.cpp src/3rdparty/webkit/WebCore/rendering/RenderWidget.cpp src/3rdparty/webkit/WebKit/qt/symbian/eabi/QtWebKitu.def src/s60installs/bwins/QtCoreu.def src/s60installs/bwins/QtGuiu.def src/s60installs/bwins/QtNetworku.def src/s60installs/eabi/QtGuiu.def tests/auto/qscriptextqobject/tst_qscriptextqobject.cpp
| * Fixes tooltips for QGraphicsProxyWidget.Yoann Lopes2010-04-151-0/+6
| | | | | | | | | | | | | | | | | | Help event was not propagated to the widget. Also fixes tooltip value propagation when setting it on the proxy or on the widget. Autotest included. Task-number: QTBUG-5349 Reviewed-by: bnilsen
* | Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-03-291-7/+6
|\ \ | |/ | | | | | | | | | | Conflicts: mkspecs/common/symbian/symbian.conf qmake/generators/symbian/symmake.cpp src/3rdparty/webkit/WebCore/WebCore.pro
| * Reverts using composition mode when using DeviceCoordinateMode cache.Yoann Lopes2010-03-261-7/+6
| | | | | | | | | | | | | | | | | | | | 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
* | 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
* | Merge branch '4.6-s60' into 4.7-s60axis2010-03-221-0/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.exe mkspecs/common/symbian/symbian.conf src/gui/graphicsview/qgraphicswidget.h src/gui/kernel/qapplication.cpp src/gui/text/qtextlayout.cpp src/openvg/qpixmapdata_vg.cpp src/s60installs/s60installs.pro tools/runonphone/main.cpp tools/runonphone/serenum_unix.cpp qtextlayout.cpp fixed up together with Eskil. Kept the configure.exe from 4.7 without recompile.
| * Fixes blending problem when paiting non-opaque items with cache enabled.Yoann Lopes2010-03-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In most cases when partially updating an item, the old content of the cache needs to be replaced with the new content (CompositionMode_Source). But in a specific case when using DeviceCoordinateCache and when the item is transformed, the new content needs to be blended (CompositionMode_SourceAtop) with the old one to avoid incorrect fully transparent background. Autotest included. Task-number: QTBUG-7863 Reviewed-by: bnilsen
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integrationQt Continuous Integration System2010-03-071-8/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (25 commits) optimize dynamic call-by-name away Add support for QtScript connect/disconnect syntax in QML Minor perf improvement when running QML script blocks Fix qdeclarative{audio,video} tests. Don't assume documents are in UTF-8. Add basic support for explicit newParent in ParentAnimation. Delete uninspiring example. Fix compiler warning on RVCT Use new enum syntax for value types. Expect fail in currentIndex test for now. Allow unquoted enum syntax for value types More declarative examples cleanup. Improve declarative tabs example. Fix test leaks Use _data() for some tests Add missing NOTIFYs to timer, xmllistmodel, xmlrole Document new ParentChange properties. declarative examples cleanup Fix test Update QmlChanges.txt ...
| * | optimize dynamic call-by-name awaymae2010-03-051-8/+12
| | | | | | | | | | | | Reviewed-by: Roberto Raggi
* | | Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Rohan McGovern2010-03-061-18/+5
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fixed rendering bugs when scrolling graphics items with drop shadows.Samuel Rødal2010-03-021-18/+5
| | | | | | | | | | | | | | | | We can't clip source pixmaps to the device rect, as there's no way of knowing which parts of the source pixmap are needed for the part of the graphics effect that's unclipped. Reviewed-by: Bjørn Erik Nilsen
* | Extended gesture autotest.Denis Dzyubenko2010-03-011-1/+6
| | | | | | | | | | | | | | | | Make sure partial gestures do not propagate further if an item that expects partial gestures received it. Task-number: resulted from QTBUG-6876 Reviewed-by: trustme
* | Fixed coordinate system conversion for gestures.Denis Dzyubenko2010-03-011-4/+4
| | | | | | | | | | | | | | | | | | When converting hotspot position (which is in global coordinates) to graphics scene coordinates we should use the viewport because the mapToScene() takes a position in a viewport. Task-number: related to QTBUG-6876 Reviewed-by: Thomas Zander
* | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into master-s60axis2010-02-261-2/+4
|\ \ | |/ | | | | | | | | Conflicts: qmake/generators/symbian/initprojectdeploy_symbian.cpp qmake/generators/symbian/symmake_abld.h
| * Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6Sami Merila2010-02-251-1/+2
| |\
| | * Regression: QGraphicsScene::render fails to render the entire scene correctly.Bjørn Erik Nilsen2010-02-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This only happened with items that had either negative width or height (boundingRect().width()|height()). Problem was that in case of not having an exposed region (drawing items from QGraphicsScene::render), we simply checked whether the bounding rect was empty or not. This is fine, however we have to normalize the rect first. (Note that QRegion::intersects(rect) always normalizes the rect, so that's why this use case broke only when calling QGraphicsScene::render). Auto-test included. Task-number: QTBUG-7775 Reviewed-by: yoann
| * | Crash in QGraphicsScenePrivate::setFocusItemHelperSami Merila2010-02-251-1/+2
| |/ | | | | | | | | | | | | | | | | | | | | QGraphicsScenePrivate::setFocusItemHelper accesses views.at(i)->inputContext() without checking if it is null. This leads to a crash if it really is null. Fixed by adding a null pointer check. Task-number: QT-3008 Reviewed-by: axis
* | Improved gesture event delivery in graphicsview.Denis Dzyubenko2010-02-241-237/+198
| | | | | | | | | | | | | | | | | | Made it possible to delete a gesture target from a gesture event handler. It is still not possible to delete some items (like an item that originated the gesture, i.e. that that the event that triggered the gesture to start), and in that case deleteLater() should be used. Reviewed-by: Andreas Aardal Hanssen
* | Cache scene coordinates of a hotspot in a QGesture.Denis Dzyubenko2010-02-241-9/+18
| | | | | | | | Reviewed-by: trustme
* | Merge remote branch 'origin/master' into qt-master-from-4.6Thiago Macieira2010-02-181-6/+72
|\ \ | | | | | | | | | | | | | | | Conflicts: src/corelib/codecs/qtextcodec.h tests/auto/gestures/tst_gestures.cpp
| * | Added a new flag to fine-tune gesture propagation policyDenis Dzyubenko2010-02-171-6/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a graphicsobject subscribes to a gesture using the IgnoredGesturesPropagateToParent flag, normal propagation rules do not apply to the gesture, and instead all gestures of the given type that are started over the item will propagate to parent items only. Task-number: QTBUG-7400 Reviewed-by: Andreas
* | | Merge branch '4.6' into qt-master-from-4.6Thiago Macieira2010-02-171-8/+25
|\ \ \ | |/ / |/| / | |/ | | | | | | Conflicts: mkspecs/common/symbian/symbian.conf src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp tools/assistant/tools/assistant/helpviewer.cpp
| * Don't crash when QTouchEvent is accepted but not handled by aBradley T. Hughes2010-02-161-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QGraphicsItem After propagating QEvent::TouchBegin, if there is no item that has accepted and handled the event, we must remove the touch point from our data structures. In this situation, QGraphicsScene will ignore the TouchBegin, as will QGraphicsView, and QApplication will respond by not sending any more touch events to the view/scene/item. This means our logic for handling TouchPointReleased points will never be called (and the QGraphicsScene's itemForTouchPointId and sceneCurrentTouchPoints state will be incorrect). Reviewed-by: Denis Dzyubenko Reviewed-by: Marius Storm-Olsen
| * Correctly mark QGraphicsScene::drawItems() as obsoleteAndy Shaw2010-02-151-1/+3
| | | | | | | | | | | | | | Since the \obsolete was not at the beginning of the function documentation it was not showing it correctly Reviewed-by: TrustMe
| * Implemented GraphicsView Panel support for gestures.Denis Dzyubenko2010-02-121-6/+14
| | | | | | | | | | | | | | | | | | Events should not propagate outside the panel. Also when delivering gesture events we should respect panels modality. Task-number: QTBUG-7451 Reviewed-by: Mikko Harju Reviewed-by: Bradley T. Hughes
* | Merge remote branch 'qt/4.6' into qt-master-from-4.6Qt Continuous Integration System2010-02-091-7/+25
|\ \ | |/ | | | | | | | | Conflicts: src/gui/kernel/qcocoapanel_mac.mm src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
| * QGraphicsWidget is painted twice on the first show.Bjørn Erik Nilsen2010-02-031-1/+6
| | | | | | | | | | | | | | | | | | | | | | We want to discard all update requests when we there's a full update pending. The problem was that 'updateAll' was reset too early causing update requests to fall through. To prevent this from happening we reset 'updateAll' right before the items are actually painted. Auto-test included. Task-number: QTBUG-6956
| * QGraphicsScene: Use QPainter::setClipRect instead of setClipPath if possible.Bjørn Erik Nilsen2010-02-031-3/+15
| | | | | | | | | | | | | | | | Using QPainter::setClipPath results in complex (and slow) alphamasking so this must be avoided if possible. Task-number: QTBUG-7790 Reviewed-by: samuel
| * Adds convenience functions QGraphicsItemPrivate::isOpacityNullLeonardo Sobral Cunha2010-01-291-3/+4
| | | | | | | | | | | | | | This should unify the error constant used along the code and enforce qreal to avoid unnecessary double conversions. Reviewed-by: bnilsen
* | Merge remote branch 'qt/4.6' into qt-master-from-4.6Qt Continuous Integration System2010-02-011-44/+57
|\ \ | |/ | | | | | | | | | | | | | | | | 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
| * Avoid call markParentDirty twice in prepareGeometryChangeLeonardo Sobral Cunha2010-01-271-2/+4
| | | | | | | | Reviewed-by: bnilsen
| * Fixes visibility update missing when doing setParentItem on graphicsitemLeonardo Sobral Cunha2010-01-261-12/+2
| | | | | | | | | | | | | | | | | | | | 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
| * Potential crash when adding items from QGraphicsWidget::polishEvent().Bjørn Erik Nilsen2010-01-221-15/+27
| | | | | | | | | | | | | | | | | | | | | | These were processed immediately, so there was a fair chance that we could end up doing a virtual function call on items that were not fully constructed. This patch is also an optimization, since we never remove anything from the vector. Auto-test included. Reviewed-by: Jan-Arve
| * QGraphicsWidget is painted twice on the inital show.Bjørn Erik Nilsen2010-01-221-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem occured when doing something in the polishEvent() which eventually ended up as an update(). The problem was that in QGraphicsScene::addItem we scheduled a polish event after scheduling an update, resulting in update requests being processed before polish requests. Auto-test included. Task-number: QTBUG-6956 Reviewed-by: alexis
| * Only send QGraphicsItem::ParentChange(d) notifications from setParentItem.Bjørn Erik Nilsen2010-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QmlGraphicsItem doesn't need any parent change notifactions so we can call the helper class (QGraphicsItemPrivate::setParentItemHelper) direclty from QmlGraphicsItem::setParentItem. This avoids a lot of unnecessary instructions related to QVariant constructions as well as virtual function calls. I've made the variant pointers explicit in the declaration of setParentItemHelper so that we don't accidentally call setParentItemHelper from places where we need parent change notifications. Task-number: QTBUG-6877 Reviewed-by: alexis
| * Optimize QGraphicsScenePrivate::itemAcceptsHoverEvents_helperBjørn Erik Nilsen2010-01-211-4/+4
| | | | | | | | | | | | | | | | Make sure we do cheap tests before the more expensive ones. This function is called from QGraphicsScene::addItem. Task-number: QTBUG-6877 Reviewed-by: alexis