42 #ifndef QGRAPHICSANCHORLAYOUT_P_H 43 #define QGRAPHICSANCHORLAYOUT_P_H 56 #include <QGraphicsWidget> 57 #include <private/qobject_p.h> 63 #ifndef QT_NO_GRAPHICSVIEW 128 minSize(0), prefSize(0), maxSize(0),
129 minPrefSize(0), maxPrefSize(0),
130 sizeAtMinimum(0), sizeAtPreferred(0),
131 sizeAtMaximum(0), item(0), graphicsAnchor(0),
133 isCenterAnchor(false), orientation(0),
134 dependency(Independent) {}
141 void dump(
int indent = 2);
194 :
AnchorData(), m_children(vertices), m_edges(edges)
197 orientation = m_edges.at(0)->orientation;
203 virtual void updateChildrenSizes();
204 void calculateSizeHints();
213 :
AnchorData(), firstEdge(first), secondEdge(second)
220 ((first->
from == second->
to) && (first->
to == second->
from)));
231 virtual void updateChildrenSizes();
232 bool calculateSizeHints();
238 return firstEdge->from == secondEdge->from;
250 :
AnchorVertex(), m_first(v1), m_second(v2), m_removedAnchor(data) {
302 itemName = item->
data(0).toString();
306 return edge.
arg(itemName);
349 void setSpacing(
qreal value);
351 qreal spacing()
const;
387 MinimumToMinPreferred = 0,
390 MaxPreferredToMaximum
407 return q ? q->d_func() : 0;
417 if (orientation ==
Vertical &&
int(edge) <= 2)
419 else if (orientation ==
Horizontal &&
int(edge) >= 3) {
426 void createLayoutEdges();
427 void deleteLayoutEdges();
477 void calculateGraphs();
483 bool simplifyGraphIteration(
Orientation orientation,
bool *feasible);
489 void restoreSimplifiedGraph(
Orientation orientation);
490 void restoreSimplifiedAnchor(
AnchorData *edge);
503 void constraintsFromPaths(
Orientation orientation);
512 return m_vertexList.value(itemEdge).first;
517 return internalVertex(
qMakePair(const_cast<QGraphicsLayoutItem *>(item), edge));
522 if (layoutFirstVertex[orientation] == oldV)
523 layoutFirstVertex[orientation] = newV;
524 else if (layoutCentralVertex[orientation] == oldV)
525 layoutCentralVertex[orientation] = newV;
526 else if (layoutLastVertex[orientation] == oldV)
527 layoutLastVertex[orientation] = newV;
535 void setItemsGeometries(
const QRectF &geom);
537 void calculateVertexPositions(
Orientation orientation);
538 void setupEdgesInterpolation(
Orientation orientation);
546 bool hasConflicts()
const;
586 bool graphHasConflicts[2];
589 #if defined(QT_DEBUG) || defined(Q_AUTOTEST_EXPORT) 590 bool lastCalculationUsedSimplex[2];
601 #endif //QT_NO_GRAPHICSVIEW
bool secondForward() const
Represents an edge (anchor) in the internal graph.
QIntegerForSizeof< void * >::Unsigned quintptr
QGraphicsAnchor * acquireGraphicsAnchor(AnchorData *data)
#define QT_END_NAMESPACE
This macro expands to.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
QList< QSimplexConstraint * > m_firstConstraints
AnchorVertex * internalVertex(const QGraphicsLayoutItem *item, Qt::AnchorPoint edge) const
QGraphicsItem * graphicsItem() const
Returns the QGraphicsItem that this layout item represents.
QGraphicsLayoutItem * item
T & first()
Returns a reference to the first item in the vector.
The QGraphicsAnchor class represents an anchor between two items in a QGraphicsAnchorLayout.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
QHash< QPair< QGraphicsLayoutItem *, Qt::AnchorPoint >, QPair< AnchorVertex *, int > > m_vertexList
static Qt::AnchorPoint pickEdge(Qt::AnchorPoint edge, Orientation orientation)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
The QHash class is a template class that provides a hash-table-based dictionary.
QGraphicsAnchor * graphicsAnchor
The QVector class is a template class that provides a dynamic array.
Representation of a valid path for a given vertex in the graph.
QGraphicsAnchorLayoutPrivate * layoutPrivate
QChar * data()
Returns a pointer to the data stored in the QString.
ParallelAnchorData(AnchorData *first, AnchorData *second)
QList< QSimplexConstraint * > m_secondConstraints
QLayoutStyleInfo cachedStyleInfo
QSet< AnchorData * > negatives
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
QList< AnchorData * > m_secondAnchors
static const char * data(const QByteArray &arr)
SequentialAnchorData(const QVector< AnchorVertex *> &vertices, const QVector< AnchorData *> &edges)
QGraphicsLayoutItem * m_item
The QGraphicsLayoutItem class can be inherited to allow your custom items to be managed by layouts...
QVector< QGraphicsLayoutItem * > items
QList< AnchorData * > m_firstAnchors
The QGraphicsAnchorLayout class provides a layout where one can anchor widgets together in Graphics V...
bool isLayout() const
Returns true if this QGraphicsLayoutItem is a layout (e.g., is inherited by an object that arranges o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
#define Q_DECLARE_PUBLIC(Class)
AnchorVertexPair(AnchorVertex *v1, AnchorVertex *v2, AnchorData *data)
QSet< AnchorData * > positives
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
QVector< AnchorVertex * > m_children
T & last()
Returns a reference to the last item in the vector.
uint calculateGraphCacheDirty
#define Q_AUTOTEST_EXPORT
static QString dump(const QByteArray &)
void changeLayoutVertex(Orientation orientation, AnchorVertex *oldV, AnchorVertex *newV)
AnchorData * m_removedAnchor
AnchorVertex(QGraphicsLayoutItem *item, Qt::AnchorPoint edge)
QSizePolicy::Policy sizePolicy
AnchorVertex * internalVertex(const QPair< QGraphicsLayoutItem *, Qt::AnchorPoint > &itemEdge) const
QString & insert(int i, QChar c)
QGraphicsAnchorLayout private methods and attributes.
QVector< AnchorData * > m_edges
The QList class is a template class that provides lists.
virtual void updateChildrenSizes()