mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Implement the resizeEvent to make the statistics always visible.
Always fit the whole scene in the view. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1c56c9f626
commit
b01ef9a0a5
2 changed files with 8 additions and 0 deletions
|
@ -34,3 +34,9 @@ void YearlyStatisticsWidget::modelDataChanged(const QModelIndex &topLeft, const
|
||||||
{
|
{
|
||||||
// stub
|
// stub
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void YearlyStatisticsWidget::resizeEvent(QResizeEvent *event)
|
||||||
|
{
|
||||||
|
QGraphicsView::resizeEvent(event);
|
||||||
|
fitInView(sceneRect(), Qt::IgnoreAspectRatio);
|
||||||
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@ class YearlyStatisticsWidget : public QGraphicsView {
|
||||||
public:
|
public:
|
||||||
YearlyStatisticsWidget(QWidget *parent = 0);
|
YearlyStatisticsWidget(QWidget *parent = 0);
|
||||||
void setModel(YearlyStatisticsModel *m);
|
void setModel(YearlyStatisticsModel *m);
|
||||||
|
protected:
|
||||||
|
virtual void resizeEvent(QResizeEvent *event);
|
||||||
public slots:
|
public slots:
|
||||||
void modelRowsInserted(const QModelIndex& index, int first, int last);
|
void modelRowsInserted(const QModelIndex& index, int first, int last);
|
||||||
void modelRowsRemoved(const QModelIndex& index, int first, int last);
|
void modelRowsRemoved(const QModelIndex& index, int first, int last);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue