forked from qt-creator/qt-creator
Replace ListView by TreeView inside results pane
This removes the flickering of the view when adding too many items in a short time frame. Additionally it is the first step towards making the results a real tree for having a better overview and to be able to reduce the output easier to what is wanted by the user. Change-Id: Id515bf0f43c5037d956bdbf2818a5d6ef97c82dd Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -46,6 +46,8 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
||||
{
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
initStyleOption(&opt, index);
|
||||
// make sure we paint the complete delegate instead of keeping an offset
|
||||
opt.rect.adjust(-opt.rect.x(), 0, 0, 0);
|
||||
painter->save();
|
||||
|
||||
QFontMetrics fm(opt.font);
|
||||
@@ -181,6 +183,8 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
||||
QSize TestResultDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
QStyleOptionViewItemV4 opt = option;
|
||||
// make sure opt.rect is initialized correctly - otherwise we might get a width of 0
|
||||
opt.initFrom(opt.widget);
|
||||
initStyleOption(&opt, index);
|
||||
|
||||
const QAbstractItemView *view = qobject_cast<const QAbstractItemView *>(opt.widget);
|
||||
|
||||
Reference in New Issue
Block a user