summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2019-09-12 09:08:04 +0200
committerEike Ziller <eike.ziller@qt.io>2019-09-12 09:08:04 +0200
commit8df0653bf8cbb7778d5ab3e32890005874a5a92a (patch)
tree565663026d037862c755bcf80887138666bca7f2
parent3a5ca31a7ebcc43427802d52bc825e4869d8619d (diff)
parenta21df46481f580d0f74b5f82f3f3ce1df2445129 (diff)
downloadqt-creator-8df0653bf8cbb7778d5ab3e32890005874a5a92a.tar.gz
Merge remote-tracking branch 'origin/4.10'
Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs qtcreator_ide_branding.pri src/plugins/projectexplorer/gcctoolchain.cpp src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp Change-Id: Iffdf48e782a734107ea170ebb3812e997cea0e7b
-rw-r--r--README.md10
-rw-r--r--cmake/QtCreatorIDEBranding.cmake1
-rw-r--r--doc/src/qtquick/creator-only/qtquick-modules-with-plugins.qdoc2
-rw-r--r--share/qtcreator/debugger/stdtypes.py18
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml4
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml76
-rw-r--r--src/libs/clangsupport/projectpartartefact.cpp6
-rw-r--r--src/libs/qmljs/qmljscheck.cpp6
-rw-r--r--src/libs/qtcreatorcdbext/extensioncontext.h2
-rw-r--r--src/libs/utils/pathchooser.cpp4
-rw-r--r--src/libs/utils/textfileformat.cpp11
-rw-r--r--src/plugins/clangformat/clangformatconfigwidget.cpp5
-rw-r--r--src/plugins/clangformat/clangformatplugin.cpp1
-rw-r--r--src/plugins/cpptools/cpplocatorfilter.cpp7
-rw-r--r--src/plugins/debugger/qml/qmlinspectoragent.cpp2
-rw-r--r--src/plugins/languageclient/languageclientmanager.cpp4
-rw-r--r--src/plugins/projectexplorer/gcctoolchain.cpp6
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/treeitem.cpp4
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/fileresourcesmodel.cpp2
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp2
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp3
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.cpp22
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h6
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp9
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp2
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelinetoolbar.cpp11
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelineview.cpp34
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelineview.h1
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp1
-rw-r--r--src/plugins/qmldesigner/designercore/include/qmlitemnode.h2
-rw-r--r--src/plugins/qmldesigner/designercore/include/qmlobjectnode.h1
-rw-r--r--src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp5
-rw-r--r--src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp6
-rw-r--r--src/plugins/qmlpreview/qmlpreviewruncontrol.cpp2
-rw-r--r--src/plugins/qtsupport/qtoutputformatter.cpp2
-rw-r--r--src/plugins/texteditor/basefilefind.cpp5
-rw-r--r--src/shared/clang/clang_installation.pri1
m---------src/shared/qbs0
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp27
39 files changed, 233 insertions, 80 deletions
diff --git a/README.md b/README.md
index 5706f34bf8..7ff6307201 100644
--- a/README.md
+++ b/README.md
@@ -272,6 +272,16 @@ http://llvm.org/docs/GettingStarted.html#git-mirror:
cmake -G "NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RTTI=ON -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_INSTALL_PREFIX=<installation location> ..\llvm-project\llvm
jom install
+### Clang-Format
+
+The ClangFormat plugin depends on the additional patch
+
+ https://code.qt.io/cgit/clang/clang.git/commit/?h=release_80-based&id=f98a155c89df094fb8f419a20629065f25fe599a
+
+While the plugin builds without it, it will be disabled on start with an error message.
+
+Note that the plugin is disabled by default.
+
## Third-party Components
Qt Creator includes the following third-party components,
diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake
index 63581b9720..c973fa6f03 100644
--- a/cmake/QtCreatorIDEBranding.cmake
+++ b/cmake/QtCreatorIDEBranding.cmake
@@ -4,7 +4,6 @@
set(IDE_VERSION "4.10.82") # The IDE version.
set(IDE_VERSION_COMPAT "4.10.82") # The IDE Compatibility version.
set(IDE_VERSION_DISPLAY "4.11.0-beta1") # The IDE display version.
-set(IDE_COPYRIGHT_YEAR "2019") # The IDE copyright year.
set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation.
set(IDE_COPY_SETTINGSVARIANT "Nokia") # The IDE settings to initially import.
diff --git a/doc/src/qtquick/creator-only/qtquick-modules-with-plugins.qdoc b/doc/src/qtquick/creator-only/qtquick-modules-with-plugins.qdoc
index 0601da4e19..f26079462d 100644
--- a/doc/src/qtquick/creator-only/qtquick-modules-with-plugins.qdoc
+++ b/doc/src/qtquick/creator-only/qtquick-modules-with-plugins.qdoc
@@ -145,7 +145,7 @@
set the QML import path:
\code
- {set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/qml ${CMAKE_BINARY_DIR}/imports CACHE string "" FORCE)}
+ set(QML_IMPORT_PATH ${CMAKE_SOURCE_DIR}/qml ${CMAKE_BINARY_DIR}/imports CACHE STRING "" FORCE)
\endcode
The import path affects all the targets built by the CMake project.
diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py
index bdbaea14d5..2f51aa2ec1 100644
--- a/share/qtcreator/debugger/stdtypes.py
+++ b/share/qtcreator/debugger/stdtypes.py
@@ -1039,6 +1039,24 @@ def qdump__std____debug__vector(d, value):
qdump__std__vector(d, value)
+def qdump__std__initializer_list(d, value):
+ innerType = value.type[0]
+ if d.isMsvcTarget():
+ start = value["_First"].pointer()
+ end = value["_Last"].pointer()
+ size = int((end - start) / innerType.size())
+ else:
+ try:
+ start = value["_M_array"].pointer()
+ size = value["_M_len"].integer()
+ except:
+ start = value["__begin_"].pointer()
+ size = value["__size_"].integer()
+
+ d.putItemCount(size)
+ if d.isExpanded():
+ d.putPlotData(start, size, innerType)
+
def qedit__std__string(d, value, data):
d.call('void', value, 'assign', '"%s"' % data.replace('"', '\\"'))
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
index 5eb3a7cf85..d21f5f19fa 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
@@ -247,8 +247,8 @@ Rectangle {
active = true
}
- property int loaderHeight: specificsOne.item.height + tabView.extraHeight
- onLoaderHeightChanged: tabView.specficsOneHeight = loaderHeight
+ property int loaderHeight: specificsTwo.item.height + tabView.extraHeight
+ onLoaderHeightChanged: tabView.specficsTwoHeight = loaderHeight
onLoaded: {
tabView.specficsTwoHeight = loaderHeight
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml
index 67e0cff45a..2136b9c9dc 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml
@@ -53,10 +53,54 @@ Rectangle {
}
SecondColumnLayout {
+ z: 2
- Label {
- text: backendValues.className.value
- width: lineEdit.width
+ RoundedPanel {
+ Layout.fillWidth: true
+ height: 24
+
+ Label {
+ x: 6
+ anchors.fill: parent
+ anchors.leftMargin: 16
+
+ text: backendValues.className.value
+ verticalAlignment: Text.AlignVCenter
+ }
+ ToolTipArea {
+ anchors.fill: parent
+ onDoubleClicked: {
+ typeLineEdit.text = backendValues.className.value
+ typeLineEdit.visible = ! typeLineEdit.visible
+ typeLineEdit.forceActiveFocus()
+ }
+ tooltip: qsTr("Change the type of this item.")
+ enabled: !modelNodeBackend.multiSelection
+ }
+
+ ExpressionTextField {
+ z: 2
+ id: typeLineEdit
+ completeOnlyTypes: true
+
+ anchors.fill: parent
+
+ visible: false
+
+ showButtons: false
+ fixedSize: true
+
+ onEditingFinished: {
+ if (visible)
+ changeTypeName(typeLineEdit.text.trim())
+ visible = false
+ }
+ }
+
+ }
+ Item {
+ Layout.preferredWidth: 16
+ Layout.preferredHeight: 16
}
}
@@ -104,7 +148,19 @@ Rectangle {
anchors.right: parent.right
frameVisible: false
+ id: tabView
+ height: Math.max(layoutSectionHeight, specficsHeight)
+
+ property int layoutSectionHeight: 400
+ property int specficsOneHeight: 0
+ property int specficsTwoHeight: 0
+
+ property int specficsHeight: Math.max(specficsOneHeight, specficsTwoHeight)
+
+ property int extraHeight: 40
+
Tab {
+ id: tab
title: backendValues.className.value
component: Column {
@@ -125,6 +181,13 @@ Rectangle {
active = false
active = true
}
+
+ property int loaderHeight: specificsTwo.item.height + tabView.extraHeight
+ onLoaderHeightChanged: tabView.specficsTwoHeight = loaderHeight
+
+ onLoaded: {
+ tabView.specficsTwoHeight = loaderHeight
+ }
}
Loader {
@@ -133,6 +196,13 @@ Rectangle {
id: specificsOne;
source: specificsUrl;
+
+ property int loaderHeight: specificsOne.item.height + tabView.extraHeight
+ onLoaderHeightChanged: tabView.specficsHeight = loaderHeight
+
+ onLoaded: {
+ tabView.specficsOneHeight = loaderHeight
+ }
}
}
}
diff --git a/src/libs/clangsupport/projectpartartefact.cpp b/src/libs/clangsupport/projectpartartefact.cpp
index 56551693e1..2c6b095ab2 100644
--- a/src/libs/clangsupport/projectpartartefact.cpp
+++ b/src/libs/clangsupport/projectpartartefact.cpp
@@ -90,9 +90,9 @@ QJsonDocument ProjectPartArtefact::createJsonDocument(Utils::SmallStringView jso
const char *whatError)
{
QJsonParseError error;
- QJsonDocument document = QJsonDocument::fromJson(QByteArray::fromRawData(jsonText.data(),
- jsonText.size()),
- &error);
+ QJsonDocument document = QJsonDocument::fromJson(
+ QByteArray::fromRawData(jsonText.data(), int(jsonText.size())),
+ &error);
checkError(whatError, error);
return document;
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp
index 06dbe7d8d2..e3fe353b95 100644
--- a/src/libs/qmljs/qmljscheck.cpp
+++ b/src/libs/qmljs/qmljscheck.cpp
@@ -594,11 +594,7 @@ public:
class UnsupportedTypesByVisualDesigner : public QStringList
{
public:
- UnsupportedTypesByVisualDesigner() : QStringList({"Transform",
- "Timer",
- "Rotation",
- "Scale",
- "Translate",
+ UnsupportedTypesByVisualDesigner() : QStringList({"Timer",
"Package",
"Particles"})
{}
diff --git a/src/libs/qtcreatorcdbext/extensioncontext.h b/src/libs/qtcreatorcdbext/extensioncontext.h
index 1cdbb77a92..e1a27f3a9a 100644
--- a/src/libs/qtcreatorcdbext/extensioncontext.h
+++ b/src/libs/qtcreatorcdbext/extensioncontext.h
@@ -87,7 +87,7 @@ public:
* 'X' exception, error. If the message is larger than outputChunkSize,
* it needs to be split up in chunks, remainingChunks needs to indicate the number
* of the following chunks (0 for just one chunk). */
- bool report(char code, int remainingChunks, int token, const char *serviceName, PCSTR Format, ...);
+ bool report(char code, int token, int remainingChunks, const char *serviceName, PCSTR Format, ...);
// Convenience for reporting potentially long messages in chunks
bool reportLong(char code, int token, const char *serviceName, const std::string &message);
ULONG executionStatus() const;
diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp
index 611a2b8c6d..a4cc97407a 100644
--- a/src/libs/utils/pathchooser.cpp
+++ b/src/libs/utils/pathchooser.cpp
@@ -450,6 +450,10 @@ void PathChooser::slotBrowse()
break;
}
+ // work around QTBUG-61004 / QTCREATORBUG-22906
+ window()->raise();
+ window()->activateWindow();
+
// Delete trailing slashes unless it is "/"|"\\", only
if (!newPath.isEmpty()) {
newPath = QDir::toNativeSeparators(newPath);
diff --git a/src/libs/utils/textfileformat.cpp b/src/libs/utils/textfileformat.cpp
index afd4e62e83..ea682edae9 100644
--- a/src/libs/utils/textfileformat.cpp
+++ b/src/libs/utils/textfileformat.cpp
@@ -302,14 +302,11 @@ bool TextFileFormat::writeFile(const QString &fileName, QString plainText, QStri
QTC_ASSERT(codec, return false);
// Does the user want CRLF? If that is native,
- // let QFile do the work, else manually add.
+ // do net let QFile do the work, because it replaces the line ending after the text was encoded,
+ // and this could lead to undecodable file contents.
QIODevice::OpenMode fileMode = QIODevice::NotOpen;
- if (lineTerminationMode == CRLFLineTerminator) {
- if (NativeLineTerminator == CRLFLineTerminator)
- fileMode |= QIODevice::Text;
- else
- plainText.replace(QLatin1Char('\n'), QLatin1String("\r\n"));
- }
+ if (lineTerminationMode == CRLFLineTerminator)
+ plainText.replace(QLatin1Char('\n'), QLatin1String("\r\n"));
FileSaver saver(fileName, fileMode);
if (!saver.hasError()) {
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;
diff --git a/src/shared/clang/clang_installation.pri b/src/shared/clang/clang_installation.pri
index df3ce19db2..08838838bc 100644
--- a/src/shared/clang/clang_installation.pri
+++ b/src/shared/clang/clang_installation.pri
@@ -179,6 +179,7 @@ isEmpty(LLVM_VERSION) {
# clang/Format/Format.h has intentional multiline comments
QMAKE_CXXFLAGS += -Wno-unused-parameter -Wno-comment
}
+ msvc:QMAKE_CXXFLAGS_WARN_ON += -wd4100 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291
LLVM_LIBDIR = $$quote($$system($$llvm_config --libdir, lines))
LLVM_BINDIR = $$quote($$system($$llvm_config --bindir, lines))
diff --git a/src/shared/qbs b/src/shared/qbs
-Subproject 5367331250368ada068c02c3027369e1d7a59ee
+Subproject 8c290c624d343406442b87121ccb2e4eab0e6e5
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index e5be41a104..3faa87b1d2 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -5153,6 +5153,33 @@ void tst_Dumpers::dumper_data()
+ Check("set2.0", "[0]", "42", "int")
+ Check("set2.1", "[1]", "42", "int");
+ QTest::newRow("StdInitializerList")
+ << Data("#include <initializer_list>\n",
+ "auto initb = {true, false, false, true};\n"
+ "auto initi = {1, 2, 3};\n"
+ "auto inits = {\"1\", \"2\", \"3\"};\n"
+ "std::initializer_list<int> empty;\n"
+ "unused(&initb, &initi, &inits, &empty);\n")
+
+ + Cxx11Profile()
+
+ + Check("initb", "<4 items>", "std::initializer_list<bool>")
+ + Check("initb.0", "[0]", "1", "bool") // 1 -> true is done on display
+ + Check("initb.1", "[1]", "0", "bool")
+ + Check("initb.2", "[2]", "0", "bool")
+ + Check("initb.3", "[3]", "1", "bool")
+
+ + Check("initi", "<3 items>", "std::initializer_list<int>")
+ + Check("initi.0", "[0]", "1", "int")
+ + Check("initi.1", "[1]", "2", "int")
+ + Check("initi.2", "[2]", "3", "int")
+
+ + Check("inits", "<3 items>", "std::initializer_list<const char *>")
+ + Check("inits.0", "[0]", "\"1\"", "char*")
+ + Check("inits.1", "[1]", "\"2\"", "char*")
+ + Check("inits.2", "[2]", "\"3\"", "char*")
+
+ + Check("empty", "<0 items>", "std::initializer_list<int>");
// class Goo
// {