Merge remote-tracking branch 'origin/4.11'

Change-Id: I949f4f63abe12e11c4598c98295bfccc82e0ebdb
This commit is contained in:
Eike Ziller
2020-01-09 11:18:44 +01:00
9 changed files with 174 additions and 46 deletions

57
dist/changes-4.11.1.md vendored Normal file
View File

@@ -0,0 +1,57 @@
# Qt Creator 4.11.1
Qt Creator version 4.11.1 contains bug fixes.
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://code.qt.io/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline origin/v4.11.0..v4.11.1
## Editing
* Fixed `Visualize Whitespace` for editors without specialized highlighter definition
(QTCREATORBUG-23040)
### C++
* Fixed wrong warnings about C++98 incompatibility with MSVC (QTCREATORBUG-23118)
* Fixed accidentally added internal include paths from GCC (QTCREATORBUG-23330)
### FakeVim
* Fixed goto next and previous split (QTCREATORBUG-22397)
* Fixed indentation of continuation lines (QTCREATORBUG-20876)
## Projects
* Fixed crash when closing application output
### CMake
* Fixed subdirectory structure in project tree (QTCREATORBUG-23372)
## Qt Quick Designer
* Fixed removing single signals from Connection (QDS-1333)
## Test Integration
* Fixed stopping tests when debugging (QTCREATORBUG-23298)
## Platforms
### Windows
* Worked around issue with HiDPI in Qt (QTBUG-80934)
### WebAssembly
* Fixed missing device in kit (QTCREATORBUG-23360)
### QNX
* Fixed deployment of Qt examples (QTCREATORBUG-22592)
## Credits for these changes go to:

View File

@@ -755,7 +755,7 @@
as as
\code \code
QByteArray foo = "foo"; QByteArray foo("foo");
foo.append("bar"); foo.append("bar");
\endcode \endcode

View File

@@ -1,6 +1,6 @@
import qbs import qbs
Application { CppApplication {
@if "%{UseVirtualKeyboard}" == "true" @if "%{UseVirtualKeyboard}" == "true"
Depends { name: "Qt"; submodules: ["quick", "virtualkeyboard"] } Depends { name: "Qt"; submodules: ["quick", "virtualkeyboard"] }
@else @else

View File

@@ -2,17 +2,25 @@
** **
** Copyright (C) 2016 Alexander Drozdov. ** Copyright (C) 2016 Alexander Drozdov.
** Contact: adrozdoff@gmail.com ** Contact: adrozdoff@gmail.com
** Contact: https://www.qt.io/licensing/
** **
** This file is part of CMakeProjectManager2 plugin. ** This file is part of Qt Creator.
** **
** GNU Lesser General Public License Usage ** Commercial License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Licensees holding valid commercial Qt licenses may use this file in
** General Public License version 2.1 or version 3 as published by the Free ** accordance with the commercial license agreement provided with the
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Software or, alternatively, in accordance with the terms contained in
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** a written agreement between you and The Qt Company. For licensing terms
** following information to ensure the GNU Lesser General Public License ** and conditions see https://www.qt.io/terms-conditions. For further
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** information use the contact form at https://www.qt.io/contact-us.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. **
** 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: https://www.gnu.org/licenses/gpl-3.0.html.
** **
****************************************************************************/ ****************************************************************************/

View File

@@ -2,17 +2,25 @@
** **
** Copyright (C) 2016 Alexander Drozdov. ** Copyright (C) 2016 Alexander Drozdov.
** Contact: adrozdoff@gmail.com ** Contact: adrozdoff@gmail.com
** Contact: https://www.qt.io/licensing/
** **
** This file is part of CMakeProjectManager2 plugin. ** This file is part of Qt Creator.
** **
** GNU Lesser General Public License Usage ** Commercial License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser ** Licensees holding valid commercial Qt licenses may use this file in
** General Public License version 2.1 or version 3 as published by the Free ** accordance with the commercial license agreement provided with the
** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** Software or, alternatively, in accordance with the terms contained in
** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** a written agreement between you and The Qt Company. For licensing terms
** following information to ensure the GNU Lesser General Public License ** and conditions see https://www.qt.io/terms-conditions. For further
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** information use the contact form at https://www.qt.io/contact-us.
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. **
** 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: https://www.gnu.org/licenses/gpl-3.0.html.
** **
****************************************************************************/ ****************************************************************************/

View File

@@ -1578,7 +1578,7 @@ void CppEditorPlugin::test_quickfix_data()
" f2(&str);\n" " f2(&str);\n"
"}\n") "}\n")
<< _("void foo() {\n" << _("void foo() {\n"
" QString *str;\n" " QString *str = new QString;\n"
" if (!str->isEmpty())\n" " if (!str->isEmpty())\n"
" str->clear();\n" " str->clear();\n"
" f1(*str);\n" " f1(*str);\n"
@@ -1612,7 +1612,7 @@ void CppEditorPlugin::test_quickfix_data()
" str->clear();\n" " str->clear();\n"
"}\n") "}\n")
<< _("void foo() {\n" << _("void foo() {\n"
" QString str = QLatin1String(\"schnurz\");\n" " QString str(QLatin1String(\"schnurz\"));\n"
" if (!str.isEmpty())\n" " if (!str.isEmpty())\n"
" str.clear();\n" " str.clear();\n"
"}\n"); "}\n");
@@ -1731,7 +1731,7 @@ void CppEditorPlugin::test_quickfix_data()
" f1(str);\n" " f1(str);\n"
"}\n") "}\n")
<< _("void foo() {\n" << _("void foo() {\n"
" QString *str;\n" " QString *str = new QString;\n"
" str->clear();\n" " str->clear();\n"
" {\n" " {\n"
" QString str;\n" " QString str;\n"
@@ -1808,6 +1808,45 @@ void CppEditorPlugin::test_quickfix_data()
" BAR = *foo;\n" " BAR = *foo;\n"
"}\n"); "}\n");
QString testObjAndFunc = "struct Object\n"
"{\n"
" Object(%1){}\n"
"};\n"
"void func()\n"
"{\n"
" %2\n"
"}\n";
QTest::newRow("ConvertToStack1_QTCREATORBUG23181")
<< CppQuickFixFactoryPtr(new ConvertFromAndToPointer)
<< _(testObjAndFunc.arg("int").arg("Object *@obj = new Object(0);").toUtf8())
<< _(testObjAndFunc.arg("int").arg("Object obj(0);").toUtf8());
QTest::newRow("ConvertToStack2_QTCREATORBUG23181")
<< CppQuickFixFactoryPtr(new ConvertFromAndToPointer)
<< _(testObjAndFunc.arg("int").arg("Object *@obj = new Object{0};").toUtf8())
<< _(testObjAndFunc.arg("int").arg("Object obj{0};").toUtf8());
QTest::newRow("ConvertToPointer1_QTCREATORBUG23181")
<< CppQuickFixFactoryPtr(new ConvertFromAndToPointer)
<< _(testObjAndFunc.arg("").arg("Object @obj;").toUtf8())
<< _(testObjAndFunc.arg("").arg("Object *obj = new Object;").toUtf8());
QTest::newRow("ConvertToPointer2_QTCREATORBUG23181")
<< CppQuickFixFactoryPtr(new ConvertFromAndToPointer)
<< _(testObjAndFunc.arg("").arg("Object @obj();").toUtf8())
<< _(testObjAndFunc.arg("").arg("Object *obj = new Object();").toUtf8());
QTest::newRow("ConvertToPointer3_QTCREATORBUG23181")
<< CppQuickFixFactoryPtr(new ConvertFromAndToPointer)
<< _(testObjAndFunc.arg("").arg("Object @obj{};").toUtf8())
<< _(testObjAndFunc.arg("").arg("Object *obj = new Object{};").toUtf8());
QTest::newRow("ConvertToPointer4_QTCREATORBUG23181")
<< CppQuickFixFactoryPtr(new ConvertFromAndToPointer)
<< _(testObjAndFunc.arg("int").arg("Object @obj(0);").toUtf8())
<< _(testObjAndFunc.arg("int").arg("Object *obj = new Object(0);").toUtf8());
QTest::newRow("InsertQtPropertyMembers_noTriggerInvalidCode") QTest::newRow("InsertQtPropertyMembers_noTriggerInvalidCode")
<< CppQuickFixFactoryPtr(new InsertQtPropertyMembers) << CppQuickFixFactoryPtr(new InsertQtPropertyMembers)
<< _("class C { @Q_PROPERTY(typeid foo READ foo) };\n") << _("class C { @Q_PROPERTY(typeid foo READ foo) };\n")

View File

@@ -4153,20 +4153,21 @@ private:
void removeNewExpression(ChangeSet &changes, NewExpressionAST *newExprAST) const void removeNewExpression(ChangeSet &changes, NewExpressionAST *newExprAST) const
{ {
ExpressionListParenAST *exprlist = newExprAST->new_initializer ExpressionListAST *exprlist = nullptr;
? newExprAST->new_initializer->asExpressionListParen() if (newExprAST->new_initializer) {
: nullptr; if (ExpressionListParenAST *ast = newExprAST->new_initializer->asExpressionListParen())
exprlist = ast->expression_list;
else if (BracedInitializerAST *ast = newExprAST->new_initializer->asBracedInitializer())
exprlist = ast->expression_list;
}
if (exprlist && exprlist->expression_list) { if (exprlist) {
// remove 'new' keyword and type before initializer // remove 'new' keyword and type before initializer
changes.remove(m_file->startOf(newExprAST->new_token), changes.remove(m_file->startOf(newExprAST->new_token),
m_file->startOf(newExprAST->new_initializer)); m_file->startOf(newExprAST->new_initializer));
// remove parenthesis around initializer changes.remove(m_file->endOf(m_declaratorAST->equal_token - 1),
int pos = m_file->startOf(exprlist->lparen_token); m_file->startOf(m_declaratorAST->equal_token + 1));
changes.remove(pos, pos + 1);
pos = m_file->startOf(exprlist->rparen_token);
changes.remove(pos, pos + 1);
} else { } else {
// remove the whole new expression // remove the whole new expression
changes.remove(m_file->endOf(m_identifierAST->firstToken()), changes.remove(m_file->endOf(m_identifierAST->firstToken()),
@@ -4272,9 +4273,10 @@ private:
return overview.prettyName(namedType->name->name); return overview.prettyName(namedType->name->name);
} }
void insertNewExpression(ChangeSet &changes, CallAST *callAST) const void insertNewExpression(ChangeSet &changes, ExpressionAST *ast) const
{ {
const QString typeName = typeNameOfDeclaration(); const QString typeName = typeNameOfDeclaration();
if (CallAST *callAST = ast->asCall()) {
if (typeName.isEmpty()) { if (typeName.isEmpty()) {
changes.insert(m_file->startOf(callAST), QLatin1String("new ")); changes.insert(m_file->startOf(callAST), QLatin1String("new "));
} else { } else {
@@ -4282,14 +4284,19 @@ private:
QLatin1String("new ") + typeName + QLatin1Char('(')); QLatin1String("new ") + typeName + QLatin1Char('('));
changes.insert(m_file->startOf(callAST->lastToken()), QLatin1String(")")); changes.insert(m_file->startOf(callAST->lastToken()), QLatin1String(")"));
} }
} else {
if (typeName.isEmpty())
return;
changes.insert(m_file->startOf(ast), QLatin1String(" = new ") + typeName);
}
} }
void insertNewExpression(ChangeSet &changes, ExpressionListParenAST *exprListAST) const void insertNewExpression(ChangeSet &changes) const
{ {
const QString typeName = typeNameOfDeclaration(); const QString typeName = typeNameOfDeclaration();
if (typeName.isEmpty()) if (typeName.isEmpty())
return; return;
changes.insert(m_file->startOf(exprListAST), changes.insert(m_file->endOf(m_identifierAST->firstToken()),
QLatin1String(" = new ") + typeName); QLatin1String(" = new ") + typeName);
} }
@@ -4301,10 +4308,15 @@ private:
changes.insert(m_file->startOf(idExprAST), QLatin1String("&")); changes.insert(m_file->startOf(idExprAST), QLatin1String("&"));
} else if (CallAST *callAST = m_declaratorAST->initializer->asCall()) { } else if (CallAST *callAST = m_declaratorAST->initializer->asCall()) {
insertNewExpression(changes, callAST); insertNewExpression(changes, callAST);
} else if (ExpressionListParenAST *exprListAST } else if (ExpressionListParenAST *exprListAST = m_declaratorAST->initializer
= m_declaratorAST->initializer->asExpressionListParen()) { ->asExpressionListParen()) {
insertNewExpression(changes, exprListAST); insertNewExpression(changes, exprListAST);
} else if (BracedInitializerAST *bracedInitializerAST = m_declaratorAST->initializer
->asBracedInitializer()) {
insertNewExpression(changes, bracedInitializerAST);
} }
} else {
insertNewExpression(changes);
} }
// Fix all occurrences of the identifier in this function. // Fix all occurrences of the identifier in this function.

View File

@@ -1826,6 +1826,7 @@ void DebuggerEngine::setState(DebuggerState state, bool forced)
if (state == EngineRunRequested) { if (state == EngineRunRequested) {
emit engineStarted(); emit engineStarted();
if (d->m_perspective)
d->m_perspective->select(); d->m_perspective->select();
} }

View File

@@ -52,6 +52,7 @@
#include <QLineEdit> #include <QLineEdit>
#include <QLoggingCategory> #include <QLoggingCategory>
#include <QRegularExpression> #include <QRegularExpression>
#include <QTimer>
#include <memory> #include <memory>
@@ -93,9 +94,11 @@ static QByteArray runGcc(const FilePath &gcc, const QStringList &arguments, cons
SynchronousProcessResponse response = cpp.runBlocking(cmdLine); SynchronousProcessResponse response = cpp.runBlocking(cmdLine);
if (response.result != SynchronousProcessResponse::Finished || if (response.result != SynchronousProcessResponse::Finished ||
response.exitCode != 0) { response.exitCode != 0) {
QTimer::singleShot(0, Core::MessageManager::instance(), [cmdLine, response] {
Core::MessageManager::write("Compiler feature detection failure!"); Core::MessageManager::write("Compiler feature detection failure!");
Core::MessageManager::write(response.exitMessage(cmdLine.toUserOutput(), 10)); Core::MessageManager::write(response.exitMessage(cmdLine.toUserOutput(), 10));
Core::MessageManager::write(QString::fromUtf8(response.allRawOutput())); Core::MessageManager::write(QString::fromUtf8(response.allRawOutput()));
});
return QByteArray(); return QByteArray();
} }