summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/DisplayPlot.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-qtgui/lib/DisplayPlot.cc')
-rw-r--r--gr-qtgui/lib/DisplayPlot.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/gr-qtgui/lib/DisplayPlot.cc b/gr-qtgui/lib/DisplayPlot.cc
index e982c855e6..8c115c8b8c 100644
--- a/gr-qtgui/lib/DisplayPlot.cc
+++ b/gr-qtgui/lib/DisplayPlot.cc
@@ -71,7 +71,12 @@ DisplayPlot::DisplayPlot(int nplots, QWidget* parent)
const QFontMetrics fm(axisWidget(QwtPlot::yLeft)->font());
QwtScaleDraw* sd = axisScaleDraw(QwtPlot::yLeft);
- sd->setMinimumExtent(fm.width("100.00"));
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
+ int min_ext = fm.horizontalAdvance("100.00");
+#else
+ int min_ext = fm.width("100.00");
+#endif
+ sd->setMinimumExtent(min_ext);
QwtLegend* legendDisplay = new QwtLegend(this);