diff options
Diffstat (limited to 'examples/charts/chartsgallery/contentwidget.h')
-rw-r--r-- | examples/charts/chartsgallery/contentwidget.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/charts/chartsgallery/contentwidget.h b/examples/charts/chartsgallery/contentwidget.h new file mode 100644 index 00000000..780877a5 --- /dev/null +++ b/examples/charts/chartsgallery/contentwidget.h @@ -0,0 +1,34 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#ifndef CONTENTWIDGET_H +#define CONTENTWIDGET_H + +#include <QWidget> + +QT_FORWARD_DECLARE_CLASS(QChart) +QT_FORWARD_DECLARE_CLASS(QChartView) + +class ContentWidget : public QWidget +{ + Q_OBJECT +public: + explicit ContentWidget(QWidget *parent = nullptr); + + void load(); + +protected: + virtual bool doLoad(); + void resizeEvent(QResizeEvent *) override; + void createDefaultChartView(QChart *chart); + QChartView *defaultChartView() const { return m_defaultChartView; } + void setDefaultChartView(QChartView *view); + + QString m_loadError; + +private: + QChartView *m_defaultChartView = nullptr; + bool m_loaded = false; +}; + +#endif |