| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| | |
Reviewed-by: Trust Me
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
Do as little as possible and avoid premulitplication :)
Reviewed-by: Samuel
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
In addition added documentation for the other properties.
Reviewed-by: Andreas
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
These are properties of QGraphicsItem. QGraphicsObject should expose these.
Reviewed-by: Andreas
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
See also: 32f32ee3e752a6cc03505ddaa48d2849eaedc2a6
Reviewed-by: Andreas
|
| |
| |
| |
| | |
private class member.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We use stable sorting to keep insertion order. This works fine as long
as we sort a complete list of siblings in one go, and this list already
has items in insertion order. But if we shuffle such a list, the only
way to get proper sort order again (with insertion order intact), is
if each item has a sibling index. We used to have this, but we don't
have it anymore (as it's not needed for NoIndex mode).
So until we separate the BSP index into a separate class and add this
index there, we add this workaround which uses the toplevelitems list
to ensure the items have the correct order.
Reviewed-by: bnilsen
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before we had almost two identical functions for removing an item from
the scene. There was only minor differences depending on whether the
item was removed from QGraphicsScene::removeItem or from the item's
destructor. Now we have one function that handles both cases just fine.
Reviewed-by: Andreas
|
| |
| |
| |
| |
| | |
We don't have to pass optimization flags; we already have a member
variable we can test for painter state protection.
|
| |
| |
| |
| |
| |
| | |
Removes a piece of code in 775ec8e96c9219981ff220ca5f3d24f0501d17b5
that was submitted by accident. The code in mouseMoveEvent is now
identical to that in master.
|
| |
| |
| |
| |
| |
| |
| |
| | |
If we pass the viewport widget as the widget pointer when rendering to
an arbitrary painter (e.g., onto a pixmap), we confuse the rendering
functions to thinking that it's the viewport's region we should render
into. So instead, when drawItems() is passed a painter that's different
from the view, we pass 0 for the widget.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change introduced an unexpected interdependency for scenes with
items that enable ItemStacksBehindParent, and that contain children
that are transformed. There's a manual test for this, called
clippingAndTransformations, which shows this problem.
The bug has been fixed and this change also includes an autotest that
covers exactly this problem.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This flag toggles whether we should send notifications for setPos,
setMatrix, and setTransform. It's off by default. Docs have been updated.
All autotests pass. This change also cleans up a bit so that we both
have readable code, and keeping the optimized path for when we need to
send the notifications.
By enabling this flag by default we are going to trigger regressions in
end-user code.
Reviewed-by: bnilsen
|
| |
| |
| |
| | |
See also: 1c9032f29d4500b33622d7510b6361c99d9af296
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 0fc58ca3220083b9e10f88aab2e39824c2764db3.
Conflicts:
src/gui/graphicsview/qgraphicsitem.cpp
src/gui/graphicsview/qgraphicsitem_p.h
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
properly pass to drawItemHelper.
The second is a double conversion to deviceTransform in createStyleOption
of QGraphicsItem. Since the recursive drawing already give a transform
in device mode we don't need to convert it two times.
Reviewed-by:andreas
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This reapply commit 8ad5020940f10d4ecc5c5e8b3b9656531cb84ef3 and its
dependent change that has been reverted while rebasing the
recursivepaint branch.
With the new properties it is possible to easily animate transformations
Reviewed-by: Andreas
Documentation still need to be reviewed.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
E.g. item->update(QRectF(0, 0, 5, 5)); item->update();
The problem was that we discarded all update requests whenever the item
was already marked as dirty. The dirty bit only means it has pending
updates (which might be a full update). However, we have a separate bit
for full updates (fullUpdatePending) so we have to check against that
bit instead.
Makes tst_QGraphicsProxyWidget::paintEvent happy.
Another auto-test included.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Once a _q_processDirtyItems call is queued, it means we at least have
one item that is marked as dirty and we must reset it when the
_q_processDirtyItems slot is called. The problem however, was that
we didn't reset the item's dirty state if a full scene update occurred
in between, i.e. item->update(); scene.update();
We don't have to calculate the item's dirty rect if a full scene update
occurs in between, but we still have to reset its state.
Auto-test included.
|
| |
| |
| |
| |
| | |
The problem was that we only marked the painted view bounding rect of
the moved item as dirty. We also have to mark its children.
|
| | |
|
| |
| |
| |
| | |
Use itemCollidesWithPath, the helper function.
|
| |
| |
| |
| |
| | |
The recursive items function didn't contain the special case check for
when the source and target rectangle are identical.
|
| |
| |
| |
| | |
Don't skip all indexed items that aren't transparent ;-).
|
| |
| |
| |
| |
| |
| | |
Make sure we don't claim that we have sorted all toplevel items when
we are using the BSP tree, as when painting we have only actually sorted
a subset of the elements.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Calling repaint() instead of update() is bad when having multiple
views (which GV perfectly supports). The result is that e.g. when
moving a chip in the chip demo, there's a visible lag between
each view. It can also be a performance killer on QWS, where
the surface is locked for each repaint().
Instead of calling repaint() we call update() as before, but we also
make sure the updates are processed immediately.
|
| |
| |
| |
| | |
Makes tst_QGraphicsItem::paint happy.
|
| |
| |
| |
| | |
Makes tst_QGraphicsItem::cacheMode happy.
|
| |
| |
| |
| |
| | |
Makes tst_QGraphicsScene::changedSignal and
tst_QGraphicsItem::setMatrix happy.
|
| |
| |
| |
| | |
Makes tst_QGraphicsScene::update happy.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We have to keep the growingItemsBoundingRect up-to-date if there's no
scene rect. The only difference now is that sceneRectChanged will not
be emitted before entering the event-loop, but the documentation
only states it'll be emitted when the scene rect changes, so we
consider it harmless.
Makes tst_QGraphicsView::sceneRect_growing and
tst_QGrahicsScene::sceneRect happy.
Reviewed-by: Andreas
|
| |
| |
| |
| | |
Partially fixes tst_QGraphicsScene::update failure.
|
| |
| |
| |
| |
| | |
This fixes one of two failures in tst_QGraphicsScene::items_QRectF_2.
The other seems unrelated.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The code marked the item's own stacking order as dirty when changing
its own Z value, the right thing is however to set the _parent's_ bit.
Also added missing code for when the ItemStacksBehindParent flag was
toggled.
Reviewed-by: bnilsen
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Test if the children ignore the parent's opacity if the current item's
opacity is 0.0. If any of the children do ignore the parent then we must
continue. Further optimizations are possible: if the item itself is
transparent, then don't visit children that don't ignore parent opacity.
Reviewed-by: bnilsen
|
| |
| |
| |
| |
| |
| |
| | |
See change 72842b2d, the patch misplaces 'p' and 'parent'. This fixes
the tst_QGraphicsItem::opacity autotests.
Reviewed-by: bnilsen
|