projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RowItemParams: Added font and text_height
[pulseview.git]
/
pv
/
view
/
rowitempaintparams.cpp
diff --git
a/pv/view/rowitempaintparams.cpp
b/pv/view/rowitempaintparams.cpp
index af5f675a5ea6ad956b6880f8367a84265bb139b6..c46d715bb13638860d0185ee9d05c85be6fa48b0 100644
(file)
--- a/
pv/view/rowitempaintparams.cpp
+++ b/
pv/view/rowitempaintparams.cpp
@@
-20,6
+20,9
@@
#include <cassert>
#include <cassert>
+#include <QApplication>
+#include <QFontMetrics>
+
#include "rowitempaintparams.hpp"
namespace pv {
#include "rowitempaintparams.hpp"
namespace pv {
@@
-35,5
+38,15
@@
RowItemPaintParams::RowItemPaintParams(
assert(scale > 0.0);
}
assert(scale > 0.0);
}
+QFont RowItemPaintParams::font()
+{
+ return QApplication::font();
+}
+
+int RowItemPaintParams::text_height() {
+ QFontMetrics m(font());
+ return m.boundingRect(QRect(), 0, "Tg").height();
+}
+
} // namespace view
} // namespace pv
} // namespace view
} // namespace pv