Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgraphicslayoutitem_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QGRAPHICSLAYOUTITEM_P_H
6#define QGRAPHICSLAYOUTITEM_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of other Qt classes. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtWidgets/private/qtwidgetsglobal_p.h>
20#include <QtCore/QSizeF>
21#include <QtWidgets/QSizePolicy>
22
23QT_REQUIRE_CONFIG(graphicsview);
24
25QT_BEGIN_NAMESPACE
26
27class QGraphicsLayoutItem;
28class Q_AUTOTEST_EXPORT QGraphicsLayoutItemPrivate
29{
30 Q_DECLARE_PUBLIC(QGraphicsLayoutItem)
31public:
32 virtual ~QGraphicsLayoutItemPrivate();
33 QGraphicsLayoutItemPrivate(QGraphicsLayoutItem *parent, bool isLayout);
34 static QGraphicsLayoutItemPrivate *get(QGraphicsLayoutItem *q) { return q->d_func();}
35 static const QGraphicsLayoutItemPrivate *get(const QGraphicsLayoutItem *q) { return q->d_func();}
36
37 void init();
38 QSizeF *effectiveSizeHints(const QSizeF &constraint) const;
39 QGraphicsItem *parentItem() const;
40 void ensureUserSizeHints();
41 void setSize(Qt::SizeHint which, const QSizeF &size);
42 enum SizeComponent { Width, Height };
43 void setSizeComponent(Qt::SizeHint which, SizeComponent component, qreal value);
44
45 bool hasHeightForWidth() const;
46 bool hasWidthForHeight() const;
47
48 QSizePolicy sizePolicy;
49 QGraphicsLayoutItem *parent;
50
51 QSizeF *userSizeHints;
52 mutable QSizeF cachedSizeHints[Qt::NSizeHints];
53 mutable QSizeF cachedConstraint;
54 mutable QSizeF cachedSizeHintsWithConstraints[Qt::NSizeHints];
55
56 mutable quint32 sizeHintCacheDirty : 1;
57 mutable quint32 sizeHintWithConstraintCacheDirty : 1;
58 quint32 isLayout : 1;
59 quint32 ownedByLayout : 1;
60
61 QGraphicsLayoutItem *q_ptr;
62 QRectF geom;
63 QGraphicsItem *graphicsItem;
64};
65
66QT_END_NAMESPACE
67
68#endif //QGRAPHICSLAYOUTITEM_P_H
void setSizePolicy(QSizePolicy::Policy policy)
static QGraphicsAnchorPrivate * get(QGraphicsAnchor *q)
QGraphicsAnchorLayoutPrivate * layoutPrivate
The QGraphicsLayout class provides the base class for all layouts in Graphics View.
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
QWidget * widget() const
QStyle * style() const
QLayoutStyleInfo(QStyle *style, QWidget *widget)
QSimplexConstraint * constraint(const GraphPath &path) const
QT_REQUIRE_CONFIG(animation)
Q_DECLARE_TYPEINFO(GraphPath, Q_RELOCATABLE_TYPE)
QT_REQUIRE_CONFIG(graphicsview)
Q_DECLARE_INTERFACE(QNetworkAccessBackendFactory, QNetworkAccessBackendFactory_iid)
void refreshSizeHints(const QLayoutStyleInfo *styleInfo=nullptr)
AnchorVertexPair(AnchorVertex *v1, AnchorVertex *v2, AnchorData *data)
AnchorVertex(QGraphicsLayoutItem *item, Qt::AnchorPoint edge)
ParallelAnchorData(AnchorData *first, AnchorData *second)
SequentialAnchorData(const QList< AnchorVertex * > &vertices, const QList< AnchorData * > &edges)