summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gr-qtgui/lib/DisplayPlot.cc7
-rw-r--r--gr-qtgui/lib/edit_box_msg_impl.cc4
2 files changed, 10 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);
diff --git a/gr-qtgui/lib/edit_box_msg_impl.cc b/gr-qtgui/lib/edit_box_msg_impl.cc
index 7bb41b9a0c..cfc19201be 100644
--- a/gr-qtgui/lib/edit_box_msg_impl.cc
+++ b/gr-qtgui/lib/edit_box_msg_impl.cc
@@ -88,7 +88,11 @@ edit_box_msg_impl::edit_box_msg_impl(data_type_t type,
d_key->setEnabled(false);
QFontMetrics fm = d_key->fontMetrics();
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
+ int width = 15 + fm.horizontalAdvance(key_text);
+#else
int width = 15 + fm.width(key_text);
+#endif
d_key->setFixedWidth(width);