mirror of https://github.com/qt/qtcharts.git
Added size hint for the widget
This commit is contained in:
parent
15e60e95e5
commit
1f6ecd9d10
|
@ -29,13 +29,13 @@ public:
|
||||||
QChart* m_chart;
|
QChart* m_chart;
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
QChartWidget::QChartWidget(QWidget *parent) :
|
QChartWidget::QChartWidget(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
d_ptr(new QChartWidgetPrivate(this))
|
d_ptr(new QChartWidgetPrivate(this))
|
||||||
{
|
{
|
||||||
|
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
}
|
}
|
||||||
|
|
||||||
QChartWidget::~QChartWidget()
|
QChartWidget::~QChartWidget()
|
||||||
|
@ -52,6 +52,11 @@ void QChartWidget::resizeEvent(QResizeEvent *event)
|
||||||
QWidget::resizeEvent(event);
|
QWidget::resizeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSize QChartWidget::sizeHint() const
|
||||||
|
{
|
||||||
|
// TODO: calculate size hint based on contents?
|
||||||
|
return QSize(100, 100);
|
||||||
|
}
|
||||||
|
|
||||||
void QChartWidget::addSeries(QChartSeries* series)
|
void QChartWidget::addSeries(QChartSeries* series)
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,6 +19,7 @@ public:
|
||||||
|
|
||||||
//implement from QWidget
|
//implement from QWidget
|
||||||
void resizeEvent(QResizeEvent *event);
|
void resizeEvent(QResizeEvent *event);
|
||||||
|
QSize sizeHint() const;
|
||||||
|
|
||||||
void addSeries(QChartSeries* series);
|
void addSeries(QChartSeries* series);
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in New Issue