Commit 361fdad3 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/4.4'

Change-Id: I778acc044ac105a11054b314aecac5b1c2cfee6a
parents 5e38bdbf 41ae823b
Qt Creator version 4.4 contains bug fixes and new features.
The most important changes are listed in this document. For a complete
list of changes, see the Git log for the Qt Creator sources that
you can check out from the public Git repository. For example:
git clone git://
git log --cherry-pick --pretty=oneline origin/4.3..v4.4.0
* Added highlighting of search term in Locator results
* Added larger icons to `New` dialog
* Added locator input to extra editor and help windows (QTCREATORBUG-9696)
* Fixed theming of Debugger Console and TODO pane (QTCREATORBUG-17532)
* Added inline annotations for errors, warnings and bookmarks
* Added optional smooth scrolling when navigating within the same file
(for example with Locator or `Follow Symbol Under Cursor`)
* Added overridable `DeleteStartOfLine` and `DeleteEndOfLine` actions
* Added support for relative path to active project to `Advanced Find` >
`Files in File System` (QTCREATORBUG-18139)
* Added colors to default text editor scheme (the previous default is
available as `Default Classic`)
* FakeVim
* Fixed `gt`/`gT`/`:tabnext`/`:tabprevious`
All Projects
* Improved detection of cross-compilers
CMake Projects
* Added option to filter for CMake variables in build configuration
* Added warning when detecting `CMakeCache.txt` in source directory even though
build is configured for out-of-source build (QTCREATORBUG-18381)
* CMake >= 3.7
* Fixed that headers from top level directory were not shown in project tree
Qbs Projects
* Re-added `Qbs install` deploy step (QTCREATORBUG-17958)
* Added `rebuild` and `clean` actions to products and subprojects
C++ Support
* Added option to rename files when renaming symbol using same name
* Added auto-insertion of matching curly brace (QTCREATORBUG-15073)
* Fixed that C++ and Qt keywords were considered keywords in C files
* Fixed highlighting of raw string literals (QTCREATORBUG-17720)
* Fixed `Add #include` refactoring action for static functions
* Clang Code Model
* Added highlighting of identifier under cursor, which was still
delegated to built-in code model
* Improved order of items in completion list
* Fixed function signature hint when completing constructors and functors
* Fixed that completing function pointer was adding parentheses
* Fixed completion inside function template (QTCREATORBUG-17222)
* Fixed wrong column number with non-ASCII characters (QTCREATORBUG-16775)
* Fixed highlighting of primitive types and operators (QTCREATORBUG-17867)
* Fixed highlighting of partial template specializations
* Fixed highlighting of functions in `using` declarations
* Fixed that keywords were highlighted in preprocessor directives
* Built-in Code Model
* Fixed completion of STL containers (QTCREATORBUG-1892)
QML Support
* Updated QML parser to newer QML version (QTCREATORBUG-17842)
* Added `Alt+V` + letter shortcuts to open views
* Added dumper for `qfloat16`
* Added dumpers for `std::{optional,byte}`, `gsl::{span,byte}`, `boost::variant`
* Improved display of enum bitfields
* Fixed support for `long double` (QTCREATORBUG-18023)
* Added support for extra debugging helpers and debugging helper
* Added warning if run configuration uses unsupported shell command
Version Control Systems
* Fixed format of visual whitespace in blame, log and git rebase editors
* Git
* Improved branch listing in `Show` (QTCREATORBUG-16949)
* Gerrit
* Added validation of server certificate when using REST API
* Fixed that non-Gerrit remotes were shown in `Push to Gerrit` dialog
* ClearCase
* Disabled by default
Diff Viewer
* Fixed state of actions in `Edit` menu
* Fixed that context information for chunks was not shown in side-by-side view
* Fixed that UI blocked when showing very large diffs
Test Integration
* Added view with complete, unprocessed test output
* Made it possible to enable and disable all tests using a specific test
* QTest
* Added option to run verbose and with logging of signals and slots
(`-vb` and `-vs`)
* Added option for using a different AStyle configuration file
* Added option for fallback style for `clang-format`
Platform Specific
* Removed support for Windows CE
* Added option to run commands before app starts and after app stopped
* Fixed state of actions in `Edit` menu in text based manifest editor
* Added UI for managing simulator devices (QTCREATORBUG-17602)
Remote Linux
* Added support for `ssh-agent` (QTCREATORBUG-16245)
Credits for these changes go to:
Alessandro Portale
Alexander Drozdov
Andre Hartmann
André Pönitz
Christian Kandeler
Christian Stenger
Daniel Teske
David Schulz
Eike Ziller
Felix Kälberer
Florian Apolloner
Friedemann Kleint
Ivan Donchevskii
Jake Petroules
Jaroslaw Kobus
Jesus Fernandez
Jochen Becher
Jörg Bornemann
Kai Köhne
Leandro T. C. Melo
Leena Miettinen
Lorenz Haas
Marco Benelli
Marco Bubke
Mitch Curtis
Montel Laurent
Nikita Baryshnikov
Nikolai Kosjar
Orgad Shaneh
Przemyslaw Gorszkowski
Robert Löhning
Serhii Moroz
Tasuku Suzuki
Thiago Macieira
Thomas Hartmann
Tim Jenssen
Tobias Hunger
Tomasz Olszak
Tor Arne Vestbø
Ulf Hermann
Vikas Pachdha
......@@ -129,14 +129,29 @@
\image qtcreator-clang-code-model-options.png
\li In the \uicontrol {Configuration to use} list, configure the
diagnostics that Clang should issue.
\li To instruct the code model to interpret ambiguous header files as C
language files if you develop mainly using C, select the
\uicontrol {Interpret ambiguous headers as C headers} check box.
\li To process pre-compiled headers, deselect the
\uicontrol {Ignore pre-compiled headers} check box.
You can either select one of the predefined configurations, or
create a copy of a configuration and edit it to fit your needs:
\li To avoid out-of-memory crashes caused by indexing huge source files
that are typically auto-generated by scripts or code, the size of
files to index is limited to 5MB by default. To adjust the limit,
edit the value for the \uicontrol {Do not index files greater than}
check box. To index all files, deselect the check box.
\li In the \uicontrol {Clang Code Model Warnings} group, configure the
diagnostics that Clang should issue.
\li In the \uicontrol {Configuration to use} list, select one of
the predefined configurations, or select \uicontrol Copy to
create a copy of a configuration and edit it to fit your
\li \uicontrol {Pedantic Warnings} uses the \c -Wpendantic
option that requests all the warnings demanded by strict
ISO C and ISO C++.
......@@ -160,15 +175,17 @@
{Options to Request or Suppress Warnings} or the GCC or Clang
manual pages.
\li To process pre-compiled headers, deselect the
\uicontrol {Ignore pre-compiled headers} check box.
\li To avoid out-of-memory crashes caused by indexing huge source files
that are typically auto-generated by scripts or code, the size of
files to index is limited to 5MB by default. To adjust the limit,
edit the value for the \uicontrol {Do not index files greater than}
check box. To index all files, deselect the check box.
You can specify Clang settings at project level in the build settings of
the project by selecting \uicontrol Projects >
\uicontrol {Clang Code Model}. In addition to configuring the diagnostics,
you can select the \uicontrol {Enable MSVC-compliant template parsing} check
box to parse templates in a MSVC-compliant way. This enables Clang to parse
headers for example from Active Template Library (ATL) or Windows Runtime
Library (WRL). However, using the relaxed and extended rules means that no
highlighting or completion can be provided within template functions.
\image qtcreator-clang-code-model-build-settings.png
......@@ -304,9 +304,9 @@ int MetaObject::metaCall(QMetaObject::Call call, int id, void **a)
&& property(id).name() == QLatin1String("parent"))) {
QObject *contextDummyObject = objectNodeInstance->nodeInstanceServer()->dummyContextObject();
int properyIndex = contextDummyObject->metaObject()->indexOfProperty(;
if (properyIndex >= 0)
metaCallReturnValue = contextDummyObject->qt_metacall(call, properyIndex, a);
int propertyIndex = contextDummyObject->metaObject()->indexOfProperty(;
if (propertyIndex >= 0)
metaCallReturnValue = contextDummyObject->qt_metacall(call, propertyIndex, a);
......@@ -6,7 +6,7 @@
"trDescription": "Creates an empty Nim file using UTF-8 charset.",
"trDisplayName": "Nim File",
"trDisplayCategory": "Nim",
"icon": "icon.png",
"icon": "../../projects/nim/icon.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('Nim') >= 0}",
"pages" :
......@@ -6,7 +6,7 @@
"trDescription": "Creates an empty Nim script file using UTF-8 charset.",
"trDisplayName": "Nim Script File",
"trDisplayCategory": "Nim",
"icon": "icon.png",
"icon": "../../projects/nim/icon.png",
"enabled": "%{JS: [ %{Plugins} ].indexOf('Nim') >= 0}",
"pages" :
......@@ -6,7 +6,7 @@
"trDescription": "Creates a deployable Qt Quick 2 application.",
"trDisplayName": "Qt Quick Application",
"trDisplayCategory": "Application",
"icon": "qml_wizard.png",
"icon": "icon-empty.png",
"featuresRequired": [ "QtSupport.Wizards.FeatureQt.5.3" ],
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}",
......@@ -6,7 +6,7 @@
"trDescription": "Creates a deployable Qt Quick 2 application using Qt Quick Controls 2.<br/><br/><b>Note:</b> Qt Quick Controls 2 are available with Qt 5.7 and later.",
"trDisplayName": "Qt Quick Controls 2 Application",
"trDisplayCategory": "Application",
"icon": "../qtquickapplication/qml_wizard.png",
"icon": "../qtquickapplication/icon-swipe.png",
"featuresRequired": [ "QtSupport.Wizards.FeatureQtQuick.Controls.2" ],
"enabled": "%{JS: [ %{Plugins} ].indexOf('QmakeProjectManager') >= 0 || [ %{Plugins} ].indexOf('QbsProjectManager') >= 0 || [ %{Plugins} ].indexOf('CMakeProjectManager') >= 0}",
......@@ -27,6 +27,8 @@
#include "ObjectiveCTypeQualifiers.h"
#include "QtContextKeywords.h"
#include <utils/qtcfallthrough.h>
#include <unordered_map>
#include <utility>
......@@ -442,7 +444,7 @@ bool Parser::skipUntilStatement()
case T_AT_THROW:
if (_languageFeatures.objCEnabled)
return true;
......@@ -143,9 +143,13 @@ bool MatchingText::contextAllowsAutoParentheses(const QTextCursor &cursor,
if (!textToInsert.isEmpty())
ch =;
if (ch == QLatin1Char('{') && cursor.block().text().trimmed().isEmpty())
return false; // User just might want to wrap up some lines.
if (!shouldInsertMatchingText(cursor) && ch != QLatin1Char('\'') && ch != QLatin1Char('"'))
return false;
else if (isInCommentHelper(cursor))
if (isInCommentHelper(cursor))
return false;
return true;
** Copyright (C) 2017 The Qt Company Ltd.
** Contact:
** This file is part of Qt Creator.
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see For further
** information use the contact form at
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met:
#pragma once
#include <QtGlobal>
#ifdef __has_cpp_attribute
# define QT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x)
# define QT_HAS_CPP_ATTRIBUTE(x) 0
#if defined(__cplusplus)
#if QT_HAS_CPP_ATTRIBUTE(fallthrough)
# define Q_FALLTHROUGH() [[fallthrough]]
#elif QT_HAS_CPP_ATTRIBUTE(clang::fallthrough)
# define Q_FALLTHROUGH() [[clang::fallthrough]]
#elif QT_HAS_CPP_ATTRIBUTE(gnu::fallthrough)
# define Q_FALLTHROUGH() [[gnu::fallthrough]]
# if (defined(Q_CC_GNU) && Q_CC_GNU >= 700) && !defined(Q_CC_INTEL)
# define Q_FALLTHROUGH() __attribute__((fallthrough))
# else
# define Q_FALLTHROUGH() (void)0
......@@ -239,6 +239,7 @@ HEADERS += \
$$PWD/asconst.h \
$$PWD/smallstringfwd.h \
$$PWD/optional.h \
$$PWD/qtcfallthrough.h \
FORMS += $$PWD/filewizardpage.ui \
......@@ -175,6 +175,7 @@ Project {
......@@ -99,7 +99,7 @@ IpcReceiver::IpcReceiver()
void IpcReceiver::setAliveHandler(const IpcReceiver::AliveHandler &handler)
......@@ -116,12 +116,6 @@ void IpcReceiver::addExpectedCodeCompletedMessage(
m_assistProcessorsTable.insert(ticket, processor);
void IpcReceiver::deleteAndClearWaitingAssistProcessors()
qDeleteAll(m_assistProcessorsTable.begin(), m_assistProcessorsTable.end());
void IpcReceiver::deleteProcessorsOfEditorWidget(TextEditor::TextEditorWidget *textEditorWidget)
QMutableHashIterator<quint64, ClangCompletionAssistProcessor *> it(m_assistProcessorsTable);
......@@ -155,6 +149,18 @@ bool IpcReceiver::isExpectingCodeCompletedMessage() const
return !m_assistProcessorsTable.isEmpty();
void IpcReceiver::reset()
// Clean up waiting assist processors
qDeleteAll(m_assistProcessorsTable.begin(), m_assistProcessorsTable.end());
// Clean up futures for references
for (ReferencesEntry &entry : m_referencesTable)
void IpcReceiver::alive()
if (printAliveMessage())
......@@ -719,7 +725,7 @@ void IpcCommunicator::onConnectedToBackend()
if (m_connectedCount > 1)
m_ipcSender.reset(new IpcSender(m_connection));
......@@ -73,14 +73,14 @@ public:
void setAliveHandler(const AliveHandler &handler);
void addExpectedCodeCompletedMessage(quint64 ticket, ClangCompletionAssistProcessor *processor);
void deleteAndClearWaitingAssistProcessors();
void deleteProcessorsOfEditorWidget(TextEditor::TextEditorWidget *textEditorWidget);
QFuture<CppTools::CursorInfo> addExpectedReferencesMessage(quint64 ticket,
QTextDocument *textDocument);
bool isExpectingCodeCompletedMessage() const;
void reset();
void alive() override;
void echo(const ClangBackEnd::EchoMessage &message) override;
......@@ -278,6 +278,8 @@ namespace Internal {
ClangDiagnosticManager::ClangDiagnosticManager(TextEditor::TextDocument *textDocument)
: m_textDocument(textDocument)
......@@ -295,6 +297,7 @@ void ClangDiagnosticManager::cleanMarks()
void ClangDiagnosticManager::generateTextMarks()
QObject::disconnect(&m_textMarkDelay, &QTimer::timeout, 0, 0);
m_clangTextMarks.reserve(m_warningDiagnostics.size() + m_errorDiagnostics.size());
......@@ -350,6 +353,7 @@ ClangDiagnosticManager::diagnosticsAt(uint line, uint column) const
void ClangDiagnosticManager::invalidateDiagnostics()
if (m_diagnosticsInvalidated)
......@@ -383,9 +387,18 @@ void ClangDiagnosticManager::processNewDiagnostics(
m_showTextMarkAnnotations = showTextMarkAnnotations;
if (m_firstDiagnostics) {
m_firstDiagnostics = false;
} else if (!m_textMarkDelay.isActive()) {
} else {
QObject::connect(&m_textMarkDelay, &QTimer::timeout, [this]() {
const QVector<ClangBackEnd::DiagnosticContainer> &
......@@ -34,6 +34,7 @@
#include <QList>
#include <QSet>
#include <QTextEdit>
#include <QTimer>
#include <QVector>
#include <vector>
......@@ -82,8 +83,10 @@ private:
QList<QTextEdit::ExtraSelection> m_extraSelections;
TextEditor::RefactorMarkers m_fixItAvailableMarkers;
std::vector<ClangTextMark *> m_clangTextMarks;
bool m_firstDiagnostics = true;
bool m_diagnosticsInvalidated = false;
bool m_showTextMarkAnnotations = false;
QTimer m_textMarkDelay;
} // namespace Internal
......@@ -143,7 +143,7 @@ bool ClangStaticAnalyzerPlugin::initialize(const QStringList &arguments, QString
(Constants::CLANGSTATICANALYZER_RUN_MODE, constraint);
(Constants::CLANGSTATICANALYZER_RUN_MODE, constraint, /*priority*/ -1);
return true;
......@@ -79,7 +79,9 @@ ClangStaticAnalyzerToolRunner::ClangStaticAnalyzerToolRunner(RunControl *runCont
RunConfiguration *runConfiguration = runControl->runConfiguration();
auto tool = ClangStaticAnalyzerTool::instance();
connect(tool->stopAction(), &QAction::triggered, runControl, &RunControl::initiateStop);
ProjectInfo projectInfoBeforeBuild = tool->projectInfoBeforeBuild();
QTC_ASSERT(projectInfoBeforeBuild.isValid(), return);
......@@ -495,10 +497,14 @@ void ClangStaticAnalyzerToolRunner::start()
m_success = false;
connect(runControl(), &RunControl::stopped, this, [this] {
QTC_ASSERT(m_projectInfo.isValid(), reportFailure(); return);
const Utils::FileName projectFile = m_projectInfo.project()->projectFilePath();
appendMessage(tr("Running Clang Static Analyzer on %1").arg(projectFile.toUserOutput())
+ QLatin1Char('\n'), Utils::NormalMessageFormat);
appendMessage(tr("Running Clang Static Analyzer on %1").arg(projectFile.toUserOutput()),
// Check clang executable
bool isValidClangExecutable;
......@@ -507,7 +513,7 @@ void ClangStaticAnalyzerToolRunner::start()
if (!isValidClangExecutable) {
const QString errorMessage = tr("Clang Static Analyzer: Invalid executable \"%1\", stop.")
appendMessage(errorMessage + QLatin1Char('\n'), Utils::ErrorMessageFormat);
appendMessage(errorMessage, Utils::ErrorMessageFormat);
TaskHub::addTask(Task::Error, errorMessage, Debugger::Constants::ANALYZERTASK_ID);
......@@ -522,7 +528,7 @@ void ClangStaticAnalyzerToolRunner::start()
= tr("Clang Static Analyzer: Running with possibly unsupported version, "
"could not determine version from executable \"%1\".")
appendMessage(warningMessage + QLatin1Char('\n'), Utils::StdErrFormat);
appendMessage(warningMessage, Utils::StdErrFormat);
TaskHub::addTask(Task::Warning, warningMessage, Debugger::Constants::ANALYZERTASK_ID);
} else if (!version.isSupportedVersion()) {
......@@ -531,7 +537,7 @@ void ClangStaticAnalyzerToolRunner::start()
"supported version is %2.")
appendMessage(warningMessage + QLatin1Char('\n'), Utils::StdErrFormat);
appendMessage(warningMessage, Utils::StdErrFormat);
TaskHub::addTask(Task::Warning, warningMessage, Debugger::Constants::ANALYZERTASK_ID);