From d6f446c452fec2b280862046b7d2abe43b93e6c1 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 28 May 2022 15:14:50 +0300 Subject: [PATCH] Suppress warning QString::arg: Argument missing. --- src/app/tape/tmainwindow.cpp | 5 ++++- src/app/valentina/dialogs/dialogfinalmeasurements.cpp | 5 ++++- src/app/valentina/dialogs/dialoghistory.cpp | 5 ++++- src/app/valentina/dialogs/dialogincrements.cpp | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 16c2b0a63..e98e0231e 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -4643,7 +4643,10 @@ void TMainWindow::UpdateSearchControlsTooltips() { auto UpdateToolTip = [](QAbstractButton *button) { - button->setToolTip(button->toolTip().arg(button->shortcut().toString(QKeySequence::NativeText))); + if (button->toolTip().contains(QLatin1String("%1"))) + { + button->setToolTip(button->toolTip().arg(button->shortcut().toString(QKeySequence::NativeText))); + } }; UpdateToolTip(ui->toolButtonCaseSensitive); diff --git a/src/app/valentina/dialogs/dialogfinalmeasurements.cpp b/src/app/valentina/dialogs/dialogfinalmeasurements.cpp index 64d2dd6a7..0e2db9aee 100644 --- a/src/app/valentina/dialogs/dialogfinalmeasurements.cpp +++ b/src/app/valentina/dialogs/dialogfinalmeasurements.cpp @@ -887,7 +887,10 @@ void DialogFinalMeasurements::UpdateSearchControlsTooltips() { auto UpdateToolTip = [](QAbstractButton *button) { - button->setToolTip(button->toolTip().arg(button->shortcut().toString(QKeySequence::NativeText))); + if (button->toolTip().contains(QLatin1String("%1"))) + { + button->setToolTip(button->toolTip().arg(button->shortcut().toString(QKeySequence::NativeText))); + } }; UpdateToolTip(ui->toolButtonCaseSensitive); diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp index 06fe143bd..5a7abcd7c 100644 --- a/src/app/valentina/dialogs/dialoghistory.cpp +++ b/src/app/valentina/dialogs/dialoghistory.cpp @@ -781,7 +781,10 @@ void DialogHistory::UpdateSearchControlsTooltips() { auto UpdateToolTip = [](QAbstractButton *button) { - button->setToolTip(button->toolTip().arg(button->shortcut().toString(QKeySequence::NativeText))); + if (button->toolTip().contains(QLatin1String("%1"))) + { + button->setToolTip(button->toolTip().arg(button->shortcut().toString(QKeySequence::NativeText))); + } }; UpdateToolTip(ui->toolButtonCaseSensitive); diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp index cadd09717..920008a73 100644 --- a/src/app/valentina/dialogs/dialogincrements.cpp +++ b/src/app/valentina/dialogs/dialogincrements.cpp @@ -1101,7 +1101,10 @@ void DialogIncrements::UpdateSearchControlsTooltips() { auto UpdateToolTip = [](QAbstractButton *button) { - button->setToolTip(button->toolTip().arg(button->shortcut().toString(QKeySequence::NativeText))); + if (button->toolTip().contains(QLatin1String("%1"))) + { + button->setToolTip(button->toolTip().arg(button->shortcut().toString(QKeySequence::NativeText))); + } }; UpdateToolTip(ui->toolButtonCaseSensitive);