diff options
Diffstat (limited to 'src/plugins')
25 files changed, 88 insertions, 57 deletions
diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index f419780a3e..311a524315 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -137,9 +137,8 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(ProjectExplorer::Project *proje tr("Override Clang Format configuration file with the fallback configuration.")); } - connect(m_ui->overrideDefault, &QCheckBox::toggled, this, [this](bool checked) { - showOrHideWidgets(); - }); + connect(m_ui->overrideDefault, &QCheckBox::toggled, + this, &ClangFormatConfigWidget::showOrHideWidgets); showOrHideWidgets(); fillTable(); diff --git a/src/plugins/clangformat/clangformatplugin.cpp b/src/plugins/clangformat/clangformatplugin.cpp index 50775d1c15..2e0ed55d23 100644 --- a/src/plugins/clangformat/clangformatplugin.cpp +++ b/src/plugins/clangformat/clangformatplugin.cpp @@ -79,6 +79,7 @@ public: TextEditor::CodeStyleEditorWidget *createCodeStyleEditor( TextEditor::ICodeStylePreferences *preferences, QWidget *parent = nullptr) override { + Q_UNUSED(preferences); if (!parent) return new ClangFormatConfigWidget; return new ClangFormatConfigWidget(SessionManager::startupProject()); diff --git a/src/plugins/cpptools/cpplocatorfilter.cpp b/src/plugins/cpptools/cpplocatorfilter.cpp index bfc93c7e53..000091bde4 100644 --- a/src/plugins/cpptools/cpplocatorfilter.cpp +++ b/src/plugins/cpptools/cpplocatorfilter.cpp @@ -106,7 +106,12 @@ QList<Core::LocatorFilterEntry> CppLocatorFilter::matchesFor( matchOffset = 0; } filterEntry.highlightInfo = highlightInfo(match); - if (matchOffset > 0) { + if (matchInParameterList && filterEntry.highlightInfo.starts.isEmpty()) { + match = regexp.match(filterEntry.extraInfo); + filterEntry.highlightInfo = highlightInfo(match); + filterEntry.highlightInfo.dataType = + Core::LocatorFilterEntry::HighlightInfo::ExtraInfo; + } else if (matchOffset > 0) { for (int &start : filterEntry.highlightInfo.starts) start -= matchOffset; } diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp index d874432af4..3f4599c49b 100644 --- a/src/plugins/debugger/qml/qmlinspectoragent.cpp +++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp @@ -436,7 +436,7 @@ void QmlInspectorAgent::verifyAndInsertObjectInTree(const ObjectReference &objec const auto it = m_debugIdToIname.find(objectDebugId); if (it != m_debugIdToIname.end()) { const QString iname = *it; - const int firstIndex = strlen("inspect"); + const int firstIndex = int(strlen("inspect")); const int secondIndex = iname.indexOf('.', firstIndex + 1); if (secondIndex != -1) engineId = iname.midRef(firstIndex + 1, secondIndex - firstIndex - 1).toInt(); diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index e1d9546b3c..9f902bcae4 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -469,7 +469,7 @@ void LanguageClientManager::documentContentsSaved(Core::IDocument *document) void LanguageClientManager::documentWillSave(Core::IDocument *document) { for (Client *interface : reachableClients()) - interface->documentContentsSaved(document); + interface->documentWillSave(document); } void LanguageClientManager::findLinkAt(const Utils::FilePath &filePath, @@ -546,7 +546,7 @@ void LanguageClientManager::findUsages(const Utils::FilePath &filePath, const QT ReferenceParams params(TextDocumentPositionParams(document, pos)); params.setContext(ReferenceParams::ReferenceContext(true)); FindReferencesRequest request(params); - auto callback = [wordUnderCursor = termCursor.selectedText()] + auto callback = [this, wordUnderCursor = termCursor.selectedText()] (const QString &clientName, const FindReferencesRequest::Response &response){ if (auto result = response.result()) { Core::SearchResult *search = Core::SearchResultWindow::instance()->startNewSearch( diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index 760fc2f705..df6a1286fe 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -604,7 +604,8 @@ ToolChain::BuiltInHeaderPathsRunner GccToolChain::createBuiltInHeaderPathsRunner addToEnvironment(fullEnv); // This runner must be thread-safe! - return [fullEnv, + return [this, + fullEnv, compilerCommand = m_compilerCommand, platformCodeGenFlags = m_platformCodeGenFlags, reinterpretOptions = m_optionsReinterpreter, @@ -1487,7 +1488,8 @@ ToolChain::BuiltInHeaderPathsRunner ClangToolChain::createBuiltInHeaderPathsRunn addToEnvironment(fullEnv); // This runner must be thread-safe! - return [fullEnv, + return [this, + fullEnv, compilerCommand = m_compilerCommand, platformCodeGenFlags = m_platformCodeGenFlags, reinterpretOptions = m_optionsReinterpreter, diff --git a/src/plugins/qmldesigner/components/curveeditor/treeitem.cpp b/src/plugins/qmldesigner/components/curveeditor/treeitem.cpp index 61002162a8..4b66f96b56 100644 --- a/src/plugins/qmldesigner/components/curveeditor/treeitem.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/treeitem.cpp @@ -123,7 +123,7 @@ bool TreeItem::compare(const std::vector<QString> &path) const int TreeItem::row() const { if (m_parent) { - for (size_t i = 0; i < m_parent->m_children.size(); ++i) { + for (int i = 0, total = int(m_parent->m_children.size()); i < total; ++i) { if (m_parent->m_children[i] == this) return i; } @@ -139,7 +139,7 @@ int TreeItem::column() const int TreeItem::rowCount() const { - return m_children.size(); + return int(m_children.size()); } int TreeItem::columnCount() const diff --git a/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp index 0b5f79a39e..63f17f284a 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp @@ -49,7 +49,7 @@ void FileResourcesModel::setModelNodeBackend(const QVariant &modelNodeBackend) qobject_cast<const QmlDesigner::QmlModelNodeProxy *>(modelNodeBackendObject); if (backendObjectCasted) - m_path = backendObjectCasted->qmlItemNode().modelNode().model()->fileUrl(); + m_path = backendObjectCasted->qmlObjectNode().modelNode().model()->fileUrl(); setupModel(); emit modelNodeBackendChanged(); diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp index d553ccca22..f9eb7465e2 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp @@ -98,7 +98,7 @@ QString PropertyEditorContextObject::convertColorToString(const QColor &color) QString colorString = color.name(); if (color.alpha() != 255) { - const QString hexAlpha = QString::number(color.alpha(), 16); + QString hexAlpha = QString("%1").arg(color.alpha(), 2, 16, QLatin1Char('0')); colorString.remove(0,1); colorString.prepend(hexAlpha); colorString.prepend(QStringLiteral("#")); diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index c0b96a7bae..aec4c3b7a1 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -264,9 +264,6 @@ PropertyEditorValue *PropertyEditorQmlBackend::propertyValueForName(const QStrin void PropertyEditorQmlBackend::setup(const QmlObjectNode &qmlObjectNode, const QString &stateName, const QUrl &qmlSpecificsFile, PropertyEditorView *propertyEditor) { - if (!qmlObjectNode.isValid()) - return; - if (qmlObjectNode.isValid()) { m_contextObject->setModel(propertyEditor->model()); diff --git a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp index 934c284691..57e6d8ba27 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp @@ -35,9 +35,9 @@ QmlModelNodeProxy::QmlModelNodeProxy(QObject *parent) : { } -void QmlModelNodeProxy::setup(const QmlItemNode &itemNode) +void QmlModelNodeProxy::setup(const QmlObjectNode &objectNode) { - m_qmlItemNode = itemNode; + m_qmlObjectNode = objectNode; emit modelNodeChanged(); } @@ -57,44 +57,44 @@ void QmlModelNodeProxy::emitSelectionChanged() emit selectionChanged(); } -QmlItemNode QmlModelNodeProxy::qmlItemNode() const +QmlObjectNode QmlModelNodeProxy::qmlObjectNode() const { - return m_qmlItemNode; + return m_qmlObjectNode; } ModelNode QmlModelNodeProxy::modelNode() const { - return m_qmlItemNode.modelNode(); + return m_qmlObjectNode.modelNode(); } bool QmlModelNodeProxy::multiSelection() const { - if (!m_qmlItemNode.isValid()) + if (!m_qmlObjectNode.isValid()) return false; - return m_qmlItemNode.view()->selectedModelNodes().count() > 1; + return m_qmlObjectNode.view()->selectedModelNodes().count() > 1; } QString QmlModelNodeProxy::nodeId() const { - if (!m_qmlItemNode.isValid()) + if (!m_qmlObjectNode.isValid()) return {}; if (multiSelection()) return tr("multiselection"); - return m_qmlItemNode.id(); + return m_qmlObjectNode.id(); } QString QmlModelNodeProxy::simplifiedTypeName() const { - if (!m_qmlItemNode.isValid()) + if (!m_qmlObjectNode.isValid()) return {}; if (multiSelection()) return tr("multiselection"); - return m_qmlItemNode.simplifiedTypeName(); + return m_qmlObjectNode.simplifiedTypeName(); } } diff --git a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h index 6037f32752..70b14b1372 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h +++ b/src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h @@ -41,14 +41,14 @@ class QmlModelNodeProxy : public QObject public: explicit QmlModelNodeProxy(QObject *parent = nullptr); - void setup(const QmlItemNode &itemNode); + void setup(const QmlObjectNode &objectNode); static void registerDeclarativeType(); void emitSelectionToBeChanged(); void emitSelectionChanged(); - QmlItemNode qmlItemNode() const; + QmlObjectNode qmlObjectNode() const; ModelNode modelNode() const; @@ -64,7 +64,7 @@ signals: void selectionChanged(); private: - QmlItemNode m_qmlItemNode; + QmlObjectNode m_qmlObjectNode; }; } //QmlDesigner diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp index bafca7fa58..5676cc2ca4 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp @@ -184,10 +184,11 @@ void StatesEditorModel::renameState(int internalNodeId, const QString &newName) if (newName.isEmpty() ||! m_statesEditorView->validStateName(newName)) { QTimer::singleShot(0, [newName]{ - Core::AsynchronousMessageBox::warning(tr("Invalid state name"), - newName.isEmpty() ? - tr("The empty string as a name is reserved for the base state.") : - tr("Name already used in another state")); + Core::AsynchronousMessageBox::warning( + tr("Invalid state name"), + newName.isEmpty() ? + tr("The empty string as a name is reserved for the base state.") : + tr("Name already used in another state")); }); reset(); } else { diff --git a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp index b88e1ada95..7b27194582 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp @@ -207,7 +207,7 @@ std::vector<DesignTools::Keyframe> resolveSmallCurves( if (curve.toCubicSpline().count() == 3) { DesignTools::Keyframe &previous = out.back(); DesignTools::AnimationCurve acurve(curve, previous.position(), frame.position()); - previous = acurve.keyframeAt(0); + previous.setRightHandle(acurve.keyframeAt(0).rightHandle()); out.push_back(acurve.keyframeAt(1)); continue; } diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp index 6e6ae34e43..8ad8499d17 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp @@ -29,12 +29,14 @@ #include "timelinegraphicsscene.h" #include "timelineicons.h" +#include "timelineview.h" #include "timelinewidget.h" #include <designeractionmanager.h> #include <nodelistproperty.h> #include <theme.h> #include <variantproperty.h> +#include <qmlstate.h> #include <qmltimeline.h> #include <qmltimelinekeyframegroup.h> @@ -125,6 +127,8 @@ void TimelineToolBar::reset() { if (recording()) m_recording->setChecked(false); + + m_curveModel->reset({}); } bool TimelineToolBar::recording() const @@ -222,6 +226,13 @@ void TimelineToolBar::removeTimeline(const QmlTimeline &timeline) void TimelineToolBar::openAnimationCurveEditor() { + QmlTimeline timeline; + if (auto *tlw = qobject_cast<TimelineWidget *>(parent())) { + if (auto *tlv = tlw->timelineView()) + timeline = tlv->timelineForState(tlv->currentState()); + } + + m_curveModel->setTimeline(timeline); m_dialog.show(); } diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp index feb499916c..0fc98d2658 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp @@ -106,6 +106,7 @@ void TimelineView::nodeAboutToBeRemoved(const ModelNode &removedNode) m_timelineWidget->graphicsScene()->clearTimeline(); if (lastId != currentId) m_timelineWidget->setTimelineId(currentId); + } else if (removedNode.parentProperty().isValid() && QmlTimeline::isValidQmlTimeline( removedNode.parentProperty().parentModelNode())) { @@ -136,6 +137,10 @@ void TimelineView::nodeRemoved(const ModelNode & /*removedNode*/, parentProperty.parentModelNode())) { QmlTimelineKeyframeGroup frames(parentProperty.parentModelNode()); m_timelineWidget->graphicsScene()->invalidateSectionForTarget(frames.target()); + updateAnimationCurveEditor(); + } else if (parentProperty.isValid() + && QmlTimeline::isValidQmlTimeline(parentProperty.parentModelNode())) { + updateAnimationCurveEditor(); } } @@ -150,14 +155,14 @@ void TimelineView::nodeReparented(const ModelNode &node, QmlTimelineKeyframeGroup frames(newPropertyParent.parentModelNode()); m_timelineWidget->graphicsScene()->invalidateSectionForTarget(frames.target()); - QmlTimeline currentTimeline = m_timelineWidget->graphicsScene()->currentTimeline(); - if (currentTimeline.isValid() && propertyChange == AbstractView::NoAdditionalChanges) - m_timelineWidget->toolBar()->setCurrentTimeline(currentTimeline); + if (propertyChange == AbstractView::NoAdditionalChanges) + updateAnimationCurveEditor(); } else if (QmlTimelineKeyframeGroup::checkKeyframesType( node)) { /* During copy and paste type info might be incomplete */ QmlTimelineKeyframeGroup frames(node); m_timelineWidget->graphicsScene()->invalidateSectionForTarget(frames.target()); + updateAnimationCurveEditor(); } } @@ -194,10 +199,7 @@ void TimelineView::variantPropertiesChanged(const QList<VariantProperty> &proper if (QmlTimelineKeyframeGroup::isValidQmlTimelineKeyframeGroup(framesNode)) { QmlTimelineKeyframeGroup frames(framesNode); m_timelineWidget->graphicsScene()->invalidateKeyframesForTarget(frames.target()); - - QmlTimeline currentTimeline = m_timelineWidget->graphicsScene()->currentTimeline(); - if (currentTimeline.isValid()) - m_timelineWidget->toolBar()->setCurrentTimeline(currentTimeline); + updateAnimationCurveEditor(); } } } @@ -209,9 +211,7 @@ void TimelineView::bindingPropertiesChanged(const QList<BindingProperty> &proper Q_UNUSED(propertyChange) for (const auto &property : propertyList) { if (property.name() == "easing.bezierCurve") { - QmlTimeline currentTimeline = m_timelineWidget->graphicsScene()->currentTimeline(); - if (currentTimeline.isValid()) - m_timelineWidget->toolBar()->setCurrentTimeline(currentTimeline); + updateAnimationCurveEditor(); } } } @@ -242,8 +242,10 @@ void TimelineView::propertiesRemoved(const QList<AbstractProperty> &propertyList property.parentModelNode())) { QmlTimelineKeyframeGroup frames(property.parentModelNode()); m_timelineWidget->graphicsScene()->invalidateSectionForTarget(frames.target()); + updateAnimationCurveEditor(); } else if (QmlTimeline::isValidQmlTimeline(property.parentModelNode())) { m_timelineWidget->graphicsScene()->invalidateScene(); + updateAnimationCurveEditor(); } } } @@ -630,4 +632,16 @@ void TimelineView::ensureQtQuickTimelineImport() } } +void TimelineView::updateAnimationCurveEditor() +{ + if (!m_timelineWidget) + return; + + QmlTimeline currentTimeline = timelineForState(currentState()); + if (currentTimeline.isValid()) + m_timelineWidget->toolBar()->setCurrentTimeline(currentTimeline); + else + m_timelineWidget->toolBar()->reset(); +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineview.h b/src/plugins/qmldesigner/components/timelineeditor/timelineview.h index 17ecc3b538..ec85e08ccf 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineview.h +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineview.h @@ -95,6 +95,7 @@ public: QmlModelState stateForTimeline(const QmlTimeline &timeline); void registerActions(); + void updateAnimationCurveEditor(); private: TimelineWidget *createWidget(); diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp index d4242b2d52..522607f615 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp @@ -441,7 +441,6 @@ void TimelineWidget::invalidateTimelineDuration(const QmlTimeline &timeline) if (timelineView() && timelineView()->model()) { QmlTimeline currentTimeline = graphicsScene()->currentTimeline(); if (currentTimeline.isValid() && currentTimeline == timeline) { - m_toolbar->setCurrentTimeline(timeline); graphicsScene()->setTimeline(timeline); graphicsScene()->setCurrenFrame(timeline, getcurrentFrame(timeline)); } diff --git a/src/plugins/qmldesigner/designercore/include/qmlitemnode.h b/src/plugins/qmldesigner/designercore/include/qmlitemnode.h index 1560ebb3ff..3e19515147 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlitemnode.h +++ b/src/plugins/qmldesigner/designercore/include/qmlitemnode.h @@ -115,8 +115,6 @@ public: QPixmap instanceRenderPixmap() const; QPixmap instanceBlurredRenderPixmap() const; - QString simplifiedTypeName() const; - const QList<QmlItemNode> allDirectSubModelNodes() const; const QList<QmlItemNode> allSubModelNodes() const; bool hasAnySubModelNodes() const; diff --git a/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h b/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h index 8f539bc036..5a212ba5ce 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h +++ b/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h @@ -114,6 +114,7 @@ public: static QVariant instanceValue(const ModelNode &modelNode, const PropertyName &name); static QString generateTranslatableText(const QString& text); + QString simplifiedTypeName() const; protected: NodeInstance nodeInstance() const; diff --git a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp index 65b34f1de4..3b682afcfb 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp @@ -508,11 +508,6 @@ QList<QmlModelState> QmlModelStateGroup::allStates() const return returnList; } -QString QmlItemNode::simplifiedTypeName() const -{ - return modelNode().simplifiedTypeName(); -} - uint qHash(const QmlItemNode &node) { return qHash(node.modelNode()); diff --git a/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp index b571fd473f..8174c9a1a5 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp @@ -693,4 +693,10 @@ uint qHash(const QmlObjectNode &node) { return qHash(node.modelNode()); } + +QString QmlObjectNode::simplifiedTypeName() const +{ + return modelNode().simplifiedTypeName(); +} + } //QmlDesigner diff --git a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp index 13b5c5e4a2..26e3456338 100644 --- a/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp +++ b/src/plugins/qmlpreview/qmlpreviewruncontrol.cpp @@ -73,7 +73,7 @@ QmlPreviewRunner::QmlPreviewRunner(ProjectExplorer::RunControl *runControl, }); connect(&m_connectionManager, &Internal::QmlPreviewConnectionManager::restart, - runControl, [runControl]() { + runControl, [this, runControl]() { if (!runControl->isRunning()) return; diff --git a/src/plugins/qtsupport/qtoutputformatter.cpp b/src/plugins/qtsupport/qtoutputformatter.cpp index b61eaa894b..689ac367cd 100644 --- a/src/plugins/qtsupport/qtoutputformatter.cpp +++ b/src/plugins/qtsupport/qtoutputformatter.cpp @@ -277,7 +277,7 @@ void QtOutputFormatter::handleLink(const QString &href) const QString filePath = qmlLineMatch.captured(1); QUrl fileUrl = QUrl(filePath); if (!fileUrl.isValid() && filePath.startsWith(scheme)) - fileUrl = QUrl::fromLocalFile(filePath.mid(strlen(scheme))); + fileUrl = QUrl::fromLocalFile(filePath.mid(int(strlen(scheme)))); const int line = qmlLineMatch.captured(2).toInt(); openEditor(getFileToOpen(fileUrl), line); return; diff --git a/src/plugins/texteditor/basefilefind.cpp b/src/plugins/texteditor/basefilefind.cpp index 1ffe348c0c..8354e83f50 100644 --- a/src/plugins/texteditor/basefilefind.cpp +++ b/src/plugins/texteditor/basefilefind.cpp @@ -529,8 +529,9 @@ QStringList BaseFileFind::replaceAll(const QString &text, if (item.userData.canConvert<QStringList>() && !item.userData.toStringList().isEmpty()) { replacement = Utils::expandRegExpReplacement(text, item.userData.toStringList()); } else if (preserveCase) { - const QString originalText = (item.mainRange.length() == 0) ? item.text - : item.mainRange.mid(text); + const QString originalText = (item.mainRange.length() == 0) + ? item.text + : item.mainRange.mid(item.text); replacement = Utils::matchCaseReplacement(originalText, text); } else { replacement = text; |