diff options
author | Thorbjørn Martsum <tmartsum@gmail.com> | 2013-04-08 15:40:11 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-09 06:45:01 +0200 |
commit | 03c761287f1a007c7177d90ed81341d0147eae05 (patch) | |
tree | ffa6c4022f414cee643d3875050bb7f375bfc8f2 /src/widgets/itemviews/qtableview_p.h | |
parent | 03c5eacfbb7f8fa294368bff812428680a0b9f3b (diff) |
resizeToContents - move some of sizeHint into separate functions
Some of sizeHintForColumn is now moved into widthHintForIndex.
(and in QTreeView some of sizeHintForRow into heightHintForIndex)
This makes the code a bit more readable and it prepares some
extensions that will use these functions more. There should
be no semantic changes in this patch.
In releasemode this does not seem to have a performance cost.
(QTableView actually seemed to be a bit faster)
Change-Id: I940432ee01715ce94cd6aab5f3b2aa00dcd19ace
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/widgets/itemviews/qtableview_p.h')
-rw-r--r-- | src/widgets/itemviews/qtableview_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qtableview_p.h b/src/widgets/itemviews/qtableview_p.h index 923beec253..3850cba9d3 100644 --- a/src/widgets/itemviews/qtableview_p.h +++ b/src/widgets/itemviews/qtableview_p.h @@ -181,6 +181,8 @@ public: const QStyleOptionViewItem &option, QBitArray *drawn, int firstVisualRow, int lastVisualRow, int firstVisualColumn, int lastVisualColumn); void drawCell(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index); + int widthHintForIndex(const QModelIndex &index, int hint, const QStyleOptionViewItem &option) const; + int heightHintForIndex(const QModelIndex &index, int hint, const QStyleOptionViewItem &option) const; bool showGrid; Qt::PenStyle gridStyle; |