QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskStatusIndicator.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_STATUS_INDICATOR_H
7#define QSK_STATUS_INDICATOR_H
8
9#include "QskControl.h"
10
11class QskGraphic;
12class QskColorFilter;
13class QUrl;
14
15class QSK_EXPORT QskStatusIndicator : public QskControl
16{
17 Q_OBJECT
18
19 Q_PROPERTY( int status READ status() WRITE setStatus NOTIFY statusChanged )
20 Q_PROPERTY( int graphicRole READ graphicRole
21 WRITE setGraphicRole RESET resetGraphicRole NOTIFY graphicRoleChanged )
22
23 using Inherited = QskControl;
24
25 public:
26 QSK_SUBCONTROLS( Graphic )
27
28 QskStatusIndicator( QQuickItem* parent = nullptr );
29 ~QskStatusIndicator() override;
30
31 Q_INVOKABLE QUrl source( int status ) const;
32 Q_INVOKABLE void setSource( int status, const QUrl& url );
33 void setSource( int status, const QString& );
34
35 QskGraphic graphic( int status ) const;
36 void setGraphic( int status, const QskGraphic& );
37
38 void setGraphicRole( int role );
39 void resetGraphicRole();
40 int graphicRole() const;
41
42 virtual QskColorFilter graphicFilter( int status ) const;
43 virtual QskGraphic loadSource( const QUrl& ) const;
44
45 int status() const;
46 bool hasStatus( int status ) const;
47
48 QList< int > statusList() const;
49
50 public Q_SLOTS:
51 void setStatus( int status );
52
53 Q_SIGNALS:
54 void statusChanged( int status );
55 void graphicRoleChanged( int );
56
57 protected:
58 void changeEvent( QEvent* ) override;
59 void updateLayout() override;
60
61 private:
62 class PrivateData;
63 std::unique_ptr< PrivateData > m_data;
64};
65
66#endif
Base class of all controls.
Definition QskControl.h:23
A paint device for scalable graphics.
Definition QskGraphic.h:28
virtual void changeEvent(QEvent *)
Definition QskItem.cpp:859