From 0f9c32452cb04d1862803a70c12262ba09db4f9a Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Thu, 12 May 2016 10:22:05 +0200 Subject: [PATCH] Protocol: Increase width of timestamp column #4721 Since the font metrics aren't reliable on windows, we add some extra space there. --- src/gui/protocolwidget.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/protocolwidget.cpp b/src/gui/protocolwidget.cpp index 59e4e51a6..34e91ccff 100644 --- a/src/gui/protocolwidget.cpp +++ b/src/gui/protocolwidget.cpp @@ -57,9 +57,15 @@ ProtocolWidget::ProtocolWidget(QWidget *parent) : header << tr("Action"); header << tr("Size"); + int timestampColumnExtra = 0; +#ifdef Q_OS_WIN + timestampColumnExtra = 20; // font metrics are broken on Windows, see #4721 +#endif + _ui->_treeWidget->setHeaderLabels( header ); int timestampColumnWidth = - _ui->_treeWidget->fontMetrics().width(timeString(QDateTime::currentDateTime())); + _ui->_treeWidget->fontMetrics().width(timeString(QDateTime::currentDateTime())) + + timestampColumnExtra; _ui->_treeWidget->setColumnWidth(0, timestampColumnWidth); _ui->_treeWidget->setColumnWidth(1, 180); _ui->_treeWidget->setColumnCount(5); @@ -84,7 +90,8 @@ ProtocolWidget::ProtocolWidget(QWidget *parent) : _issueItemView->setHeaderLabels( header ); timestampColumnWidth = ActivityItemDelegate::rowHeight() // icon - + _issueItemView->fontMetrics().width(timeString(QDateTime::currentDateTime())); + + _issueItemView->fontMetrics().width(timeString(QDateTime::currentDateTime())) + + timestampColumnExtra; _issueItemView->setColumnWidth(0, timestampColumnWidth); _issueItemView->setColumnWidth(1, 180); _issueItemView->setColumnCount(4);