| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
hasConflicts() does only make sense for a tool/editor of the layout,
and how this function would help the tool is only guesswork at the
moment.
We keep the private API though, in order to let the autotests we
inherited from Orbit pass.
|
|
|
|
|
|
|
|
| |
This test would trigger random Q_ASSERT failures but should
work fine after the previous commit.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
|
|
|
|
|
| |
Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
|
|
|
|
| |
Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
|
|
|
| |
Currently this fails, so we have to use QEXPECT_FAIL.
|
|
|
|
|
|
|
|
|
|
| |
Added an auto test for the currently supported size policies set.
This is a simple test containing a single item anchored to the layout
vertical and horizontally. The size policies are set, then the
item's minimum, preferred and maximum sizes are compared to the
expected ones, according to each policy.
Signed-off-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
|
| |
|
|
|
|
| |
Pointed out by Caio.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Say hello to QGraphicsAnchor, move the spacing (and removeAnchor)
functionality over to that class.
This also opens up for a cleaner API when we add support for size
policies or min/pref/max sizes for anchors.
Also remove
- addLeftAndRightAnchors()
- addTopAndBottomAnchors()
- addAllAnchors()
in favor of
- addAnchors(itemA, itemB, Qt::Orientations)
API change discussed with Caio and Andreas.
Reviewed-by: Alexis
|
|
|
|
|
|
|
| |
Add a layoutDirection autotest, and sprinkle some of the tests
with checkReverseDirection()
Reviewed-by: Eduardo M. Fleury
|
|
|
|
| |
Reviewed-by: Trust Me
|
| |
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
| |
Reviewed-by: Trust Me
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The changes are:
* Move enums in QGraphicsAnchorLayout::Edge to Qt::AnchorPoint.
Prefix them with Anchor since they are not edges in general.
* Rename anchor() to addAnchor()
* Rename anchorCorner() -> addCornerAnchors()
* Rename anchorWidth() -> addLeftAndRightAnchors()
* Rename anchorHeight() -> addTopAndBottomAnchors()
* Rename anchorGeometry() -> addAllAnchors()
* remove the overloads that take a spacing argument, and add
setAnchorSpacing() to accommodate for that.
* Added anchorSpacing() (implementation missing)
* Added unsetAnchorSpacing(). (implementation missing)
* made sizeHint() protected.
Updated all examples and autotest to reflect this API change.
|
|
|
|
| |
This failed on Alexis' Mac Mini (Leopard)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit implements what's described in the previous commit
QGraphicsAnchorLayout: fix expected values for parallel test
When filling the sizeAt* values (the three points used for interpolation
when setting geometry), now sequential anchors distribute the sizes
to the children in a fair way, i.e. proportionally in relation to the
existing min/pref/max hints.
Each value is defined in relation of the pref (either as a shrinkage in
pref or a grow in pref). In both cases the shrinking/growing factor is
the same for all children.
When we implement support for QSizePolicies, this distribution might be
changed by setting size policies for a certain item or anchor.
This makes two tests work -- so no more expected fail. Also fixed a typo
in one test's expected results.
|
|
|
|
|
| |
Having the items named helps when using debugging functions to
identify the anchors. Cause no harm to add them to the tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When traversing the graph looking for calculating the distances, also
enter inside the complex edges to find (and calculate) the distances for
the vertices that were simplified.
This require a little tweak in the traversal, now we can't always skip an edge
when both vertices are already visited, because complex anchors can hide
vertices inside (a sequential anchor in practice remove vertices from the
full graph).
As a bonus we now pass on the 'example' test (as expected) and the
example now works fine.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We changed the parallel example because the expected values for
preferred size are wrong. Before we had a parallel anchor ("d|e") that
should have the maximum preferred of the both children, so this end up
being 170. This parallel is in a sequence with another item ("b") with
a preferred of 150 ending up with 320.
This group is in parallel with "c" that has a maximum of 300. So in
the preferred size of the layout, the group was constraint to 300,
which would be proportionally distributed between "b" and "d|e", and
50%/50% as the test expected.
The proportional distribution is a feature and we changed the test to
illustrate that more. We gave a bump in "c" maximum to 350 and "b"
maximum to 300, so the preferred is 100% for both "b" and "d|e", and
the proportional feature shows up in the maximum allocation, which is
not 100% for the group (b and d|e).
In the group, the maximum possible is 500 but the layout only allows
350, so the sizes need to be proportionally, but in relation not to
zero, but to the preferred which is 320 (this is the same logic used
for setGeometry()). So the growth is 30 / (500 - 320) = 30 / 180 = 1/6.
This 1/6 should be the factor given to the children (b and d|e),
taking their preferred sizes as starting points.
Note that the test still fails, but serve as a milestone to see when
the feature is correct implemented.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
|
|
|
|
|
|
|
|
|
|
| |
This test (which fails right now) check whether a sequential anchor is
distributing proportionally the size between its parts. This should pass
when we make calculateVertexPositions() work together with the simplified
graph.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adding tests that were helpful during debugging simplification
- example: a replica of the anchorlayout example, which has a few interesting
cases.
- parallel2: a small pararell test case, subset of example.
- snakeOppositeDirections: snake but with connections in the opposite
directions (this will end up with anchors with opposite directions).
- fairDistributionOppositeDirections: same as before, but in the end,
this should be taken care by our API which makes internally the same as
fairDistribution.
Some work on adding QCOMPARE() statements may still be needed for this
examples.
Note that is interesting to notice (maybe we can make this available
for the test checking automatically) whether the simplex is being used
or not when simplification is active.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes several related issues:
1. QGAL::anchor() had a spacing argument that defaulted to 0. That made
it impossible to know if the user meant that the spacing should be 0
or if the spacing should be picked from the style.
Instead we have to overload anchor, so now we have one function that
does not take spacing as an argument. That one will create an anchor
where the spacing is queried from the style. The other overload
allows the user to explicitly set the spacing, thus the default
spacing is ignored.
2. Make sure we pick up the spacing correctly from the style if needed.
setAnchorSizeHintsFromDefaults() will set the correct spacing on
anchors that was created without specifying a spacing value.
3. Add QGAL::anchor(Qt::Corner, ...) convenience function with an
overload (for the same reason as explained in 1.)
4. Added QGraphicsAnchorLayoutPrivate::anchor() as a helper function
that is called from all the 4 public API anchor() functions so that
we don't need to have duplicate code for argument checking etc.
5. Fix autotests. They assumed that anchor() without a spacing argument
created a spacing of 0.
|
|
Signed-off-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
|