34 Q_PROPERTY(QQuickAnchorLine left READ left WRITE setLeft RESET resetLeft NOTIFY leftChanged FINAL)
35 Q_PROPERTY(QQuickAnchorLine right READ right WRITE setRight RESET resetRight NOTIFY rightChanged FINAL)
36 Q_PROPERTY(QQuickAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter NOTIFY horizontalCenterChanged FINAL)
37 Q_PROPERTY(QQuickAnchorLine top READ top WRITE setTop RESET resetTop NOTIFY topChanged FINAL)
38 Q_PROPERTY(QQuickAnchorLine bottom READ bottom WRITE setBottom RESET resetBottom NOTIFY bottomChanged FINAL)
39 Q_PROPERTY(QQuickAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter NOTIFY verticalCenterChanged FINAL)
40 Q_PROPERTY(QQuickAnchorLine baseline READ baseline WRITE setBaseline RESET resetBaseline NOTIFY baselineChanged FINAL)
41 Q_PROPERTY(qreal margins READ margins WRITE setMargins NOTIFY marginsChanged FINAL)
42 Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin RESET resetLeftMargin NOTIFY leftMarginChanged FINAL)
43 Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin RESET resetRightMargin NOTIFY rightMarginChanged FINAL)
44 Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged FINAL)
45 Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin RESET resetTopMargin NOTIFY topMarginChanged FINAL)
46 Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin RESET resetBottomMargin NOTIFY bottomMarginChanged FINAL)
47 Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged FINAL)
48 Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged FINAL)
49 Q_PROPERTY(QQuickItem *fill READ fill WRITE setFill RESET resetFill NOTIFY fillChanged FINAL)
50 Q_PROPERTY(QQuickItem *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged FINAL)
51 Q_PROPERTY(
bool alignWhenCentered READ alignWhenCentered WRITE setAlignWhenCentered NOTIFY centerAlignedChanged FINAL)
53 QML_ADDED_IN_VERSION(2, 0)
56 QQuickAnchors(QQuickItem *item, QObject *parent=
nullptr);
57 ~QQuickAnchors() override;
60#if defined(Q_CC_CLANG) || !defined(Q_CC_GNU)
73 BaselineAnchor = 0x40,
74 Horizontal_Mask = LeftAnchor | RightAnchor | HCenterAnchor,
75 Vertical_Mask = TopAnchor | BottomAnchor | VCenterAnchor | BaselineAnchor
77 Q_DECLARE_FLAGS(Anchors, Anchor)
80 QQuickAnchorLine left()
const;
81 void setLeft(
const QQuickAnchorLine &edge);
84 QQuickAnchorLine right()
const;
85 void setRight(
const QQuickAnchorLine &edge);
88 QQuickAnchorLine horizontalCenter()
const;
89 void setHorizontalCenter(
const QQuickAnchorLine &edge);
90 void resetHorizontalCenter();
92 QQuickAnchorLine top()
const;
93 void setTop(
const QQuickAnchorLine &edge);
96 QQuickAnchorLine bottom()
const;
97 void setBottom(
const QQuickAnchorLine &edge);
100 QQuickAnchorLine verticalCenter()
const;
101 void setVerticalCenter(
const QQuickAnchorLine &edge);
102 void resetVerticalCenter();
104 QQuickAnchorLine baseline()
const;
105 void setBaseline(
const QQuickAnchorLine &edge);
106 void resetBaseline();
108 qreal leftMargin()
const;
109 void setLeftMargin(qreal);
110 void resetLeftMargin();
112 qreal rightMargin()
const;
113 void setRightMargin(qreal);
114 void resetRightMargin();
116 qreal horizontalCenterOffset()
const;
117 void setHorizontalCenterOffset(qreal);
119 qreal topMargin()
const;
120 void setTopMargin(qreal);
121 void resetTopMargin();
123 qreal bottomMargin()
const;
124 void setBottomMargin(qreal);
125 void resetBottomMargin();
127 qreal margins()
const;
128 void setMargins(qreal);
130 qreal verticalCenterOffset()
const;
131 void setVerticalCenterOffset(qreal);
133 qreal baselineOffset()
const;
134 void setBaselineOffset(qreal);
136 QQuickItem *fill()
const;
137 void setFill(QQuickItem *);
140 QQuickItem *centerIn()
const;
141 void setCenterIn(QQuickItem *);
142 void resetCenterIn();
144 Anchors usedAnchors()
const;
145 Qt::Orientations activeDirections()
const;
149 bool alignWhenCentered()
const;
150 void setAlignWhenCentered(
bool);
153 void componentComplete();
159 void bottomChanged();
160 void verticalCenterChanged();
161 void horizontalCenterChanged();
162 void baselineChanged();
164 void centerInChanged();
165 void leftMarginChanged();
166 void rightMarginChanged();
167 void topMarginChanged();
168 void bottomMarginChanged();
169 void marginsChanged();
170 void verticalCenterOffsetChanged();
171 void horizontalCenterOffsetChanged();
172 void baselineOffsetChanged();
173 void centerAlignedChanged();
176 friend class QQuickItemPrivate;
177 Q_DISABLE_COPY(QQuickAnchors)
178 Q_DECLARE_PRIVATE(QQuickAnchors)
bool calcStretch(QQuickItem *edge1Item, QQuickAnchors::Anchor edge1Line, QQuickItem *edge2Item, QQuickAnchors::Anchor edge2Line, qreal offset1, qreal offset2, QQuickAnchors::Anchor line, qreal &stretch) const