6#ifndef QSK_BOX_BORDER_METRICS_H
7#define QSK_BOX_BORDER_METRICS_H
12#include <qnamespace.h>
21 Q_PROPERTY(
QskMargins widths READ widths WRITE setWidths )
22 Q_PROPERTY( Qt::SizeMode sizeMode READ sizeMode WRITE setSizeMode )
24 Q_PROPERTY( qreal left READ left WRITE setLeft )
25 Q_PROPERTY( qreal top READ top WRITE setTop )
26 Q_PROPERTY( qreal right READ right WRITE setRight )
27 Q_PROPERTY( qreal bottom READ bottom WRITE setBottom )
33 qreal width, Qt::SizeMode = Qt::AbsoluteSize )
noexcept;
36 qreal right, qreal bottom, Qt::SizeMode = Qt::AbsoluteSize )
noexcept;
39 Qt::SizeMode sizeMode = Qt::AbsoluteSize )
noexcept;
42 Qt::SizeMode sizeMode = Qt::AbsoluteSize )
noexcept;
47 constexpr bool isNull()
const noexcept;
49 void setWidthAt( Qt::Edges, qreal width )
noexcept;
50 qreal widthAt( Qt::Edge )
const noexcept;
53 constexpr const QskMargins& widths()
const noexcept;
55 constexpr qreal left()
const noexcept;
56 constexpr qreal top()
const noexcept;
57 constexpr qreal right()
const noexcept;
58 constexpr qreal bottom()
const noexcept;
60 void setLeft( qreal )
noexcept;
61 void setTop( qreal )
noexcept;
62 void setRight( qreal )
noexcept;
63 void setBottom( qreal )
noexcept;
65 void setSizeMode( Qt::SizeMode )
noexcept;
66 constexpr Qt::SizeMode sizeMode()
const noexcept;
73 QskHashValue hash( QskHashValue seed = 0 )
const noexcept;
78 constexpr bool isEquidistant()
const noexcept;
80 QRectF adjustedRect(
const QRectF& )
const;
84 Qt::SizeMode m_sizeMode;
87inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics() noexcept
88 : m_sizeMode( Qt::AbsoluteSize )
92inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics(
93 qreal width, Qt::SizeMode sizeMode ) noexcept
95 , m_sizeMode( sizeMode )
99inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics(
100 const QMarginsF& widths, Qt::SizeMode sizeMode ) noexcept
102 , m_sizeMode( sizeMode )
106inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics(
107 const QskMargins& widths, Qt::SizeMode sizeMode ) noexcept
109 , m_sizeMode( sizeMode )
113inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics(
114 qreal left, qreal top, qreal right, qreal bottom, Qt::SizeMode sizeMode ) noexcept
115 : m_widths( left, top, right, bottom )
116 , m_sizeMode( sizeMode )
120inline constexpr bool QskBoxBorderMetrics::operator==(
123 return ( m_sizeMode == other.m_sizeMode ) && ( m_widths == other.m_widths );
126inline constexpr bool QskBoxBorderMetrics::operator!=(
129 return !( *
this == other );
132inline constexpr bool QskBoxBorderMetrics::isNull() const noexcept
134 return m_widths.isNull();
137inline constexpr bool QskBoxBorderMetrics::isEquidistant() const noexcept
139 return m_widths.isEquidistant();
142inline constexpr const QskMargins& QskBoxBorderMetrics::widths() const noexcept
147inline qreal QskBoxBorderMetrics::widthAt( Qt::Edge edge )
const noexcept
149 return m_widths.marginAt( edge );
152inline constexpr qreal QskBoxBorderMetrics::left() const noexcept
154 return m_widths.left();
157inline constexpr qreal QskBoxBorderMetrics::top() const noexcept
159 return m_widths.top();
162inline constexpr qreal QskBoxBorderMetrics::right() const noexcept
164 return m_widths.right();
167inline constexpr qreal QskBoxBorderMetrics::bottom() const noexcept
169 return m_widths.bottom();
172inline void QskBoxBorderMetrics::setLeft( qreal left )
noexcept
174 return m_widths.setLeft( left );
177inline void QskBoxBorderMetrics::setTop( qreal top )
noexcept
179 return m_widths.setTop( top );
182inline void QskBoxBorderMetrics::setRight( qreal right )
noexcept
184 return m_widths.setRight( right );
187inline void QskBoxBorderMetrics::setBottom( qreal bottom )
noexcept
189 return m_widths.setBottom( bottom );
192inline constexpr Qt::SizeMode QskBoxBorderMetrics::sizeMode() const noexcept
197#ifndef QT_NO_DEBUG_STREAM