Skip to content

Commit

Permalink
From paint to resize event to do tables columns handling right and av…
Browse files Browse the repository at this point in the history
…oid CPU loops dvorka#910
  • Loading branch information
dvorka committed Mar 3, 2019
1 parent c140510 commit 9f604a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions app/src/qt/outlines_table_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ OutlinesTableView::OutlinesTableView(QWidget *parent)
setSelectionMode(QAbstractItemView::SingleSelection);
}

void OutlinesTableView::paintEvent(QPaintEvent* event)
void OutlinesTableView::resizeEvent(QResizeEvent* event)
{
MF_DEBUG("OutlinesTableView::paintEvent" << event << std::endl);
MF_DEBUG("OutlinesTableView::resizeEvent" << event << std::endl);

// ensure that 1st column gets the remaining space from others
// IMPROVE may kill performance
Expand Down Expand Up @@ -71,7 +71,7 @@ void OutlinesTableView::paintEvent(QPaintEvent* event)
// pretty
this->setColumnWidth(7, this->fontMetrics().averageCharWidth()*12);

QTableView::paintEvent(event);
QTableView::resizeEvent(event);
}

} // m8r namespace
3 changes: 1 addition & 2 deletions app/src/qt/outlines_table_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ class OutlinesTableView : public QTableView

int getColumnCount() { return COLUMN_COUNT; }

virtual void paintEvent(QPaintEvent* event) override;
virtual void resizeEvent(QResizeEvent* event) override;
};


}

#endif // M8RUI_OUTLINES_TABLE_H_

0 comments on commit 9f604a4

Please sign in to comment.