Added size hint for the widget

This commit is contained in:
Tero Ahola 2012-01-19 11:37:03 +02:00
parent 15e60e95e5
commit 1f6ecd9d10
2 changed files with 8 additions and 2 deletions

View File

@ -29,13 +29,13 @@ public:
QChart* m_chart;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
QChartWidget::QChartWidget(QWidget *parent) :
QWidget(parent),
d_ptr(new QChartWidgetPrivate(this))
{
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
}
QChartWidget::~QChartWidget()
@ -52,6 +52,11 @@ void QChartWidget::resizeEvent(QResizeEvent *event)
QWidget::resizeEvent(event);
}
QSize QChartWidget::sizeHint() const
{
// TODO: calculate size hint based on contents?
return QSize(100, 100);
}
void QChartWidget::addSeries(QChartSeries* series)
{

View File

@ -19,6 +19,7 @@ public:
//implement from QWidget
void resizeEvent(QResizeEvent *event);
QSize sizeHint() const;
void addSeries(QChartSeries* series);
protected: