| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Reviewed-by: Trust Me
|
| |
|
|
|
|
| |
Reviewed-by: janarve
|
|
|
|
| |
Reviewed-by: Trust Me
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Those are:
* setAnchorSpacing()
* anchorSpacing()
* unsetAnchorSpacing()
Autotests for the two last ones are missing though..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Need to work more on the overview.
|
|
|
|
| |
spacing.
|
|
|
|
| |
Hopefully we won't need it more...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to be consistent with QGraphicsGridLayout(QGGL), we remove the
void setSpacing(Qt::Orientations );
qreal spacing(Qt::Orientations );
in favor to
void setHorizontalSpacing(qreal spacing);
void setVerticalSpacing(qreal spacing);
void setSpacing(qreal spacing);
qreal horizontalSpacing() const;
qreal verticalSpacing() const;
The API for setting and retrieving spacings should now be the same as
in QGGL.
|
|
|
|
|
| |
This was done to avoid any potential shadowing problems (we already use
the variable name 'spacing' several places)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add variables to track whether the graph is simplified or not, as well
as make the functions that need it simplified/restored call the
corresponding functions. The functions look at the state variables, so
it's safe to just call them.
Also added Q_ASSERT() through the code paths that SHOULD have the full
graph (not simplified), for making easy to track bugs in future
refactorings.
Ironically this commit cause more calls to simplify/restore right now,
but the state will be better when we fix some functions to be
simplification compatible ;-)
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
|
|
|
|
|
|
|
|
| |
More user friendly API for anchor layouts. Changed method names
and also provided more methods to receive spacing.
Signed-off-by: Artur Duque de Souza <artur.souza@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were missing a call to "removeCenterAnchors" in the "removeAnchors"
method. To solve that, and also reduce the number of useless calls to
that method, this commit:
1) Calls it only from "removeInternalVertex"
2) Does some preliminary testing before calling it
3) Replace the former test inside "removeCenterAnchors" by a Q_ASSERT
It also adds other Q_ASSERTs to protect us from regression bugs.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
|
|
|
|
|
|
|
|
|
| |
Continuing the effort to enforcing center anchors to exist only
when needed, this commit removes the central anchors when they
are no longer used.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
Reviewed-by: Anselmo Lacerda S. de Melo <anselmo.melo@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.
|
|
|
|
|
|
|
| |
Using QGraphicsLayoutPrivate methods for proper reparenting of
items. This makes it work in cases where nested layouts are used.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous dumper relied on traversal of the graph, which meant that
it would not output the nodes that were not connected to the "main"
graph. Due to this, we cannot rely on traversal, so instead we must
iterate through all the vertices of the graph. As an added bonus the
code gets simpler :-)
There was also a problem with the previous dumper, since it dumped
two "digraph" elements into one file. Graphwiz (win32) did not handle
that. Instead just dump all the nodes and all the connections, both
horizontal and vertical ones. The horizontal and vertical connections
are never connected anyway, so the result will be two separate graphs
when it is rendered by graphwiz.
Also renamed firstVertex to rootVertex and simplified it.
|
|
|
|
|
|
|
|
|
|
| |
Each time an item is added to the layout, center constraits are
created to ensure its internal anchors keep their size equal.
To avoid memory leaks, we must delete them when the item is
removed.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
|
|
|
|
|
| |
Removed an obsolete delete d_ptr, since it is not needed anymore.
Signed-off-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
|
|
|
|
|
|
|
|
| |
In the public Qt::Orientation enum, Horizontal and Vertical mean
0x1 and 0x2 respectivelly, this was causing the internal data
structure to be accessed in positions 0 and 2 instead of 0 and 1.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
|
|
|
|
|
| |
Applying the patch sent by email.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the itemCenterConstraints that are created when an item
is added to the layout are never being deleted.
Ideally this should be done by the time the item is removed from
the layout, this requires some changes in the data structures used
though. As a temporary solution we keep all of them until the
layout is destroyed.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
|
|
|
|
|
|
| |
The internal layout anchors were leaking, now we delete them when
destroying the layout.
Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
|
|
|
|
| |
Signed-off-by: Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
|
|
This is a total re-written implementation of QGraphicsAnchorLayout using
a numerical approach. We use QGraph and QSimplex in order to achieve this.
This first commit gives us a just ready-to-use qgraphicslayout, but the
private class still need to inherit from qgraphicslayoutprivate. Optimizations
and documentation are all work in progress.
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>
|