From 44633c7f729e79ea023f2a5ccbbdd0002411619f Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 20 May 2024 09:49:10 +0200 Subject: [PATCH] Address Qt 6.7 deprecation warning --- src/frontends/qt/GuiKeySymbol.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt/GuiKeySymbol.cpp b/src/frontends/qt/GuiKeySymbol.cpp index 083bc5f884..b785791c85 100644 --- a/src/frontends/qt/GuiKeySymbol.cpp +++ b/src/frontends/qt/GuiKeySymbol.cpp @@ -267,7 +267,12 @@ static int string_to_qkey(std::string const & str) if (str == "twosuperior") return Qt::Key_twosuperior; if (str == "threesuperior") return Qt::Key_threesuperior; if (str == "acute") return Qt::Key_acute; - if (str == "mu") return Qt::Key_mu; + if (str == "mu") +#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)) + return Qt::Key_micro; +#else + return Qt::Key_mu; +#endif if (str == "paragraph") return Qt::Key_paragraph; if (str == "periodcentered") return Qt::Key_periodcentered; if (str == "cedilla") return Qt::Key_cedilla; @@ -590,7 +595,14 @@ static std::string const qkey_to_string(int lkey) case Qt::Key_twosuperior: return "twosuperior"; case Qt::Key_threesuperior: return "threesuperior"; case Qt::Key_acute: return "acute"; +#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)) + // FIXME: Qt::Key_mu has been deprecated in Qt 6.7 + // since it is a misnomer. Change our return string, too? + // If so, don't forget string_to_qkey() + case Qt::Key_micro: return "mu"; +#else case Qt::Key_mu: return "mu"; +#endif case Qt::Key_paragraph: return "paragraph"; case Qt::Key_periodcentered: return "periodcentered"; case Qt::Key_cedilla: return "cedilla";