summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * Improve performance of QGraphicsItem::setParentItem.Bjørn Erik Nilsen2010-01-211-10/+11
| | | | | | | | | | | | | | | | | | The biggest optimization here is "updateAncestorFlags()". It's much faster to update all the flags rather than trying to enable/disable certain flags according to the current state. Task-number: QTBUG-6877 Reviewed-by: alexis
* | Merge branch '4.6'Thiago Macieira2010-01-181-1/+24
|\ \ | |/
| * Improved performance of translating device coordinate graphics effects.Samuel Rødal2010-01-131-1/+24
| | | | | | | | | | | | | | | | Don't invalidate the cache if we're only translating and the effect rect is fully contained within the device rect of the painter. Task-number: QTBUG-6901 Reviewed-by: Bjørn Erik Nilsen
* | Merge branch '4.6'Thiago Macieira2010-01-131-5/+7
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt doc/src/deployment/deployment.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/xml/qxmlstream.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h tools/assistant/tools/assistant/centralwidget.cpp tools/linguist/lupdate/main.cpp
| * Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6Simon Hausmann2010-01-081-6/+11
| |\ | | | | | | | | | | | | Conflicts: src/multimedia/audio/qaudioformat.cpp
| * | Fixes a crash when destroying and creating QApplication.Denis Dzyubenko2010-01-071-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | Moved the gestureManager pointer to a QApplicationPrivate to make sure if QApplication object is destroyed, QGestureManager pointer is set to zero. Task-number: QTBUG-7029 Reviewed-by: Thiago
| * | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into ↵Qt Continuous Integration System2010-01-071-1/+1
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1: QIODevice: Fix readAll() Temporary hackiesh solution to prevent BOM in the xml data. Fixed qxmlstream autotest when using shadow builds. Attempt at readding the capital P headers for Phonon Remove special Phonon processing from syncqt. Use the lowercase/shortname.h headers for Phonon includes Fixes a crash when setting focus on a widget with a focus proxy. Update copyright year to 2010 doc: Clarified activeSubControls and subControls. Remove warning "statement with no effect" doc: Clarified that .lnk files are System files on Windows.
| | * | Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | | | | | | | | | Reviewed-by: Trust Me
* | | | Merge branch '4.6'Thiago Macieira2010-01-081-17/+32
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfsfileengine.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/opengl.pro
| * | | Fix performance regression in _q_polishItems.Alexis Menard2010-01-071-6/+11
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSet is a hash internally, using Iterator::begin while erasing elements inside the set might create holes and then the complexity increase. We now use the return value of erase (the next element) so the complexity is linear. For those who create/delete item in the polish event (BAD), _q_polishItem might be slower than the normal call. Task-number:QTBUG-6958 Reviewed-by:olivier
| * | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into ↵Qt Continuous Integration System2010-01-061-0/+4
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4.6-integration * '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (42 commits) QBoxLayout::setGeometry would not respect the widget min/max width Revert "QStyleSheetStyle: Fixed some text croped when having padding with native border." Use QFile:rename when moving items in QFileystemModel. Revert "Add GLfloat[2][2] & GLfloat[3][3] uniform setters to QGLShaderProgram" Fix default filter selection when using HideNameFilterDetails option. Don't write out fo:word-spacing if its the default value. Improved initial startup time for a QGLWidget ontop of EGL/X11. Document the QGraphicsView::IndirectPainting flag Display broken symlinks in the filesystem model. Fix typo in autotest testcase name. Fixed a bug with distribution of spans. Make unit test more robust Compile with QT_NO_DOCKWIDGET Removed temporary QGLWidget created during QGLWidget/X11 initialization. Fix test: The bug is now fixed Fix auto-test failure on Windows QScript: Lookup the native setter from the prototype Implement QScript::QObjectDelegate::getOwnPropertyDescriptor fix compilation in GL2 paint engine for Windows Move QGLTextureGlyphCache into it's own file ...
| | * Document the QGraphicsView::IndirectPainting flagOlivier Goffart2010-01-061-0/+4
| | | | | | | | | | | | | | | | | | And that the QGraphics{View,Scene}::drawItems function are now obsolete. Reviewed-by: Alexis
| * | doc: Clarified that the scene owns its items and destroys them.Martin Smith2010-01-061-11/+17
| |/ | | | | | | Task-number: QTBUG-6637
* | Merge branch '4.6'Thiago Macieira2009-12-261-2/+5
|\ \ | |/ | | | | | | | | | | Conflicts: examples/webkit/fancybrowser/main.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp tools/assistant/tools/assistant/bookmarkmanager.cpp
| * Merge commit 'origin/4.6' into 4.6Olivier Goffart2009-12-141-3/+21
| |\
| * | Added InvalidateReason to invalidateCache to optimize effectsSamuel Rødal2009-12-141-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | This lets us ignore the invalidateCache call when the transform of a graphics item with an effect changes, and the cached system is LogicalCoordinates and cached mode is not PadToEffectiveBoundingRect. Reviewed-by: Bjørn Erik Nilsen
* | | Merge commit 'origin/4.6'Olivier Goffart2009-12-151-9/+27
|\ \ \ | | |/ | |/| | | | | | | | | | | | | Conflicts: src/corelib/io/qfsfileengine.cpp src/network/access/qnetworkrequest.cpp tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
| * | Merge commit oslo-staging-2/4.6 into upstream/4.6Olivier Goffart2009-12-141-5/+6
| |\ \ | | |/
| | * Fix a crash on the focus chain when removing items from the scene.Alexis Menard2009-12-091-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crash was because of the dangling pointer set on the tabFocusFirst attribute in QGraphicsScene. A child which was the tabFocusFirst was removed from the scene and fixFocusChainBeforeReparenting was setting the new tabFocusFirst pointer to the parent (since in that example it was the focusNext) but later on the parent was removed also from the scene (due to the recursion of removeItem if you call it with the parent : first children, then the parent itself) and fixFocusChainBeforeReparenting was not called again so if you delete the parent then the scene has the dangling pointer set. Task-number:QTBUG-6544 Reviewed-by:janarve
| * | Fix crashes when deleting QWidgets and QGraphicsItems in touch event handlers.Bradley T. Hughes2009-12-111-3/+21
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Use QWeakPointer to bail out early if a widget is deleted while we are delivering/propagating a TouchBegin event. In QGraphicsScene, we need to make sure that we clear the scene's active touch points for items that are removed from the scene. This allows us to detect when an item is removed during TouchBegin event delivery/propagation. Unlike QWidget, propagation continues since we use a hit-test instead of the item's hierarchy for propagation. Task-number: QTBUG-6654 Reviewed-by: bnilsen
| * Fixes clipping bug in the embedded dialogs demo.Yoann Lopes2009-12-041-1/+0
| | | | | | | | | | | | | | | | | | | | The problem was that when using DeviceCoordinateCache for items in a scene, newly exposed areas were wrongly painted over the Pixmap in the cache, instead of blending into it. Autotest included. Task-number: QTBUG-657 Reviewed-by: Andreas Reviewed-by: bnilsen
* | Added QGraphicsWidget::autoFillBackground property.J-P Nurmi2009-12-031-0/+2
|/ | | | | | | | This add a property to QGraphicsWidget to fill its background. QWidget has the same. Merge-Request: 1656 Reviewed-by: Alexis Menard <alexis.menard@nokia.com>
* Remove unused variables in QGraphicsItem and QGraphicsScene.Bjørn Erik Nilsen2009-11-251-5/+4
| | | | | maybeDirtyClipPath and ingoreClipping is not relevant anymore now that the cached clip path is removed.
* Crash when rendering a scene using DeviceCoordinateCacheGabriel de Dietrich2009-11-181-3/+6
| | | | | | | | | | The execution flow would allow the widget the scene would be rendered on to be null. However this very widget was being used when using DeviceCoordinateCache to get the desktop size. We now skip this optimisation when no widget is given. Auto-test included. Reviewed-by: bnilsen Task-number: QTBUG-5904
* Fixes polish events for explicitly hidden GraphicsWidgetItems.Yoann Lopes2009-11-171-5/+3
| | | | | | | | | The problem was that hidden items never get added to "unpolishedItems" list and thus never get the polish event. Autotest included. Task-number: QTBUG-3939 Reviewed-by: bnilsen
* Fixes QGraphicsWidget: paint() being called before polish().Bjørn Erik Nilsen2009-11-131-0/+8
| | | | | | | | | | | | | | | The problem is that we request an update() before we schedules a polish event in QGraphicsScene::addItems, which means paint() is being called before polishEvent(). We could try to swap the order in addItems, but that doesn't give us any guarantee that polish is delivered before update (since we have no control over what's happening from outside graphics view). A better solution is to always make sure we don't have unpolished items before we draw. Auto-test included. Task-number: QTBUG-4979 Reviewed-by: Andreas
* Improvements to graphics effects API after review round.Samuel Rødal2009-11-101-1/+1
| | | | | | | | | | | | * Get rid of QGraphicsEffectSource from the public API, instead add convenience functions in QGraphicsEffect. This way we commit to less API, and are free to introduce a customizable QGraphicsEffectSource in a future release. * Move PixmapPadMode into QGraphicsEffect and tweak the names of the enum values. * Make QGraphicsBlurEffect::BlurHint into a bit flag, for extensibility. Reviewed-by: Bjørn Erik Nilsen