Fix compiler warnings

Qt6 QTranslator::load() uses [[nodiscard]] which currently leads to
compiler warnings. This is fixed using static_cast<void>.

Signed-off-by: ThomasZecha <zecha@ihp-microelectronics.com>
This commit is contained in:
ThomasZecha 2025-01-07 12:06:53 +01:00
parent ac24a25bfb
commit 0d97f032bb
7 changed files with 7 additions and 7 deletions

View File

@ -89,7 +89,7 @@ int main(int argc, char *argv[])
QString Lang = QucsSettings.Language;
if(Lang.isEmpty())
Lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + Lang, LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + Lang, LangDir));
a.installTranslator( &tor );
QucsActiveFilter *w = new QucsActiveFilter();

View File

@ -94,7 +94,7 @@ int main( int argc, char ** argv )
QString lang = QucsSettings.Language;
if(lang.isEmpty())
lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
a.installTranslator( &tor );
QucsAttenuator *qucs = new QucsAttenuator();

View File

@ -102,7 +102,7 @@ int main(int argc, char *argv[])
QString lang = QucsSettings.Language;
if(lang.isEmpty())
lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
a.installTranslator( &tor );
QucsFilter *qucs = new QucsFilter();

View File

@ -74,7 +74,7 @@ int main(int argc, char *argv[])
QString lang = QucsSettings.Language;
if(lang.isEmpty())
lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
app.installTranslator( &tor );
QucsPowerCombiningTool *PowerCombiningTool = new QucsPowerCombiningTool();

View File

@ -99,7 +99,7 @@ int main( int argc, char ** argv )
QString lang = QucsSettings.Language;
if(lang.isEmpty())
lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
a.installTranslator( &tor );
Qucs_S_SPAR_Viewer *qucs = new Qucs_S_SPAR_Viewer();

View File

@ -136,7 +136,7 @@ int main(int argc, char *argv[])
QString lang = QucsSettings.Language;
if(lang.isEmpty())
lang = QString(QLocale::system().name());
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
a.installTranslator( &tor );
QucsTranscalc *qucs = new QucsTranscalc();

View File

@ -900,7 +900,7 @@ int main(int argc, char *argv[])
lang = loc.name();
// lang = QTextCodec::locale();
}
tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir);
static_cast<void>(tor.load( QStringLiteral("qucs_") + lang, QucsSettings.LangDir));
QApplication::installTranslator( &tor );
// This seems to be necessary on a few system to make strtod()