From 55ca9199fd7620d2cb74fe03c578221b4491d7cb 2012-03-29 08:36:17 From: Michal Klocek Date: 2012-03-29 08:36:17 Subject: [PATCH] Add stub from minimum size --- diff --git a/src/qchart.cpp b/src/qchart.cpp index 0092792..50ec346 100644 --- a/src/qchart.cpp +++ b/src/qchart.cpp @@ -69,10 +69,12 @@ QTCOMMERCIALCHART_BEGIN_NAMESPACE QChart::QChart(QGraphicsItem *parent, Qt::WindowFlags wFlags) : QGraphicsWidget(parent,wFlags), d_ptr(new QChartPrivate(this)) { + //setMinimumSize(200,200); d_ptr->m_legend = new QLegend(this); d_ptr->m_dataset = new ChartDataSet(this); d_ptr->m_presenter = new ChartPresenter(this,d_ptr->m_dataset); - + int padding = d_ptr->m_presenter->padding(); + setMinimumSize(3*padding,3*padding); connect(d_ptr->m_dataset,SIGNAL(seriesAdded(QSeries*,Domain*)),d_ptr->m_legend,SLOT(handleSeriesAdded(QSeries*,Domain*))); connect(d_ptr->m_dataset,SIGNAL(seriesRemoved(QSeries*)),d_ptr->m_legend,SLOT(handleSeriesRemoved(QSeries*))); } diff --git a/src/qchartview.cpp b/src/qchartview.cpp index 0f99609..b962f8c 100644 --- a/src/qchartview.cpp +++ b/src/qchartview.cpp @@ -60,7 +60,6 @@ QChartView::QChartView(QChart *chart,QWidget *parent) : d_ptr->m_scene = new QGraphicsScene(this); d_ptr->m_chart = chart; d_ptr->m_presenter = chart->d_ptr->m_presenter; - setFrameShape(QFrame::NoFrame); setBackgroundRole(QPalette::Window); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -207,8 +206,9 @@ void QChartView::keyPressEvent(QKeyEvent *event) */ void QChartView::resizeEvent(QResizeEvent *event) { - d_ptr->m_chart->resize(size()); QGraphicsView::resizeEvent(event); + d_ptr->m_chart->resize(size()); + setSceneRect(d_ptr->m_chart->geometry()); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////