| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
It is not actually useful (exact same READ/WRITE as objectName) and is
confusing when used in QML.
Task-number: QTBUG-6580
Reviewed-by: andreas
Reviewed-by: alexis
Reviewed-by: ogoffart
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QWidget
with setGraphicsEffect(0).
The effect was not deleted in that case, problem solved for both QGraphicsItem
and QWidget.
Autotest included.
Task-number: QTBUG-5917
Reviewed-by: bnilsen
|
|\ |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Pressing and releasing the finger/stylus on an editable text widget should
only trigger the input method if the release position is still within the
widget's boundaries.
Reviewed-by: axis
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | |/
| |/|
| | |
| | |
| | |
| | | |
Same fix as e7a10b00be3e4aa197900ecf424e6d44b07248ae
Reviewed-by: Alexis
|
| |/
| |
| |
| |
| |
| | |
- Remove a lie.
- When referring to the size of an anchor, refer to it consistently as
'spacing' instead of magnitude.
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We cannot delete the parallel anchors before we do the actual vertex
restoration, since the parallel anchors created by vertex simplification
will always be connected to some of the AnchorVertexPair found in
simplifiedVertices that we iterate over later.
Thus, we must delete the parallel anchors created by vertex
simplification after we have done the restoration of the vertices. (the
parallel anchor will be properly dealt with (i.e. taken out of the
graph as we do the restoration)), so not deleting it won't cause it to
be revisited later if that is a worry.
Reviewed-by: Eduardo M. Fleury
|
| |
| |
| |
| |
| | |
It is both a limit and an offset (the offset is dictated by the limit),
but in the code is it interpreted as an offset.
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
git://gitorious.org/~fleury/qt/fleury-openbossa-clone into fleury-ooo-sequential
Conflicts:
tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
These assert messages are no longer valid since some anchors can have
their size not respected if they are in parallel with the layout and
have size equal to "QWIDGETSIZE_MAX".
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With the addition of min and maxPrefSizeHints, the logic used in the
preferred simplex had to be changed. The concept behind it is still
the same, we minimize the deviation from each item's preferred size.
Previously we would make an special effort to avoid items being shrunk,
that's why the "shinker" simplex variables had larger multipliers in
the objective function.
Now we still have variables with large multipliers and others with
small mutlipliers, but rather than differentiating between shrinker
and/or grower variables, we classify them as "soft" or "hard".
"Soft" variables, or slacks, are those that allow the anchor to change
its value up to the minPref or maxPref boundaries, OTOH, "hard" slacks
are those that allow the item to go all the way to its minimum or
maximum sizes. Naturally, the "hard" slacks get large coeficients
in the objective function while the "soft" ones get small ones.
Now all the slack variables are restricted in size as to respect
the boundaries of each interval:
- Minimum to MinimumPreferred,
- MinimumPreferred to Preferred,
- Preferred to MaximumPreferred and
- MaximumPreferred to Maximum
With such limits, the SizeHint constraints became redundant in the
calculation of preferred sizes so they are no longer used.
Additionally, as an optimization, if a given interval is NULL
(for instance, MinimumPreferred is equal to Preferred), then
the associated slack variable would have its size restricted to
zero, therefore it is not created at all.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
With the addition of out-of-order sequential simplification,
the calculation of preferred sizes became more complicated.
In the past, when parallel anchors or the simplex solver had to
decide between conflicting preferred sizes, they could assume that
increasing the size of an anchor was better than decreasing it.
That assumption comes from early discussions with Jan-Arve
regarding the preferred size calculation algorithm.
However, when ooo-sequential anchors exist, we can have a situation
where increasing the size of an anchor can actually reduce the size
of a simplified anchor inside it. To solve that, we need to expose
some information regarding the internal anchors to the decision
makers outside, ie. the simplex solver and parallel anchors.
This information is now being provided in terms of two additional
values present in each anchor, as follows:
- minPrefSize: Always in the interval [minSize, prefSize].
Denotes the minimum size an anchor can assume
as to avoid shrinking anchors below their
preferred sizes.
- maxPrefSize: Always in the interval [prefSize, maxSize].
Similar to the value above, but refering to
the maximum size the anchor should assume.
Some examples:
1) Standard anchor:
10 / 50 / 500
o---------------------------->
Becomes:
10 / 50 / 50 / 500 / 500
o---------------------------->
We'd rather grow than shrink, so we say that our preferred size
is 50, but if we need to grow up to 500, that's OK.
Note that we are still able to shrink all the way to 10, but
it will hurt us more.
2) Two anchors:
100 / 200 / 500 10 / 20 / 40
o--------------------> <-------------------o
Resulting sequential anchor:
60 / 160 / 180 / 480 / 490
o------------------------------------------>
The resulting anchor have a preferred size of 180 but it can
"easily" grow to 480 (only the first half grows). If it had
to go all the way to 490 the second half would have to shrink
below its preferred size.
OTOH, if it had to shrink, it could go to 160 if the second
half grew. However, shrinking even more, towards 60, would
require the first half to shrink below its preferred size.
With this information parallel and simplex are now able to choose
the best solutions when solving conflicts.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For an out-of-order parallel anchor, i.e. when the second child is
backwards in relation to the parallel anchor, we need to fix the
constraints that used to have the second child.
The parallel anchor will replace its child, but we must change the
multiplier signal, so the constraint remain valid.
This commit also changes the order of restoration steps, since now we
depend on correct vertex information to fix back the constraints, we do
it before the restoring of pair vertices.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In a parallel anchor, the second child anchor may be forward or
backwards in relation to the parallel itself. Moves the directionality
check to a function. It'll be useful in the next commit.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Modify the "dot" format graph to use a single arrow between each
pair of vertices.
Previously we would use two anchors (a black forward one and a
gray backwards). With a single arrow the graph loooks cleaner.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Modify the simplification code to allow the creation of out-of-order
sequential anchors.
Basically the "changedDirection" end-of-sequence condition was removed,
also note that createSequence no longer bothers to revert the direction
of anchors if the order it receives is not standard.
Removing expect-fail clause from test since now we pass :-)
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Now sequential anchors account for the fact they may be composed of
anchors with different directions.
Both refreshSizeHints and updateChildrenSizes have been updated
to support this situation.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since we now support anchors with size less then zero, we no longer
need to revert anchors with negative spacing.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit is groundwork for the support of negative-sized anchors
by the simplex solver.
The idea is to add to all variables an offset large enough to ensure
they are never negative. The implementation limits all variable
sizes in the range [-limit, limit] and feed them into the simplex
with an offset of "limit". Subtracting this offset later to find out
the real values.
"limit" is defined as QWIDGETSIZE_MAX for platforms where qreal is
double and as QWIDGETSIZE_MAX / 32 when it is float. This is to
avoid numerical errors in the simplex solver.
This commit also modifies the ASSERT clause inside QSimplex so it
becomes less prone to false positives due to numerical errors.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Former name did not reflect actual work done by the function.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fixing QGraphicsAnchor memory leak and access to free'd region.
-- Leak:
User-created anchors have two representations in QGAL, one
visible externally (QGraphicsAnchor) and other internal (AnchorData).
When such anchors are removed externally (QGraphicsAnchor is deleted),
the former implementation ensured that the internal representation
would be deleted too. However the opposite was not true. In cases
where the anchors are deleted internally (in the layout destructor,
for instance, or when an item is removed through the removeAt API),
the public QGraphicsAnchor object would leak.
This commit ensures the deletion will happen in both directions
and adds protection to avoid a deletion loop.
-- Invalid read:
In QGAL::removeAnchor(vertex1, vertex2), we read vertex information
after calling removeAnchor_helper(vertex1, vertex2).
The problem is that in cases where the removed anchor is the last
anchor to connect to a center vertex, its removal will cause also
the removal of such vertex. Thus, accessing the vertices after
the removeAnchor_helper() call is unsafe.
To solve that we cache the information we need and then clear the
vertex pointers to avoid errors in the future.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Adding check to prevent the structural layout anchors as well as
those internal to items, from being exposed through the public API.
These checks also ensure no QGraphicsAnchor instances will be
created for those anchors.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
After a default spacing is set through QGAL::setSpacing() family
of methods, the user must be able to unset it.
To avoid adding another public method, we enabled this feature
by allowing a negative value to be passed to those methods.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
When receiving the polish event, we call updateFont only if the font
has changed (from the QApplication::font()). This avoid to clear sizeHints
cache.
Task-number:QTBUG-6272
Reviewed-by:janarve
|
|\ \ |
|
| |\ \
| | |/
| |/| |
|
| |\ \ |
|
| |\ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | | |
Reviewed-by: Trust Me
|
|\ \ \ \ \
| |_|_|_|/
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | | |
git://gitorious.org/~fleury/qt/fleury-openbossa-clone into fleury-fixes
Conflicts:
tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
After a default spacing is set through QGAL::setSpacing() family
of methods, the user must be able to unset it.
To avoid adding another public method, we enabled this feature
by allowing a negative value to be passed to those methods.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The method "constraintsFromSizeHints" does not create constraints for
anchors between the layout vertices _only if_ these anchors have
infinite maximum sizes. However, this test was not being done for
half-anchors, ie. those created when the layout center anchorage
point is used.
That was OK when there was no chance that the center anchors had
been simplified by a parallel anchor. Nowadays there's a chance
that happens, so the test was extended.
Commit also adds a test to avoid regressions.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In the preferred size calculation, we should not add 'layout anchors'
(either one or the two halves) into the objective function, since the
layout doesn't impose or prefer any size at all.
This already worked for cases when the layout anchor is one, but not
when we have two halves. The mechanism was a 'skipInPreferred' flag
that were not being set.
The flag is pretty much redundant right now, since we can get this
information from the 'isLayoutAnchor' flag. So, the flag was removed
and a test was added for both a parallel case with the entire layout
and other with half of the layout (which wasn't passing before).
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
was corrupted.
This nasty bug was triggered when the index sort the top level list of
items. We forgot to set the flag topLevelSequentialOrdering to false
so when an item was removed from the top level list it was using the
sibling index which can be not valid anymore since the list is not
sorted by sequential order. So it let some dangling pointers in the
list which make processDirtyItemRecursive crash the next paint event.
Reviewed-by:bnilsen
Reviewed-by:andreas
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Some applications call setDefaultTextColor in the paint event.
Task-number: QTBUG-6242
Reviewed-by: Gabriel
|
| | | |
| | | |
| | | |
| | | |
| | | | |
maybeDirtyClipPath and ingoreClipping is not relevant anymore now that
the cached clip path is removed.
|
| |_|/
|/| |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The cache was added in 4.5 and was useful at that time. With 4.6
it is not relevant anymore since the only use case for it is item-lookup
releated to mouse events and collision detection, so the overhead of
maintaining the cache is more pain than gain.
All existing auto tests pass.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Problem was that pending updates were not dispatched properly on the
Mac, which is strongly required in order to get correct behavior wrt
QGraphicsItem::update().
Task-number: QTBUG-4160
Reviewed-by: bnilsen
|
|\ \ \
| |/ /
|/| |
| | | |
git://gitorious.org/~fleury/qt/fleury-openbossa-clone into fleury-fixes2
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The method "constraintsFromSizeHints" does not create constraints for
anchors between the layout vertices _only if_ these anchors have
infinite maximum sizes. However, this test was not being done for
half-anchors, ie. those created when the layout center anchorage
point is used.
That was OK when there was no chance that the center anchors had
been simplified by a parallel anchor. Nowadays there's a chance
that happens, so the test was extended.
Commit also adds a test to avoid regressions.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In the preferred size calculation, we should not add 'layout anchors'
(either one or the two halves) into the objective function, since the
layout doesn't impose or prefer any size at all.
This already worked for cases when the layout anchor is one, but not
when we have two halves. The mechanism was a 'skipInPreferred' flag
that were not being set.
The flag is pretty much redundant right now, since we can get this
information from the 'isLayoutAnchor' flag. So, the flag was removed
and a test was added for both a parallel case with the entire layout
and other with half of the layout (which wasn't passing before).
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The problem was that the 'exposed rectangle' passed to the Item's paint() function was rounded to Int values, whereas the one passed to drawBackground and drawForeground was not.
Autotest included.
Task-number: QTBUG-5859
Reviewed-by: bnilsen
|
|/
|
|
| |
Task-number: QTBUG-5968
|
|
|
|
| |
Over src/ tools/ examples/ and demos/
|