qskinny/examples/iot-dashboard/Diagram.h

67 lines
1.2 KiB
C
Raw Normal View History

2020-08-26 15:22:43 +00:00
#ifndef DIAGRAM_H
#define DIAGRAM_H
2020-09-17 14:47:34 +00:00
#include "Box.h"
2020-08-26 15:22:43 +00:00
#include <QQuickPaintedItem>
class DiagramContent;
2020-09-08 14:59:48 +00:00
class QskGridBox;
2020-08-26 15:22:43 +00:00
2020-09-30 12:40:59 +00:00
class WeekdayBox : public QskBox
{
Q_OBJECT
public:
QSK_SUBCONTROLS( Panel )
2021-04-07 08:38:03 +00:00
WeekdayBox( QQuickItem* parent ) : QskBox( true, parent )
{
}
2020-09-30 12:40:59 +00:00
QskAspect::Subcontrol effectiveSubcontrol(
2021-04-07 08:38:03 +00:00
QskAspect::Subcontrol subControl ) const override final
{
if( subControl == QskBox::Panel )
{
return WeekdayBox::Panel;
}
return subControl;
}
};
class CaptionItem : public QskLinearBox
{
Q_OBJECT
public:
CaptionItem( const QColor& color, const QString& text, QQuickItem* parent );
2020-09-30 12:40:59 +00:00
};
2020-09-17 14:47:34 +00:00
class Diagram : public Box
2020-08-26 15:22:43 +00:00
{
2020-09-07 14:34:29 +00:00
Q_OBJECT
2020-08-26 15:22:43 +00:00
2020-09-07 14:34:29 +00:00
public:
Diagram( QQuickItem* parent );
void updateLayout() override;
2020-08-26 15:22:43 +00:00
2020-09-07 14:34:29 +00:00
private:
QskLinearBox* m_caption;
2020-09-08 14:59:48 +00:00
QskGridBox* m_weekdays;
2020-09-07 14:34:29 +00:00
DiagramContent* m_content;
2020-08-26 15:22:43 +00:00
};
class DiagramContent : public QQuickPaintedItem
{
2020-09-07 14:34:29 +00:00
Q_OBJECT
2020-08-26 15:22:43 +00:00
2020-09-07 14:34:29 +00:00
public:
DiagramContent( QQuickItem* parent );
2020-08-26 15:22:43 +00:00
2020-09-07 14:34:29 +00:00
virtual void paint( QPainter* painter ) override;
2020-08-26 15:22:43 +00:00
};
#endif // DIAGRAM_H