Fix various compiler warnings

Change-Id: Ib64f04f154b2c44dad3248ef038449c2ac628686
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Christian Kandeler
2021-12-01 19:19:09 +01:00
parent f02d143a81
commit b2d63bf79e
11 changed files with 9 additions and 19 deletions

View File

@@ -67,7 +67,6 @@ private:
QLineEdit *m_name = nullptr;
PathChooser *m_java = nullptr;
PathChooser *m_ls = nullptr;
PathChooser *m_workspace = nullptr;
};
JLSSettingsWidget::JLSSettingsWidget(const JLSSettings *settings, QWidget *parent)

View File

@@ -2489,7 +2489,7 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
const Position endPos = startPos.withOffset(token.length, &doc);
return Range(startPos, endPos);
};
const auto isOutputParameter = [&ast, &doc, &tokenRange](const ExpandedSemanticToken &token) {
const auto isOutputParameter = [&ast, &tokenRange](const ExpandedSemanticToken &token) {
if (token.modifiers.contains("usedAsMutableReference"))
return true;
if (token.type != "variable" && token.type != "property" && token.type != "parameter")

View File

@@ -135,7 +135,7 @@ CppEditor::CppCodeStyleSettings ClangFormatFile::toCppCodeStyleSettings(
// Modifier offset should be opposite to indent width in order indentAccessSpecifiers
// to be false
settings.indentAccessSpecifiers = (style.AccessModifierOffset != -1 * style.IndentWidth);
settings.indentAccessSpecifiers = (style.AccessModifierOffset != -1 * int(style.IndentWidth));
settings.indentNamespaceBody = style.NamespaceIndentation
== FormatStyle::NamespaceIndentationKind::NI_All;

View File

@@ -479,7 +479,7 @@ void GitPluginPrivate::onApplySettings()
QString errorMessage;
m_settings.gitExecutable(&gitFoundOk, &errorMessage);
if (!gitFoundOk) {
QTimer::singleShot(0, this, [this, errorMessage] {
QTimer::singleShot(0, this, [errorMessage] {
Core::AsynchronousMessageBox::warning(tr("Git Settings"), errorMessage);
});
}

View File

@@ -633,13 +633,6 @@ static QFileInfoList targetDescriptionFiles(const Utils::FilePath &dir)
return kitsDir.entryInfoList();
}
static QString extractQulVersion(const QByteArray &data)
{
const QJsonDocument document = QJsonDocument::fromJson(data);
const QJsonObject target = document.object();
return target.value("qulVersion").toString();
}
static McuTargetDescription parseDescriptionJsonCommon(const QString &qulVersion, const QJsonObject &target)
{
const QString compatVersion = target.value("compatVersion").toString();

View File

@@ -121,7 +121,7 @@ void OutputTaskParser::runPostPrintActions(QPlainTextEdit *edit)
{
int offset = 0;
if (const auto ow = qobject_cast<Core::OutputWindow *>(edit)) {
Utils::reverseForeach(taskInfo(), [this, ow, &offset](const TaskInfo &ti) {
Utils::reverseForeach(taskInfo(), [ow, &offset](const TaskInfo &ti) {
ow->registerPositionOf(ti.task.taskId, ti.linkedLines, ti.skippedLines, offset);
offset += ti.linkedLines;
});

View File

@@ -96,7 +96,6 @@ QString Theme::replaceCssColors(const QString &input)
{
const QRegularExpression rx("creatorTheme\\.(\\w+)");
int pos = 0;
QString output = input;
QRegularExpressionMatchIterator it = rx.globalMatch(input);
@@ -119,7 +118,6 @@ QString Theme::replaceCssColors(const QString &input)
.arg(color.alpha());
output.replace(replaceExp, rgbaStr + "\\1");
}
pos += match.capturedLength();
}
return output;

View File

@@ -120,7 +120,7 @@ Edit3DWidget::Edit3DWidget(Edit3DView *view) :
view->setSeeker(seeker);
seeker->setToolTip(QLatin1String("Seek particle system time when paused."));
QObject::connect(seeker, &SeekerSlider::positionChanged, [this, seeker](){
QObject::connect(seeker, &SeekerSlider::positionChanged, [seeker](){
QmlDesignerPlugin::instance()->viewManager().nodeInstanceView()
->view3DAction(View3DSeekActionCommand(seeker->position()));
});

View File

@@ -661,7 +661,7 @@ void ItemLibraryAssetImporter::finalizeQuick3DImport()
QTimer *timer = new QTimer(parent());
static int counter;
counter = 0;
timer->callOnTimeout([this, timer, progressTitle, model, doc]() {
timer->callOnTimeout([this, timer, progressTitle, model]() {
if (!isCancelled()) {
notifyProgress(++counter * 5, progressTitle);
if (counter < 10) {

View File

@@ -806,8 +806,8 @@ void TimelineRulerSectionItem::setPlaybackLoopEnabled(bool value)
void TimelineRulerSectionItem::setPlaybackLoopTimes(float startFrame, float endFrame)
{
if (m_playbackLoopEnabled) {
startFrame = startFrame;
endFrame = endFrame;
m_start = startFrame;
m_end = endFrame;
m_playbackLoopStart = startFrame > m_duration ? m_duration : startFrame < 0.0 ? 0.0 : startFrame;
m_playbackLoopEnd = endFrame > m_duration ? m_duration : endFrame < 0.0 ? 0.0 : endFrame;
emit playbackLoopValuesChanged();

View File

@@ -555,7 +555,7 @@ public:
{}
explicit PropertyDeclaration(Utils::SmallStringView name,
TypeId propetyTypeId,
TypeId propertyTypeId,
PropertyDeclarationTraits traits,
Utils::SmallStringView aliasPropertyName)
: name{name}