From cd0c558b8e1dbae12c3faba2349d874942b96066 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Wed, 20 Apr 2016 18:15:12 +0200 Subject: [PATCH] DecodeTrace: Make sure first row's label width can be calculated Without a pen set, p.boundingRect() returns 0. All other rows have their label text width calculated with a pen, which makes p.boundingRect() work as intended. Fix this by setting a pen before the first row is processed. --- pv/view/decodetrace.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 20de375..9e41bc4 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -198,6 +198,9 @@ void DecodeTrace::paint_mid(QPainter &p, const ViewItemPaintParams &pp) return; } + // Set default pen to allow for text width calculation + p.setPen(Qt::black); + // Iterate through the rows int y = get_visual_y(); pair sample_range = get_sample_range( -- 2.30.2