diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-12-01 14:32:29 -0800 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-12-02 03:34:17 +0000 |
commit | 8d927a98fdac92b562cfd5c769f7ae7bed0ace2d (patch) | |
tree | 02874f28940be02ecf8fe291c558651175cae43d /ui/qt/timeline_delegate.cpp | |
parent | 672a5bd5468322cc3264886cf1655519f2dbf503 (diff) |
Qt: Fix QStyledItemDelegate assertions.
QStyledItemDelegate::paint asserts if you pass it an empty QModelIndex.
We were doing this in PercentBarDelegate and TimelineDelegate in order to
keep it from drawing any text. Return an empty string from ::displayText
instead, which appears to be the correct way to paint without text.
Bug: 13180
Change-Id: I8064d9575e04e95a926797eec7f6ad2b0bfef1c0
Reviewed-on: https://code.wireshark.org/review/19007
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt/timeline_delegate.cpp')
-rw-r--r-- | ui/qt/timeline_delegate.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ui/qt/timeline_delegate.cpp b/ui/qt/timeline_delegate.cpp index 0cfdd73147..2162da1030 100644 --- a/ui/qt/timeline_delegate.cpp +++ b/ui/qt/timeline_delegate.cpp @@ -43,12 +43,11 @@ void TimelineDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti QStyleOptionViewItem option_vi = option; QStyledItemDelegate::initStyleOption(&option_vi, index); - struct timeline_span span_px = index.data(Qt::UserRole).value<struct timeline_span>(); // Paint our rect with no text using the current style, then draw our // bar and text over it. - QStyledItemDelegate::paint(painter, option, QModelIndex()); + QStyledItemDelegate::paint(painter, option, index); if (QApplication::style()->objectName().contains("vista")) { // QWindowsVistaStyle::drawControl does this internally. Unfortunately there |