diff --git a/src/qchartwidget.cpp b/src/qchartwidget.cpp index 528eb00..1ef1127 100644 --- a/src/qchartwidget.cpp +++ b/src/qchartwidget.cpp @@ -10,9 +10,12 @@ QChartWidget::QChartWidget(QWidget *parent) : QGraphicsView(parent) { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - m_scene = new QGraphicsScene(); - setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setScene(m_scene); + m_scene = new QGraphicsScene(); + m_view = new QGraphicsView(parent); + m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + m_view->setScene(m_scene); + m_chart = new QChart(); m_scene->addItem(m_chart); show();