summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-243-6/+14
|\ | | | | | | | | Conflicts: src/gui/kernel/qapplication_x11.cpp
| * Fixed count(), itemAt() and removeAt() in QGraphicsLinearLayout.Jan-Arve Sæther2009-06-242-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to this, the behaviour of count(), itemAt() and removeAt() was different between QGraphicsLinearLayout and QGraphicsGridLayout. QGraphicsGridLayout does it right. This adds some behaviour changes: 1. QGraphicsLinearLayout::count() is no longer affected by inserted stretches (through insertStretch) This means that code like this will break: QGraphicsLinearLayout *linearLayout = new QGraphicsLinearLayout; linearLayout->addItem(new QGraphicsWidget); linearLayout->addStretch(); int count = linearLayout->count(); linearLayout->removeAt(count - 1); // before this patch it would do nothing (and it wouldn't // actually remove the stretch), with the new patch it would // remove the QGraphicsWidget. 2. count(), itemAt() and removeAt() now prints a warning for an invalid index. The documentation actually says that "The reimplementation can assume that index is valid (i.e., it respects the value of count()", but I decided that its too risky to not assume that it is valid, since it would break the following common pattern: while(layout->itemAt(0)) { layout->removeAt(0); } Cleaned up autotests (and a small codeblock) that assumed itemAt/removeAt with an invalid index to work, since we should try to follow our own advice. :-) This change is also an alignment with what QGraphicsGridLayout does (it checks the index argument and prints a warning too.)
| * Merge commit 'origin/4.5'Oswald Buddenhagen2009-06-231-1/+1
| |\ | | | | | | | | | | | | Conflicts: src/sql/drivers/psql/qsql_psql.cpp
| | * Check for null pointer in QGraphicsProxyWidget::event() in case there is no ↵Marius Bugge Monsen2009-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | focusWidget(). Reviewed-by: Thierry Task-number: 255468
* | | Add QTouchEvent::DeviceType and deviceType()Bradley T. Hughes2009-06-242-13/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | This enum indicates what kind of device generated the touch event (TouchScreen or TouchPad). We use this information to control how touch events are sent, specifically we restrict touch events to a single widget/QGraphicsItem on touch-pads, since there is no direct relationship between the physical touch location on the pad and the on- using the touch-pad).
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-224-173/+185
|\ \ \ | |/ / | | | | | | | | | | | | | | | Conflicts: doc/src/qnamespace.qdoc src/corelib/global/qnamespace.h src/gui/graphicsview/qgraphicsscene.cpp
| * | Small optimization to QGraphicsItemPrivate::combineTransform(To|From)Parent.Bjørn Erik Nilsen2009-06-191-2/+2
| | | | | | | | | | | | Every cycle counts :)
| * | Refactor QGraphicsScene::drawSubtreeRecursive.Bjørn Erik Nilsen2009-06-193-153/+169
| | | | | | | | | | | | | | | | | | | | | | | | It's easier to read and maintain the code now. This version is also faster than the old one and makes it easier to implement another cut-off I'm working on. All auto-tests still pass. Examples/demos run fine.
| * | Use QTransform more efficiently.Bjørn Erik Nilsen2009-06-183-19/+15
| | | | | | | | | | | | Reviewed-by: Samuel
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-185-73/+135
|\ \ \ | |/ / | | | | | | | | | Conflicts: src/gui/graphicsview/qgraphicsitem_p.h
| * | Compile on MSVC.Bjørn Erik Nilsen2009-06-182-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | The QtSVG module failed to link because it includes qgraphicsitem_p.h, which had an inlined function (updateHelper) that called an undeclared function (QGraphicViewPrivate::update(Region|Rect))...Resulting in unresolved symbols. Reviewed-by: MariusSO
| * | Remove wrong negation.Bjørn Erik Nilsen2009-06-181-1/+1
| | | | | | | | | | | | | | | I changed the logic in e920c83084b48db7fe1925c7b98e34794eec6d55 and this negation incidentally snuck in.
| * | Small optimization to QGraphicsScenePrivate::drawSubtreeRecursive.Bjørn Erik Nilsen2009-06-171-1/+5
| | | | | | | | | | | | We save three function calls by calling item->paint() directly.
| * | Speedup QGraphicsScenePrivate::processDirtyItemsRecursiveBjørn Erik Nilsen2009-06-172-13/+20
| | | | | | | | | | | | Avoid QTransform copy in common case.
| * | Speedup QGraphicsScenePrivate::processDirtyItemsRecursiveBjørn Erik Nilsen2009-06-171-13/+16
| | | | | | | | | | | | Don't calculate dirty scene transforms for invisible items.
| * | Sometimes broken transforms in GV.Bjørn Erik Nilsen2009-06-171-4/+4
| | | | | | | | | | | | | | | | | | Broken after: 85f811b849f3b0e0b79e0f1b7bf41512d7f53414 QPainter::worldTransform returns a const reference(!) so we have to make a copy.
| * | Reduce QTransform operations in QGraphicsView::paintEvent.Bjørn Erik Nilsen2009-06-171-9/+18
| | | | | | | | | | | | | | | | | | | | | The view is usually untransformed, and in that case there's no need to call QGraphicsView::viewportTransform() and QPainter::setWorldTransform(). Reviewed-by: Andreas
| * | Remove two work-arounds in QGraphicsView::paintEvent.Bjørn Erik Nilsen2009-06-171-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The accelerate scrolling work-around is fixed by: 8ebe882b077fffedc3ff80fb80d2e181d5e56ab8 The other case was trying to avoid doing expensive QRegion calculations when everything must be repainted anyways. However, it was not entirely correct to assume all paintEvents are triggered by GV itself. Anyways, we don't need it anymore :-) Reviewed-by: Andreas
| * | Fix tst_QGraphicsItem::opacityZeroUpdatesBjørn Erik Nilsen2009-06-171-0/+6
| | | | | | | | | | | | | | | Child items must ignore visible/opacity if parent does. Broke after: c9ab7a8b8504101c06456b706a84e0eb0693c77e
| * | Speedup QGraphicsScenePrivate::processDirtyItemsRecursive.Bjørn Erik Nilsen2009-06-175-42/+77
| | | | | | | | | | | | | | | | | | | | | | | | Don't process invisible items or items with no contents. I've also added cut-offs to QGraphicsViewPrivate::update(Region|Rect) to make sure update areas outside the viewport are discarded immediately. Reviewed-by: lars
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-1735-73/+74
|\ \ \ | |/ / | | | | | | | | | Conflicts: src/gui/graphicsview/qgraphicsscene_p.h
| * | Fix QGraphicsItem::ItemHasNoContents rendering of children.Andreas Aardal Hanssen2009-06-171-2/+3
| | | | | | | | | | | | | | | | | | | | | The ItemHasNoContents flag was preventing items that clip their children from rendering their children at all. Fixed now. Reviewed-by: bnilsen
| * | Merge license header changes from 4.5Volker Hilsheimer2009-06-1635-70/+70
| |\ \ | | |/
| | * Update license headers as requested by the marketing department.Jason McDonald2009-06-1635-70/+70
| | | | | | | | | | | | Reviewed-by: Trust Me
| | * QGraphicsItem::setOpacity(0.0) does not trigger an update of child itemsLeonardo Sobral Cunha2009-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Forwarding the ignoreOpacity flag to children in QGraphicsItemPrivate::fullUpdateHelper. This is a complementary fix to task 252913, partly fixed in commit 2e3a5ea44... Reviewed-by: bnilsen BT: yes
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-161-18/+26
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/qnamespace.qdoc doc/src/snippets/code/src_gui_qproxystyle.cpp src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebKit/qt/ChangeLog src/gui/graphicsview/qgraphicsscene.cpp src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication_x11.cpp src/gui/kernel/qt_x11_p.h src/gui/kernel/qwidget.cpp src/gui/styles/qproxystyle.cpp src/gui/styles/qstyle.cpp src/scripttools/debugging/qscriptdebugger.cpp src/scripttools/debugging/qscriptenginedebugger.cpp src/sql/drivers/odbc/qsql_odbc.cpp src/sql/kernel/qsqldatabase.cpp src/sql/kernel/qsqldriver.cpp
| * | Don't mark ItemHasNoContents items as dirty, ever.Andreas Aardal Hanssen2009-06-161-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QGraphicsItem::ItemHasNoContents flag ensures that we don't have to ever paint this item. So let's not mark it as dirty at all (items are marked as dirty when updated, moved, or transformed). This is a minor optimization. Reviewed-by: bnilsen
| * | Optimization: Don't determine the expose if the item is invisible.Andreas Aardal Hanssen2009-06-151-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the item either sets the ItemHasNoContents flag, or if it's invisible but has child items that are not (and ignore parent opacity), then don't bother calculating the item's exposed view rect as the item will not get drawn anyway. This carves down the number of QTransform::mapRect operations by 25% when running the Declarative UI calculator transition. We'll proceed to removing such operations from the markDirty step as well. Reviewed-by: bnilsen
| * | Speedup QGraphicsItemPrivate::TransformData::computedFullTransformBjørn Erik Nilsen2009-06-122-10/+33
| | | | | | | | | | | | | | | | | | Do as little as possible and avoid premulitplication :) Reviewed-by: Samuel
| * | QGraphicsItems are repainted when outside the view's exposed region.Bjørn Erik Nilsen2009-06-121-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that we used QRect::isEmpty() on the item's bounding rect intersected with the exposed region's bounding rect as a criteria for whether the item should be drawn or not. This does not work as expected with partial updates, where the boundingRect() of the exposed region easily can cover the entire viewport area. The item should *only* be drawn if its bounding rect intersects with the exposed region (and not the exposed region's bounding rect). Auto-test included.
| * | doc: Fixed several qdoc warnings.Martin Smith2009-06-123-52/+107
| | |
* | | Merge of masterBradley T. Hughes2009-06-155-67/+146
| | |
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-1211-219/+406
|\ \ \ | |/ / | | | | | | | | | Conflicts: src/gui/graphicsview/qgraphicsitem_p.h
| * | Painting artifacts in QGraphicsView.Bjørn Erik Nilsen2009-06-113-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem appears in the chip demo when clicking an item while scrolling the view using the mouse wheel. The problem was that we didn't translate the the item's old painted view rect. There was also a problem when enabling the DontAdjustForAntialiasing flag, causing an item to not redraw its edges. We have to adjust the rectangle by (-1, -1, 1, 1) since QRect() and QRectF() behaves differently. Auto-test (made by Andreas) included. Reviewed-by: Andreas
| * | QGraphicsView: Replace update() with updateAll().Bjørn Erik Nilsen2009-06-112-22/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have some nice cut-offs when there's a full update pending, but we don't know about it if we call update() directly on the viewport. Instead call QGraphicsViewPrivate::updateAll() which has the same effect, except that it also sets a flag telling us a full update is pending. Reviewed-by: Andreas
| * | Removed qApp and replaced with QApplication:: for static member callsThierry Bastian2009-06-113-10/+10
| | |
| * | doc: Fixed several qdoc warnings.Martin Smith2009-06-111-3/+6
| | |
| * | add parent and id properties to QGraphicsObjectLars Knoll2009-06-112-3/+76
| | | | | | | | | | | | | | | | | | In addition added documentation for the other properties. Reviewed-by: Andreas
| * | added properties for x,y and z. Removed the notify for the pos property,Lars Knoll2009-06-113-12/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add auto tests for QGraphicsObject FX items are better off with property notifications on each component rather than on the position. Added some basic testing for QGraphicsObject and fixed the failures exposed. Reviewed-by: Andreas
| * | Add some meat to QGraphicsObjectLars Knoll2009-06-114-107/+166
| | | | | | | | | | | | | | | | | | | | | | | | Added a toGraphicsObject() method to QGraphicsItem to allow upcasting. Expose some of QGraphicsItems setter/getter pairs as real properties in QGraphicsObject, including NOTIFY signals. Reviewed-by: Andreas
| * | move some properties from QGraphicsWidget to QGraphicsObjectLars Knoll2009-06-112-4/+4
| | | | | | | | | | | | | | | | | | These are properties of QGraphicsItem. QGraphicsObject should expose these. Reviewed-by: Andreas
| * | add a QGraphicsObject class and change QGraphicsWidget and QGraphicsTextItem ↵Lars Knoll2009-06-115-49/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to inherit from it This changes the inheritance hierarchy of QGraphicsWidget from multiply inheriting from QObject, QGraphicsItem and QGraphicsLayoutItem to inherit from QGraphicsObject and QGraphicsLayoutItem. QGraphicsObject then simply inherits from QObject and QGraphicsItem. This change is binary compatible as it will leave the vtable layout unchanged and as the parent class doesn't appear in the C++ name mangling on any of our platforms. It's also source compatible as it isn't noticable by existing code. The restriction we have on QGraphicsObject is that we can not add any new virtual methods to it, or add data members to the class. We can however implement a QGraphicsObjectprivate inheriting from QGraphicsItemPrivate if there is a need to add data members to the class. This change will allow us to now have one single base for all QGraphicsItems that inherit from QObject: QGraphicsTextItem, QGraphicsWidget and in the future QFxItem. Having that single base class will significantly simplify our work in the qml engine. Reviewed-by: Andreas
| * | Partially revert "Add (back) properties to QGraphicsItem to change theBjørn Erik Nilsen2009-06-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | transformations component" This partially reverts commit 56f23d4c, which changed the logic in updateCachedClipPathFromSetPosHelper. We cannot compute the item's transform relative to the parent by using transformToParent() because the new position is not yet set on the item, that's why the new position is passed into the function. However, I'll look into how we can get rid of the entire function, but keep it as is for now. Reviewed-by: Olivier
| * | We don't have to combine the world matrix anymore.Bjørn Erik Nilsen2009-06-101-5/+3
| | | | | | | | | | | | | | | | | | See also: 32f32ee3e752a6cc03505ddaa48d2849eaedc2a6 Reviewed-by: Andreas
| * | removed superflous indirection (ie. using q->..) instead of using theThierry Bastian2009-06-102-36/+29
| | | | | | | | | | | | private class member.
* | | make sure touch events are enabled on the view's viewport when items are ↵Bradley T. Hughes2009-06-111-0/+9
| | | | | | | | | | | | | | | | | | interested in touch events this is a continuation of 0218d8f8dc569db9a1290f595a814c3690c1b14b
* | | enable touch events on all views if an item has touch enabledBradley T. Hughes2009-06-113-7/+26
| | |
* | | remove duplicated code and API (merge QTouchEvent and QGraphicsSceneTouchEvent)Bradley T. Hughes2009-06-117-557/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | the API for these 2 classes is identical, the implementation is almost identical, they share the same data structures, so bite the bullet and merge them. this means we go back to using screenPos() instead of globalPos() again
* | | another API review round: change Q*TouchEvent size() functions to return ↵Bradley T. Hughes2009-06-112-21/+22
| | | | | | | | | | | | | | | | | | rects instead these are more useful, as already shown in the fingerpaint example
* | | Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qtBradley T. Hughes2009-06-1011-1353/+1400
|\ \ \ | |/ / | | | | | | | | | | | | | | | Conflicts: src/gui/graphicsview/qgraphicsitem.cpp src/gui/graphicsview/qgraphicsitem_p.h src/gui/graphicsview/qgraphicsscene_p.h