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
qlayout_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 QLAYOUT_P_H
6#define QLAYOUT_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 qlayout*.cpp, and qabstractlayout.cpp. This header
14// file may change from version to version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtWidgets/private/qtwidgetsglobal_p.h>
20#include "private/qobject_p.h"
21#include "qstyle.h"
22#include "qsizepolicy.h"
23
24QT_BEGIN_NAMESPACE
25
26class QWidgetItem;
27class QSpacerItem;
28class QLayoutItem;
29
30class Q_WIDGETS_EXPORT QLayoutPrivate : public QObjectPrivate
31{
32 Q_DECLARE_PUBLIC(QLayout)
33
34public:
35 typedef QWidgetItem * (*QWidgetItemFactoryMethod)(const QLayout *layout, QWidget *widget);
36 typedef QSpacerItem * (*QSpacerItemFactoryMethod)(const QLayout *layout, int w, int h, QSizePolicy::Policy hPolicy, QSizePolicy::Policy);
37
38 QLayoutPrivate();
39
40 void getMargin(int *result, int userMargin, QStyle::PixelMetric pm) const;
41 void doResize();
42 void reparentChildWidgets(QWidget *mw);
43 bool checkWidget(QWidget *widget) const;
44 bool checkLayout(QLayout *otherLayout) const;
45
46 static QWidgetItem *createWidgetItem(const QLayout *layout, QWidget *widget);
47 static QSpacerItem *createSpacerItem(const QLayout *layout, int w, int h, QSizePolicy::Policy hPolicy = QSizePolicy::Minimum, QSizePolicy::Policy vPolicy = QSizePolicy::Minimum);
48 virtual QLayoutItem* replaceAt(int, QLayoutItem *) { return nullptr; }
49
50 static QWidgetItemFactoryMethod widgetItemFactoryMethod;
51 static QSpacerItemFactoryMethod spacerItemFactoryMethod;
52
53 int insideSpacing;
54 int userLeftMargin;
55 int userTopMargin;
56 int userRightMargin;
57 int userBottomMargin;
58 uint topLevel : 1;
59 uint enabled : 1;
60 uint activated : 1;
61 uint autoNewChild : 1;
62 QLayout::SizeConstraint horizontalConstraint;
63 QLayout::SizeConstraint verticalConstraint;
64 QRect rect;
65 QWidget *menubar;
66};
67
68QT_END_NAMESPACE
69
70#endif // QLAYOUT_P_H
QList< QBoxLayoutItem * > list
QLayoutItem * replaceAt(int index, QLayoutItem *) override
void effectiveMargins(int *left, int *top, int *right, int *bottom) const
int validateIndex(int index) const
QList< QLayoutStruct > geomArray
Qt::Orientations expanding
\inmodule QtCore\reentrant
Definition qdatastream.h:50
Definition qlist.h:80
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
Definition qsizepolicy.h:19
\inmodule QtCore
Definition qsize.h:26
static bool horz(QBoxLayout::Direction dir)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2568
Q_DECLARE_TYPEINFO(QSizePolicy, Q_PRIMITIVE_TYPE)
int mhfw(int w)
QBoxLayoutItem(QLayoutItem *it, int stretch_=0)
int hfw(int w)
QLayoutItem * item