Files
qt-creator/src/libs/utils/itemviews.cpp
hjk a475632c66 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>
2023-09-05 07:24:21 +00:00

77 lines
1.8 KiB
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "itemviews.h"
namespace Utils {
/*!
\class Utils::TreeView
\inmodule QtCreator
\brief The TreeView adds setActivationMode to QTreeView
to allow for single click/double click behavior on
platforms where the default is different. Use with care.
Also adds sane keyboard navigation for mac.
Note: This uses setUniformRowHeights(true) by default.
*/
/*!
\class Utils::TreeWidget
\inmodule QtCreator
\brief The TreeWidget adds setActivationMode to QTreeWidget
to allow for single click/double click behavior on
platforms where the default is different. Use with care.
Also adds sane keyboard navigation for mac.
Note: This uses setUniformRowHeights(true) by default.
*/
/*!
\class Utils::ListView
\inmodule QtCreator
\brief The ListView adds setActivationMode to QListView
to allow for single click/double click behavior on
platforms where the default is different. Use with care.
Also adds sane keyboard navigation for mac.
*/
/*!
\class Utils::ListWidget
\inmodule QtCreator
\brief The ListWidget adds setActivationMode to QListWidget
to allow for single click/double click behavior on
platforms where the default is different. Use with care.
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