4#ifndef QGRAPHICSLAYOUT_P_H
5#define QGRAPHICSLAYOUT_P_H
18#include <QtWidgets/private/qtwidgetsglobal_p.h>
22#include <QtWidgets/qstyle.h>
23#include <QtWidgets/qwidget.h>
24#include <QtWidgets/qstyleoption.h>
30class QGraphicsLayoutItem;
34inline bool qt_graphicsLayoutDebug()
36 static int checked_env = -1;
37 if (checked_env == -1)
38 checked_env = !!qEnvironmentVariableIntValue(
"QT_GRAPHICSLAYOUT_DEBUG");
53 m_styleOption.initFrom(widget);
54 m_defaultSpacing[0] = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing, &m_styleOption, widget);
55 m_defaultSpacing[1] = style->pixelMetric(QStyle::PM_LayoutVerticalSpacing, &m_styleOption, widget);
58 inline void invalidate() { m_valid =
false; m_style =
nullptr; m_widget =
nullptr; }
64 {
return m_style == other.m_style && m_widget == other.m_widget; }
66 {
return !(*
this == other); }
70 m_defaultSpacing[
int(o) - 1] = spacing;
74 return m_defaultSpacing[
int(o) - 1];
78 QSizePolicy::ControlType control2,
79 Qt::Orientation orientation)
const
82 return style()->layoutSpacing(control1, control2, orientation, &m_styleOption, widget());
88 QStyleOption m_styleOption;
89 qreal m_defaultSpacing[2];
94 Q_DECLARE_PUBLIC(QGraphicsLayout)
97 QGraphicsLayoutPrivate() : QGraphicsLayoutItemPrivate(
nullptr,
true), left(-1.0), top(-1.0), right(-1.0), bottom(-1.0),
100 void reparentChildItems(QGraphicsItem *newParent);
101 void getMargin(qreal *result, qreal userMargin, QStyle::PixelMetric pm)
const;
102 Qt::LayoutDirection visualDirection()
const;
104 void addChildLayoutItem(QGraphicsLayoutItem *item);
105 void activateRecursive(QGraphicsLayoutItem *item);
107 qreal left, top, right, bottom;
void setSizePolicy(QSizePolicy::Policy policy)
~QGraphicsAnchorPrivate()
QSizePolicy::Policy sizePolicy
static QGraphicsAnchorPrivate * get(QGraphicsAnchor *q)
QGraphicsAnchorLayoutPrivate * layoutPrivate
void setSpacing(qreal value)
void setDefaultSpacing(Qt::Orientation o, qreal spacing)
bool operator==(const QLayoutStyleInfo &other) const
bool operator!=(const QLayoutStyleInfo &other) const
qreal perItemSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation) const
qreal defaultSpacing(Qt::Orientation o) const
QLayoutStyleInfo(QStyle *style, QWidget *widget)
QSet< AnchorData * > negatives
QSet< AnchorData * > positives
QSimplexConstraint * constraint(const GraphPath &path) const
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(animation)
Q_DECLARE_TYPEINFO(GraphPath, Q_RELOCATABLE_TYPE)
virtual void updateChildrenSizes()
void refreshSizeHints(const QLayoutStyleInfo *styleInfo=nullptr)
QGraphicsLayoutItem * item
QGraphicsAnchor * graphicsAnchor
AnchorVertexPair(AnchorVertex *v1, AnchorVertex *v2, AnchorData *data)
AnchorData * m_removedAnchor
QList< AnchorData * > m_secondAnchors
QList< AnchorData * > m_firstAnchors
AnchorVertex(QGraphicsLayoutItem *item, Qt::AnchorPoint edge)
virtual ~AnchorVertex()=default
QGraphicsLayoutItem * m_item
virtual void updateChildrenSizes() override
ParallelAnchorData(AnchorData *first, AnchorData *second)
QList< QSimplexConstraint * > m_secondConstraints
bool calculateSizeHints()
QList< QSimplexConstraint * > m_firstConstraints
bool secondForward() const
virtual void updateChildrenSizes() override
const QList< AnchorData * > m_edges
SequentialAnchorData(const QList< AnchorVertex * > &vertices, const QList< AnchorData * > &edges)
void calculateSizeHints()