forked from qt-creator/qt-creator
Utils: Make TreeViews use setUniformRowHeights by default
When applicable, the flag makes a significant difference in performacnce. However is easily forgotten in cases where it is applicable, and cases where it is accidentally used are easily spotted visually. So arguably, opt-out is a better default than opt-in. Change-Id: I88aeb05b42533ba4e23c39573a3ddd016343cd55 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "itemviews.h"
|
||||
|
||||
namespace Utils {
|
||||
|
||||
/*!
|
||||
\class Utils::TreeView
|
||||
\inmodule QtCreator
|
||||
@@ -12,6 +14,8 @@
|
||||
platforms where the default is different. Use with care.
|
||||
|
||||
Also adds sane keyboard navigation for mac.
|
||||
|
||||
Note: This uses setUniformRowHeights(true) by default.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@@ -23,6 +27,8 @@
|
||||
platforms where the default is different. Use with care.
|
||||
|
||||
Also adds sane keyboard navigation for mac.
|
||||
|
||||
Note: This uses setUniformRowHeights(true) by default.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@@ -46,3 +52,25 @@
|
||||
|
||||
Also adds sane keyboard navigation for mac.
|
||||
*/
|
||||
|
||||
TreeView::TreeView(QWidget *parent)
|
||||
: View<QTreeView>(parent)
|
||||
{
|
||||
setUniformRowHeights(true);
|
||||
}
|
||||
|
||||
TreeWidget::TreeWidget(QWidget *parent)
|
||||
: View<QTreeWidget>(parent)
|
||||
{
|
||||
setUniformRowHeights(true);
|
||||
}
|
||||
|
||||
ListView::ListView(QWidget *parent)
|
||||
: View<QListView>(parent)
|
||||
{}
|
||||
|
||||
ListWidget::ListWidget(QWidget *parent)
|
||||
: View<QListWidget>(parent)
|
||||
{}
|
||||
|
||||
} // Utils
|
||||
|
||||
Reference in New Issue
Block a user