QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskProgressRing.cpp
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#include "QskProgressRing.h"
7#include "QskIntervalF.h"
8
9QSK_SUBCONTROL( QskProgressRing, Groove )
10QSK_SUBCONTROL( QskProgressRing, Fill )
11
12class QskProgressRing::PrivateData
13{
14 public:
15 int size : 2;
16};
17
18QskProgressRing::QskProgressRing( qreal min, qreal max, QQuickItem* parent )
19 : Inherited( min, max, parent )
20 , m_data( new PrivateData )
21{
22 initSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
23
24 m_data->size = NormalSize;
25
26 setSubcontrolProxy( Inherited::Groove, Groove );
27 setSubcontrolProxy( Inherited::Fill, Fill );
28}
29
30QskProgressRing::QskProgressRing( QQuickItem* parent )
31 : QskProgressRing( 0.0, 100.0, parent )
32{
33}
34
35QskProgressRing::QskProgressRing( const QskIntervalF& boundaries, QQuickItem* parent )
36 : QskProgressRing( boundaries.lowerBound(), boundaries.upperBound(), parent )
37{
38}
39
40QskProgressRing::~QskProgressRing()
41{
42}
43
45{
46 switch( size() )
47 {
48 case SmallSize:
49 return QskAspect::Small;
50
51 case LargeSize:
52 return QskAspect::Large;
53
54 default:
56 }
57}
58
59void QskProgressRing::setSize( Size size )
60{
61 if ( size != m_data->size )
62 {
63 m_data->size = size;
64
66 update();
67
68 Q_EMIT sizeChanged( size );
69 }
70}
71
72QskProgressRing::Size QskProgressRing::size() const
73{
74 return static_cast< Size >( m_data->size );
75}
76
77#include "moc_QskProgressRing.cpp"
Variation
Some sort of variation.
Definition QskAspect.h:82
@ NoVariation
Definition QskAspect.h:83
void resetImplicitSize()
Definition QskItem.cpp:721
QskAspect::Variation effectiveVariation() const override