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:
Christian Stenger
2015-04-21 07:41:06 +02:00
parent c13c37f9f4
commit fcf8484eb2
3 changed files with 25 additions and 20 deletions

View File

@@ -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);