summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsscene.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '4.5'Rhys Weatherley2009-04-211-1/+3
|\ | | | | | | | | | | | | | | | | | | | | 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: Revert "Fixes: Don't fill the pixmap because we will copy the cache ↵Andreas Aardal Hanssen2009-04-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into it." This reverts commit 0985805ab3c7de5b15c115a98afb15944b6d93b9. The Elastic Nodes example shows a black background for the cache pixmap if the call to fill isn't there. Alexis and I both agree that it makes no sense that we fill the pixmap with transparent pixels instead of just drawing with QPainter::CompositionMode_Source, but since this regression was introduced after 4.5.0 was released we must revert before we investigate further. Reviewed-by: Alexis
| * We don't need to call two times itemChange when an item is deleted.Alexis Menard2009-04-211-6/+0
| | | | | | | | | | | | | | | | | | Previously we were calling two times itemChange on the parent to give QGraphicsItem::ItemChildAddedChange. We don't need that. One is enough. BT : yes Task-number: BT Reviewed-by: Andreas
* | Fix two bugs in Graphics View's mouse grab logics + add autotests.Andreas Aardal Hanssen2009-04-171-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change fd4d94df4eb16e9e54f61dd8ee45914e24832ae9 introduced mouse grab and keyboard grab support to Graphics View (this was as part of 4.4). The change was missing a large set of autotests that I wrote to test the behavior of these features. As part of task 245317, which involves investigating modality in Graphics View, I figured it would be a good idea to start off but reconstructing these autotests. So this change is mainly about adding autotests for mouse grabbing. And of course, as it always is, I found two bugs while writing these tests. 1) Calling QGraphicsItem::grabMouse() while the item is holding the implicit mouse grab will now upgrade the implicit grab to an explicit grab. 2) Adding a popup to the scene will automatically grab the mouse. Before, the popup would get the grab on show(), but if it was already visible when added to the scene it would not gain the grab. Task-number: 245317 Reviewed-by: jasplin
* | Merge commit 'origin/4.5'Olivier Goffart2009-04-151-0/+19
|\ \ | |/ | | | | | | Conflicts: src/gui/graphicsview/qgraphicsitem.cpp
| * QGraphicsItem: When an item is deleted and eventfilters installedAlexis Menard2009-04-141-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | The problem here is that we are filling the sceneEventFilters map when we install evenfilter but we never remove the references of an item if it has been removed from the scene or deleted. The deletion can keep stale pointers into the map and a crash can happen. BT:yes Task-number:250272 Reviewed-by: bnilsen Reviewed-by: andreas
* | Rename qIsFuzzyNull to qFuzzyIsNullBjoern Erik Nilsen2009-04-081-2/+2
| | | | | | | | | | | | | | | | | | | | The function was added in fde7f3d03782c801901f511131458d6fcb1021a5 and we believe qFuzzyIsNull is a better naming and more in line with qFuzzyCompare. Reviewed-by: Lars Knoll Reviewed-by: nrc Reviewed-by: Samuel
* | Disable mouse tracking in QGraphicsView if possible.Bjoern Erik Nilsen2009-04-071-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't need mouse tracking unless there are items in the scene that either accept hover events or have a cursor set. This cut-off is extremely efficient in the common case since all items ignore hover events and use the standard cursor by default. We no longer dig for items and do lots of intersection and calculating just for fun :-) We even get rid of the overhead of 2 x QCoreApplication::sendEvent! The next step is to optimize the items(*) functions to simply check for hasCursor()/acceptsHoverEvents() before we do complex checks like intersects/collidesWithPath() etc. Auto test included. Reviewed-by: Andreas
* | Use qIsFuzzyNull rather than qFuzzyCompareBjoern Erik Nilsen2009-04-071-2/+2
| | | | | | | | | | qIsFuzzyNull is much cheaper than qFuzzyCompare, and in this case qIsFuzzyNull will do the trick.
* | Merge commit 'origin/4.5'Bjoern Erik Nilsen2009-04-071-106/+255
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/gui/graphicsview/qgraphicsitem.cpp src/gui/graphicsview/qgraphicsitem_p.h src/gui/graphicsview/qgraphicsscene.cpp src/gui/painting/qtransform.cpp
| * Fixes: Optimize the way we adjust rectangles.Bjoern Erik Nilsen2009-04-061-28/+48
| | | | | | | | | | RevBy: Olivier AutoTest: Still pass
| * Fixes: Minimize QVariant overhead related to QGraphicsItem::itemChange.Bjoern Erik Nilsen2009-04-061-11/+13
| | | | | | | | | | RevBy: Andreas AutoTest: included
| * Optimise QGraphicsScene/View::items(const QPointF &pos)Lars Knoll2009-04-061-12/+82
| | | | | | | | | | Implement specialized (and more efficient versions) of item_helper() and child_helper() that test for QPointF in the scene.
| * Fixes: Don't bother updating hidden items.Bjoern Erik Nilsen2009-04-061-0/+3
| | | | | | | | AutoTest: Still pass
| * Fixes: Don't bother processing items that are clipped away.Bjoern Erik Nilsen2009-04-061-52/+64
| | | | | | | | RevBy: Andreas
| * Fixes: Get rid of lots of calls to qFuzzyCompare.Bjoern Erik Nilsen2009-04-061-3/+3
| | | | | | | | | | | | | | RevBy: Olivier AutoTest: Still pass. Details: Items usually don't have effective opacity, i.e. it is 1.0, so don't bother doing fuzzy compare if that's the case.
| * Fixes: Cleanup/Optimize QGraphicsView::findItems.Bjoern Erik Nilsen2009-04-061-19/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | RevBy: Alexis AutoTest: Still pass Details: findItems() does almost exactly the same as QGraphicsView::items, the only difference is that it checks whether we are about to redraw all items. Next step is to optimize the items_helper functions. The patch does also include a fix for ::items/childItems_helper(const QPainterPath ...); it didn't take Qt::Intersects/ContainsItemBoundingRect into account (in the same fashion as we do in the other helper functions).
| * Fixes: Don't fill the pixmap because we will copy the cache into it.Alexis Menard2009-04-061-3/+1
| | | | | | | | | | RevBy: bnilsen AutoTest: All pass + plasma ok
| * Fixes: Get rid of a gazillion calls to QTransform::operator*=.Bjoern Erik Nilsen2009-04-061-2/+3
| | | | | | | | Details: Be a little bit smarter before doing *= :)
| * Fixes: Use QRect::isEmpty() rather than isNull() if possible.Bjoern Erik Nilsen2009-04-061-1/+1
| | | | | | | | | | | | RevBy: Andreas Details: Note that isNull() implies isEmpty(), but it only catches the cases where width and height is 0.
* | Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qtSimon Hausmann2009-04-021-4/+7
|\ \ | |/ | | | | | | Conflicts: tools/linguist/shared/profileevaluator.cpp
| * Fix slowdown regression in QGraphicsItem::ItemCoordinateCacheAndreas Aardal Hanssen2009-04-021-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right before Qt 4.5.0 was released, Alexis and I submitted change 7e9b000ee418ef2d9c8fadb2c6b8870e0335bd5e, which accidentally introduced a rounding error causing items whose bounding rect contains fractional numbers (e.g., QRectF(-0.5, -0.5, 11, 11)), to always be drawn with a one-pixel strech even if otherwise untransformed. This caused a significant slowdown for pixmap items and any shape item that uses almost any pen width != 0, if they enable ItemCoordinateCache. The fix is to consistently use the aligned rectangle both when generating the cache pixmap and when drawing it. Reviewed-by: Alexis
| * Long live Qt 4.5!Lars Knoll2009-03-231-0/+5360
|
* Long live Qt!Lars Knoll2009-03-231-0/+5377