projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make header width responsive to label text
[pulseview.git]
/
pv
/
view
/
decodetrace.cpp
diff --git
a/pv/view/decodetrace.cpp
b/pv/view/decodetrace.cpp
index 1a629f2c182dbc0bee782ddbbb3feb6acc8726e0..2d641827f13bbd8416f09baa62f74c18cdce5a47 100644
(file)
--- a/
pv/view/decodetrace.cpp
+++ b/
pv/view/decodetrace.cpp
@@
-27,6
+27,7
@@
extern "C" {
#include <boost/foreach.hpp>
#include <QAction>
#include <boost/foreach.hpp>
#include <QAction>
+#include <QApplication>
#include <QComboBox>
#include <QFormLayout>
#include <QLabel>
#include <QComboBox>
#include <QFormLayout>
#include <QLabel>
@@
-117,7
+118,8
@@
void DecodeTrace::paint_mid(QPainter &p, int left, int right)
_decoder_stack->get_start_time()) / scale;
const double samples_per_pixel = samplerate * scale;
_decoder_stack->get_start_time()) / scale;
const double samples_per_pixel = samplerate * scale;
- const int h = (_text_size.height() * 5) / 4;
+ QFontMetrics m(QApplication::font());
+ const int h = (m.boundingRect(QRect(), 0, "Tg").height() * 5) / 4;
assert(_decoder_stack);
const QString err = _decoder_stack->error_message();
assert(_decoder_stack);
const QString err = _decoder_stack->error_message();