@@ -29,13 +29,13 public: | |||||
29 | QChart* m_chart; |
|
29 | QChart* m_chart; | |
30 | }; |
|
30 | }; | |
31 |
|
31 | |||
32 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
32 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
33 |
|
33 | |||
34 | QChartWidget::QChartWidget(QWidget *parent) : |
|
34 | QChartWidget::QChartWidget(QWidget *parent) : | |
35 | QWidget(parent), |
|
35 | QWidget(parent), | |
36 | d_ptr(new QChartWidgetPrivate(this)) |
|
36 | d_ptr(new QChartWidgetPrivate(this)) | |
37 | { |
|
37 | { | |
38 |
|
38 | setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | ||
39 | } |
|
39 | } | |
40 |
|
40 | |||
41 | QChartWidget::~QChartWidget() |
|
41 | QChartWidget::~QChartWidget() | |
@@ -52,6 +52,11 void QChartWidget::resizeEvent(QResizeEvent *event) | |||||
52 | QWidget::resizeEvent(event); |
|
52 | QWidget::resizeEvent(event); | |
53 | } |
|
53 | } | |
54 |
|
54 | |||
|
55 | QSize QChartWidget::sizeHint() const | |||
|
56 | { | |||
|
57 | // TODO: calculate size hint based on contents? | |||
|
58 | return QSize(100, 100); | |||
|
59 | } | |||
55 |
|
60 | |||
56 | void QChartWidget::addSeries(QChartSeries* series) |
|
61 | void QChartWidget::addSeries(QChartSeries* series) | |
57 | { |
|
62 | { |
@@ -19,6 +19,7 public: | |||||
19 |
|
19 | |||
20 | //implement from QWidget |
|
20 | //implement from QWidget | |
21 | void resizeEvent(QResizeEvent *event); |
|
21 | void resizeEvent(QResizeEvent *event); | |
|
22 | QSize sizeHint() const; | |||
22 |
|
23 | |||
23 | void addSeries(QChartSeries* series); |
|
24 | void addSeries(QChartSeries* series); | |
24 | protected: |
|
25 | protected: |
General Comments 0
You need to be logged in to leave comments.
Login now