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
qabstractlayoutstyleinfo_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 QABSTRACTLAYOUTSTYLEINFO_P_H
6#define QABSTRACTLAYOUTSTYLEINFO_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 purely as an
13// implementation detail. 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 <QtGui/private/qtguiglobal_p.h>
20#include <QtCore/qnamespace.h>
22
24
25
26class Q_GUI_EXPORT QAbstractLayoutStyleInfo {
27public:
28
29 QAbstractLayoutStyleInfo() : m_isWindow(false) {}
30 virtual ~QAbstractLayoutStyleInfo() {}
31 virtual qreal combinedLayoutSpacing(QLayoutPolicy::ControlTypes /*controls1*/,
32 QLayoutPolicy::ControlTypes /*controls2*/, Qt::Orientation /*orientation*/) const {
33 return -1;
34 }
35
36 virtual qreal perItemSpacing(QLayoutPolicy::ControlType /*control1*/,
37 QLayoutPolicy::ControlType /*control2*/,
38 Qt::Orientation /*orientation*/) const {
39 return -1;
40 }
41
42 virtual qreal spacing(Qt::Orientation orientation) const = 0;
43
44 virtual bool hasChangedCore() const { return false; } // ### Remove when usage is gone from subclasses
45
46 virtual void invalidate() { }
47
48 virtual qreal windowMargin(Qt::Orientation orientation) const = 0;
49
50 bool isWindow() const {
51 return m_isWindow;
52 }
53
54protected:
55 unsigned m_isWindow : 1;
56 mutable unsigned m_hSpacingState: 2;
57 mutable unsigned m_vSpacingState: 2;
58 mutable qreal m_spacing[2];
59};
60
61QT_END_NAMESPACE
62
63#endif // QABSTRACTLAYOUTSTYLEINFO_P_H