Fix some warnings

Change-Id: I2991f0ab84b26c93c0dbe2ec79f7638d299e3d39
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Christian Kandeler
2022-02-10 16:50:43 +01:00
parent 92c786d21e
commit fde7b90ee9
7 changed files with 15 additions and 9 deletions

View File

@@ -179,6 +179,8 @@ QImage Quick3DNodeInstance::renderPreviewImage(const QSize &previewImageSize) co
return transparentImage; return transparentImage;
} }
} }
#else
Q_UNUSED(previewImageSize)
#endif #endif
return {}; return {};
} }

View File

@@ -488,14 +488,14 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
if (m_buildConfiguration->isEnabled()) if (m_buildConfiguration->isEnabled())
setError(QString()); setError(QString());
}); });
connect(this, &QObject::destroyed, this, [this](const QObject *obj) { connect(this, &QObject::destroyed, this, [this] {
updateInitialCMakeArguments(); updateInitialCMakeArguments();
}); });
connect(bc->aspect<InitialCMakeArgumentsAspect>(), connect(bc->aspect<InitialCMakeArgumentsAspect>(),
&Utils::BaseAspect::labelLinkActivated, &Utils::BaseAspect::labelLinkActivated,
this, this,
[this](const QString &link) { [this](const QString &) {
const CMakeTool *tool = CMakeKitAspect::cmakeTool( const CMakeTool *tool = CMakeKitAspect::cmakeTool(
m_buildConfiguration->target()->kit()); m_buildConfiguration->target()->kit());
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options"); CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options");
@@ -503,7 +503,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
connect(bc->aspect<AdditionalCMakeOptionsAspect>(), connect(bc->aspect<AdditionalCMakeOptionsAspect>(),
&Utils::BaseAspect::labelLinkActivated, &Utils::BaseAspect::labelLinkActivated,
this, this,
[this](const QString &link) { [this](const QString &) {
const CMakeTool *tool = CMakeKitAspect::cmakeTool( const CMakeTool *tool = CMakeKitAspect::cmakeTool(
m_buildConfiguration->target()->kit()); m_buildConfiguration->target()->kit());
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options"); CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options");
@@ -527,7 +527,7 @@ void CMakeBuildSettingsWidget::batchEditConfiguration()
"To set or change a variable, use -D&lt;variable&gt;:&lt;type&gt;=&lt;value&gt;.<br/>" "To set or change a variable, use -D&lt;variable&gt;:&lt;type&gt;=&lt;value&gt;.<br/>"
"&lt;type&gt; can have one of the following values: FILEPATH, PATH, BOOL, INTERNAL, or STRING.<br/>" "&lt;type&gt; can have one of the following values: FILEPATH, PATH, BOOL, INTERNAL, or STRING.<br/>"
"To unset a variable, use -U&lt;variable&gt;.<br/>")); "To unset a variable, use -U&lt;variable&gt;.<br/>"));
connect(label, &QLabel::linkActivated, this, [this](const QString &link) { connect(label, &QLabel::linkActivated, this, [this](const QString &) {
const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildConfiguration->target()->kit()); const CMakeTool *tool = CMakeKitAspect::cmakeTool(m_buildConfiguration->target()->kit());
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-variables.7.html"); CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-variables.7.html");
}); });

View File

@@ -353,7 +353,7 @@ public:
m_changeButton(createSubWidget<QPushButton>()) m_changeButton(createSubWidget<QPushButton>())
{ {
const CMakeTool *tool = CMakeKitAspect::cmakeTool(kit); const CMakeTool *tool = CMakeKitAspect::cmakeTool(kit);
connect(this, &KitAspectWidget::labelLinkActivated, this, [=](const QString &link) { connect(this, &KitAspectWidget::labelLinkActivated, this, [=](const QString &) {
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-generators.7.html"); CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-generators.7.html");
}); });
@@ -972,7 +972,7 @@ private:
"To set a variable, use -D&lt;variable&gt;:&lt;type&gt;=&lt;value&gt;.<br/>" "To set a variable, use -D&lt;variable&gt;:&lt;type&gt;=&lt;value&gt;.<br/>"
"&lt;type&gt; can have one of the following values: FILEPATH, PATH, " "&lt;type&gt; can have one of the following values: FILEPATH, PATH, "
"BOOL, INTERNAL, or STRING.")); "BOOL, INTERNAL, or STRING."));
connect(editorLabel, &QLabel::linkActivated, this, [=](const QString &link) { connect(editorLabel, &QLabel::linkActivated, this, [=](const QString &) {
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-variables.7.html"); CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake-variables.7.html");
}); });
m_editor->setMinimumSize(800, 200); m_editor->setMinimumSize(800, 200);
@@ -984,7 +984,7 @@ private:
m_additionalEditor = new QLineEdit; m_additionalEditor = new QLineEdit;
auto additionalLabel = new QLabel(m_dialog); auto additionalLabel = new QLabel(m_dialog);
additionalLabel->setText(tr("Additional CMake <a href=\"options\">options</a>:")); additionalLabel->setText(tr("Additional CMake <a href=\"options\">options</a>:"));
connect(additionalLabel, &QLabel::linkActivated, this, [=](const QString &link) { connect(additionalLabel, &QLabel::linkActivated, this, [=](const QString &) {
CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options"); CMakeTool::openCMakeHelpUrl(tool, "%1/manual/cmake.1.html#options");
}); });

View File

@@ -1026,6 +1026,7 @@ FilePath DockerDevice::mapToLocalAccess(const FilePath &filePath) const
return FilePath::fromString(d->m_mergedDir + '/' + path); return FilePath::fromString(d->m_mergedDir + '/' + path);
#else #else
QTC_CHECK(false); QTC_CHECK(false);
Q_UNUSED(filePath)
return {}; return {};
#endif #endif
} }
@@ -1043,6 +1044,7 @@ FilePath DockerDevice::mapFromLocalAccess(const QString &filePath) const
QTC_ASSERT(filePath.startsWith(d->m_mergedDir), return FilePath::fromString(filePath)); QTC_ASSERT(filePath.startsWith(d->m_mergedDir), return FilePath::fromString(filePath));
return mapToGlobalPath(FilePath::fromString(filePath.mid(d->m_mergedDir.size()))); return mapToGlobalPath(FilePath::fromString(filePath.mid(d->m_mergedDir.size())));
#else #else
Q_UNUSED(filePath)
QTC_CHECK(false); QTC_CHECK(false);
return {}; return {};
#endif #endif

View File

@@ -161,6 +161,8 @@ ItemLibraryWidget::ItemLibraryWidget(AsynchronousImageCache &imageCache,
, m_itemsWidget(new QQuickWidget(this)) , m_itemsWidget(new QQuickWidget(this))
, m_imageCache{imageCache} , m_imageCache{imageCache}
{ {
Q_UNUSED(asynchronousFontImageCache)
m_compressionTimer.setInterval(200); m_compressionTimer.setInterval(200);
m_compressionTimer.setSingleShot(true); m_compressionTimer.setSingleShot(true);
ItemLibraryModel::registerQmlTypes(); ItemLibraryModel::registerQmlTypes();

View File

@@ -865,7 +865,7 @@ ModelNode RewriterView::nodeAtTextCursorPositionHelper(const ModelNode &root, in
for (const myPair &pair : data) { for (const myPair &pair : data) {
ModelNode node = pair.first; ModelNode node = pair.first;
i++; i++;
if (i >= data.size()) { if (i >= int(data.size())) {
lastNode = node; lastNode = node;
break; break;
} }

View File

@@ -58,7 +58,7 @@ QStringList RecentPresetsStore::addRecentToExisting(const RecentPreset &preset,
Utils::erase_one(recents, preset); Utils::erase_one(recents, preset);
Utils::prepend(recents, preset); Utils::prepend(recents, preset);
if (recents.size() > m_max) if (int(recents.size()) > m_max)
recents.pop_back(); recents.pop_back();
return encodeRecentPresets(recents); return encodeRecentPresets(recents);