aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-10-23 15:07:35 -0700
committerGerald Combs <gerald@wireshark.org>2015-10-23 23:25:13 +0000
commit8e8db9b917e1ad9cdfeca0fd92bc864fbd94fd1e (patch)
treeb45b941d1f6aa662edf7c2bf94fa66dc5b33a7cd /ui
parent2d065bcd52de7e4fa8616e4ad719c585073111d0 (diff)
Qt: Explicitly set the byte view painter font.
Set the painter font at the beginning of each paintEvent. It looks like we either aren't calling setFont at the right time or the QAbstractScrollArea viewport sometimes ignores its parent font. Bug: 11594 Change-Id: Id4484f6b990be112bbc5728d5ad0e31a74a60201 Reviewed-on: https://code.wireshark.org/review/11231 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/byte_view_text.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/ui/qt/byte_view_text.cpp b/ui/qt/byte_view_text.cpp
index 092a2118cd..85566c1680 100644
--- a/ui/qt/byte_view_text.cpp
+++ b/ui/qt/byte_view_text.cpp
@@ -130,8 +130,6 @@ const guint8 *ByteViewText::dataAndLength(guint *data_len_ptr)
void ByteViewText::setMonospaceFont(const QFont &mono_font)
{
mono_font_ = mono_font;
-// mono_bold_font_ = QFont(mono_font);
-// mono_bold_font_.setBold(true);
const QFontMetricsF fm(mono_font);
font_width_ = fm.width('M');
@@ -149,6 +147,7 @@ void ByteViewText::paintEvent(QPaintEvent *)
{
QPainter painter(viewport());
painter.translate(-horizontalScrollBar()->value() * font_width_, 0);
+ painter.setFont(font());
// Pixel offset of this row
int row_y = 0;