aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/graph/graph.h
blob: 50313f529a124dd16b48aec578c61cbf44f53986 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#ifndef GRAPH_H
#define GRAPH_H

#include <QQuickItem>

class Graph : public QQuickItem
{
    Q_OBJECT
    QML_ELEMENT
public:
    Graph();

protected:
    QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *);
    void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry);

public slots:
    void appendSample(qreal value);
    void removeFirstSample();

private:
    QList<qreal> m_samples;

    bool m_samplesChanged;
    bool m_geometryChanged;
};

#endif // GRAPH_H