| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
New flag: QGraphicsItem::ItemNegativeZStacksBehindParent, which makes
it easy to toggle stack-behind based on the value of Z alone.
Add interface initializations to QGV classes.
Add a simple internal focus policy to QGraphicsItem to allow derived
items to be focusable without allowing clickfocus.
Reviewed-by: Alexis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change would have been much simpler if either QGraphicsItem
inherited QObject, or if we had some similar QPointer-like class that
supported QGraphicsItem. The issue is this: Each item can delegate
another item to be its focus proxy. That item can be a parent or child,
or something completely unrelated. Either of the two items can be
deleted independently.
The former solution was to store backpointers in a map in the scene.
Problem is, the items may not be in a scene when this happens, they
may be removed from the scene, and the items may be moved between
two scenes.
The bad part about this fix is that it adds another pointer to
QGraphicsItemPrivate.
Reviewed-by: Shane Kearns <shane.kearns@sosco.com>
|
|
|
|
| |
Reviewed-by: Trust Me
|
|\
| |
| |
| |
| |
| | |
Conflicts:
src/gui/graphicsview/qgraphicsitem.cpp
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
updateAncestorFlags was not reseting the flags if you change the parent
that have for instance itemsClipChildrenToShape to a new one that
doesn't have that flag.
Task-number:258956
Reviewed-by:bnilsen
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch allows for input hints to be set on a QGraphicsItem.
Input methods use such hints to define its appearance/behavior
(e.g. to allow for numerical input only).
Reviewed-by: ahanssen
Task-number: 254493
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The idea of having separate rotationX/Y/Z, shearX/Y, etc.
methods in QGraphicsItem turned out to be not giving us
the flexibility we need and wanted.
The new code now implements a different scheme, where we
keep simple rotate (around z-axis), scale and
transformOriginPoint methods, but remove the other ones.
Instead we now have an additional list of QGraphicsTransform
object. QGraphicsTransform is an abstract class that inherits
QObject. Several specializations are provided and can be
used to transform (and through property bindings animate)
the item.
Reviewed-By: Andreas
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If you set this flag on an item, and descendant item that gains input
focus will become this item's focus proxy. This simplifies how focus
proxy items are assigned from QML; instead of binding the possible
focusProxy property to a named child widget, this assignment happens
automatically as you set the focus property of a descendant to true.
As part of this change, QGraphicsWidget::focusWidget behavior has been
improved and moved into QGraphicsItem. For example, if you set focus on
an item that it's part of a scene, it can gain focus once the parent
has been assigned (which is how object trees are built in QML).
Autotests are included.
Reviewed-by: Michael Brasser
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Following QWidget's behavior, you can not assign any item in the
same scene as a focus proxy for another item. Also supports nested
focus proxies. You can only assign items in the same scene as
focus proxies. Autotests are included.
Reviewed-By: mbm
|
| |
| |
| |
| |
| |
| |
| | |
Several auto-tests failed on the Mac because the view get two paint events on the
first show. This is a bug in QWidget, but shouldn't make graphics view auto-tests
fail. Also, there's no difference between update() and repaint() on the
Mac.
|
| | |
|
| |
| |
| |
| |
| | |
A top-level window on Windows cannot have a smaller width than 120.
Increase the width by 20 and expect another row of items to be painted.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Found during manual testing (manualtests/graphicsview/movableitems).
Moving a child item (via its parent) outside the viewport, and then back again
didn't trigger an update on the child. Reason was that we had a cut-off
checking the wrong bit (geometryChanged). This bit means
exactly the same as the paintedViewBoundingRectsNeedRepaint bit, except
that it doesn't propagate to the children (and that's the bug).
We use paintedViewBoundingRectsNeedRepaint instead.
Auto-test included.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Found during manual testing (manualtests/graphicsview/untransformable).
At some point it was not possible to click on an untransformable item.
The problem was that none of the untransformable items were top-levels,
and none of the transformable top-level items were in the same area,
resulting in an empty list of estimated top-level items.
Auto-test included.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Found during manual testing (dndrobotinproxy). The problem was that the
paintedViewBoundingRect was set to an empty rect because the partial
update area didn't intersect with the viewport. The item itself was
partially inside the viewport. Then, when the item was moved, its old
area was not repainted due to this empty paintedViewBoundingRect.
Auto-test included.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The problem was that update() followed by hide() didn't work as
expected because the update() caused all sub-sequent update requests
to be discareded. This is correct, however, we have to make sure the
ignoreVisible/ignoreOpacity bit is set properly; we won't process a
hidden item otherwise.
Auto-test included.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We basically passed an unitialized transform to construct the
styleoptions for items that use the useExtendedStyleOption flag.
We had an auto-test to cover that but for some reason view.show() was
removed by me so the auto-test did nothing. oops.
Reviewed-by:bnilsen
|
|\ \
| |/
| |
| |
| |
| |
| |
| | |
Conflicts:
src/3rdparty/webkit/VERSION
src/3rdparty/webkit/WebCore/ChangeLog
src/3rdparty/webkit/WebKit/qt/ChangeLog
tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
|
| |
| |
| |
| | |
Reviewed-by: Andreas
|
| |
| |
| |
| | |
Explicit casts make aCC happy.
|
| |
| |
| |
| |
| |
| |
| | |
The ItemHasNoContents flag was preventing items that clip their children
from rendering their children at all. Fixed now.
Reviewed-by: bnilsen
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Reviewed-by: Trust Me
|
|\ \
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
demos/boxes/glshaders.cpp
src/gui/graphicsview/qgraphicsitem.cpp
tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
tools/linguist/shared/cpp.cpp
translations/linguist_ja.qm
translations/qt_ru.qm
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
Fixes the zValue autotest, which regressed when the member list was
added.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
Enable QGraphicsView::IndirectPainting to make sure it detects which
items are drawn.
|
| | |
|
|\ \
| |/
| |
| |
| | |
Conflicts:
tests/auto/qtreeview/tst_qtreeview.cpp
|
| |
| |
| |
| | |
Removed unused line and added task number to autotest.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When setVisible() is called on a QGraphicsItem, if the parent of that
item was hidden, the child shouldn't be actually shown.
Task-number: 197802
Reviewed-by: leo
Reviewed-by: alexis
|
| |
| |
| |
| |
| |
| | |
QGraphicsItem
Acknowledged-by: Thierry
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With the new properties it is possible to easily animate.
Setting a transform using setTransform is incompatible with thoses
properties. Accessing thoses propeties if you set previously a
transform will give you the default values.
Acknowledged-by: Code made with Andreas. Documentation written with Thierry.
This still need a more in depth code review and documentation review.
But it is urgent to commit now because the Animation API integration depends on it.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QStyleOptionGraphicsItem extends QStyleOption with three values:
1) matrix, 2) levelOfDetail, 3) exposedRect, and they all
involve expensive QTranform operations when calculated. We
pass style option(s) to drawItems() and paint(), but the
extended values are usually not in use. We can therefore gain
quite some nice speedup by making them opt-in with the
QGraphicsItem::ItemUsesExtendedStyleOption flag.
Additionally, QStyleOptionGraphicsItem::levelOfDetail has been
obsoleted, and a new function QStyleOptionGraphicsItem::
levelOfDetailFromTransform(const QTransform &) has been added.
Me and Andreas don't consider this change to be too controversial
even though it changes the behavior.
Auto tests still pass.
Reviewed-by: Andreas
|
|\ \
| |/
| |
| |
| | |
Conflicts:
tools/macdeployqt/shared/shared.cpp
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QGraphicsItem::deviceTransform() returns the item-to-device transform,
provided with the device-to-scene transform, and combining it with the
item's scene transform. This function is meant to handle items that
enable ItemIgnoresTransformations, but it happened to not work properly
for items that _don't_ enable that flag. Unfortunately this bug is
hard to work around for users from the outside, as it requires you to
check if the item or any ancestor enables ItemIgnoresTransformations.
The fix also removes unnecessary branchs inside QGV so that we use the
same function for all items.
Reviewed-by: bnilsen
|
|\ \
| |/
| |
| |
| |
| | |
Conflicts:
src/gui/kernel/qcocoaview_mac_p.h
src/gui/widgets/qmainwindow.cpp
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The problem was that we discarded update requests for fully
transparent items, which is correct, but we even did that
when the update was issued from QGraphicsItem::setOpacity.
We don't have to, and shouldn't, consider the opacity in
that case. Whenever we reach the fullUpdateHelper call in
setOpacity it means we have to do an update regardless of
the current opacity (oldOpacity was not 0.0 if the
currentOpacity is 0.0).
Auto-test included.
Task-number: 252913
Reviewed-by: Andreas
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
While working on layering in Graphics View I stumbled over this bug. The
QGraphicsItem::childrenBoundingRect() function had an accumulating error
caused by recursive adding of rectangles that individually were mapped to
the local parent using QGraphicsItem::mapRectToParent() /
QTransform::mapRect. This caused the brect to be way too large for items
with children that are rotated (fex, alternating 45 and -45 degrees).
The new version should be just as fast, but with no loss of precision.
Reviewed-by: bnilsen
|
|\ \
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes a bug in 4.5.0 where cached items that call update() after
they have been moved or transformed failed to get a call to paint(),
so the last cache image was used to draw. The easiest way to reproduce
this bug is in the Elastic Nodes example. If you press, wait, then
release, the nodes will consistently move to sunken state, then back
to normal state. But if you click quickly while moving the mouse, the
nodes will stay sunken.
The bug was that the item was marked as dirty as a result of being moved,
and when the mouse button was released, the node item's call to update()
was discarded, as the item was "already dirty".
The fix is to allow invalidation of the cache even if the item is
marked as dirty.
Reviewed-by: bnilsen
|