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
4#ifndef QABSTRACTLAYOUTSTYLEINFO_P_H
5#define QABSTRACTLAYOUTSTYLEINFO_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/private/qtguiglobal_p.h>
19#include <QtCore/qnamespace.h>
20#include "qlayoutpolicy_p.h"
21
22QT_BEGIN_NAMESPACE
23
24
25class Q_GUI_EXPORT QAbstractLayoutStyleInfo {
26public:
27
28 QAbstractLayoutStyleInfo() : m_isWindow(false) {}
29 virtual ~QAbstractLayoutStyleInfo() {}
30 virtual qreal combinedLayoutSpacing(QLayoutPolicy::ControlTypes /*controls1*/,
31 QLayoutPolicy::ControlTypes /*controls2*/, Qt::Orientation /*orientation*/) const {
32 return -1;
33 }
34
35 virtual qreal perItemSpacing(QLayoutPolicy::ControlType /*control1*/,
36 QLayoutPolicy::ControlType /*control2*/,
37 Qt::Orientation /*orientation*/) const {
38 return -1;
39 }
40
41 virtual qreal spacing(Qt::Orientation orientation) const = 0;
42
43 virtual bool hasChangedCore() const { return false; } // ### Remove when usage is gone from subclasses
44
45 virtual void invalidate() { }
46
47 virtual qreal windowMargin(Qt::Orientation orientation) const = 0;
48
49 bool isWindow() const {
50 return m_isWindow;
51 }
52
53protected:
54 unsigned m_isWindow : 1;
55 mutable unsigned m_hSpacingState: 2;
56 mutable unsigned m_vSpacingState: 2;
57 mutable qreal m_spacing[2];
58};
59
60QT_END_NAMESPACE
61
62#endif // QABSTRACTLAYOUTSTYLEINFO_P_H
63

source code of qtbase/src/gui/util/qabstractlayoutstyleinfo_p.h