QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskBox.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_BOX_H
7#define QSK_BOX_H
8
9#include "QskControl.h"
10
11class QSK_EXPORT QskBox : public QskControl
12{
13 Q_OBJECT
14
15 using Inherited = QskControl;
16
17 Q_PROPERTY( bool panel READ hasPanel
18 WRITE setPanel NOTIFY panelChanged FINAL )
19
20 Q_PROPERTY( QskBoxBorderMetrics borderMetrics READ borderMetrics
21 WRITE setBorderMetrics RESET resetBorderMetrics
22 NOTIFY borderMetricsChanged )
23
24 Q_PROPERTY( QskBoxBorderColors borderColors READ borderColors
25 WRITE setBorderColors RESET resetBorderColors
26 NOTIFY borderColorsChanged )
27
28 Q_PROPERTY( QskGradient setFillGradient READ fillGradient
29 WRITE setFillGradient RESET resetFillGradient
30 NOTIFY fillGradientChanged )
31
32 Q_PROPERTY( QskMargins padding READ padding
33 WRITE setPadding RESET resetPadding NOTIFY paddingChanged )
34
35 public:
36 QSK_SUBCONTROLS( Panel )
37
38 QskBox( QQuickItem* parent = nullptr );
39 QskBox( bool hasPanel, QQuickItem* parent = nullptr );
40
41 ~QskBox() override;
42
43 void setPanel( bool );
44 bool hasPanel() const;
45
46 QskBoxBorderMetrics borderMetrics() const;
47 void setBorderMetrics( const QskBoxBorderMetrics& );
48 void resetBorderMetrics();
49
50 QskBoxBorderColors borderColors() const;
51 void setBorderColors( const QskBoxBorderColors& );
52 void resetBorderColors();
53
54 QskGradient fillGradient() const;
55 void setFillGradient( const QskGradient& );
56 void resetFillGradient();
57
58 void setPadding( qreal );
59 void setPadding( const QMarginsF& );
60 void resetPadding();
61 QMarginsF padding() const;
62
63 QRectF layoutRectForSize( const QSizeF& ) const override;
64
65 Q_SIGNALS:
66 void panelChanged( bool );
67 void borderMetricsChanged( const QskBoxBorderMetrics& );
68 void borderColorsChanged( const QskBoxBorderColors& );
69 void fillGradientChanged( const QskGradient& );
70 void paddingChanged( const QMarginsF& );
71
72 private:
73 bool m_hasPanel;
74};
75
76#endif
Base class of all controls.
Definition QskControl.h:23
virtual QRectF layoutRectForSize(const QSizeF &) const