diff options
author | japm48 <japm48@users.noreply.github.com> | 2020-05-02 03:10:13 +0200 |
---|---|---|
committer | Derek Kozel <derek.kozel@gmail.com> | 2020-05-26 15:14:20 +0100 |
commit | aaa38ebab7f903c45999390b9a49311cc32bc9ef (patch) | |
tree | bb1273c1b30eb9382b75b03a9a87b93b942c04c2 /gr-qtgui/lib/edit_box_msg_impl.cc | |
parent | bc0c43aad12abb83798b25d44842ab043703f686 (diff) |
qtgui: fix deprecated use of QFontMetrics::width
Replaced with horizontalAdvance (requires Qt >=5.11).
Diffstat (limited to 'gr-qtgui/lib/edit_box_msg_impl.cc')
-rw-r--r-- | gr-qtgui/lib/edit_box_msg_impl.cc | 4 |
1 files changed, 4 insertions, 0 deletions
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); |