mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +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
|
||||
}
|
||||
|
||||
void YearlyStatisticsWidget::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
QGraphicsView::resizeEvent(event);
|
||||
fitInView(sceneRect(), Qt::IgnoreAspectRatio);
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@ class YearlyStatisticsWidget : public QGraphicsView {
|
|||
public:
|
||||
YearlyStatisticsWidget(QWidget *parent = 0);
|
||||
void setModel(YearlyStatisticsModel *m);
|
||||
protected:
|
||||
virtual void resizeEvent(QResizeEvent *event);
|
||||
public slots:
|
||||
void modelRowsInserted(const QModelIndex& index, int first, int last);
|
||||
void modelRowsRemoved(const QModelIndex& index, int first, int last);
|
||||
|
|
Loading…
Reference in a new issue