forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/8.0'
Reverts/comments out parts of 45f93a817a
,
which needs to be resolved in a follow-up commit.
Conflicts:
cmake/QtCreatorIDEBranding.cmake
qbs/modules/qtc/qtc.qbs
qtcreator_ide_branding.pri
share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp
src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
src/plugins/cmakeprojectmanager/cmakesettingspage.cpp
src/plugins/python/pythoneditor.cpp
src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
src/plugins/scxmleditor/common/colorsettings.cpp
Change-Id: I7f0f7b7120e75a9fc3a8886bc57c17345cbb501b
This commit is contained in:
@@ -378,7 +378,6 @@ SignalSlotType CppModelManager::getSignalSlotType(const FilePath &filePath,
|
||||
QTextCursor cursor(&textDocument);
|
||||
cursor.setPosition(position);
|
||||
|
||||
// Are we at the second argument of a function call?
|
||||
const QList<AST *> path = ASTPath(document)(cursor);
|
||||
if (path.isEmpty())
|
||||
return SignalSlotType::None;
|
||||
@@ -388,9 +387,27 @@ SignalSlotType CppModelManager::getSignalSlotType(const FilePath &filePath,
|
||||
break;
|
||||
}
|
||||
|
||||
// Is the function called "connect" or "disconnect"?
|
||||
if (!callAst || !callAst->base_expression)
|
||||
return SignalSlotType::None;
|
||||
|
||||
const int argumentPosition = argumentPositionOf(path.last(), callAst);
|
||||
if (argumentPosition != 2 && argumentPosition != 4)
|
||||
return SignalSlotType::None;
|
||||
|
||||
const NameAST *nameAst = nullptr;
|
||||
if (const IdExpressionAST * const idAst = callAst->base_expression->asIdExpression())
|
||||
nameAst = idAst->name;
|
||||
else if (const MemberAccessAST * const ast = callAst->base_expression->asMemberAccess())
|
||||
nameAst = ast->member_name;
|
||||
if (!nameAst || !nameAst->name)
|
||||
return SignalSlotType::None;
|
||||
const Identifier * const id = nameAst->name->identifier();
|
||||
if (!id)
|
||||
return SignalSlotType::None;
|
||||
const QString funcName = QString::fromUtf8(id->chars(), id->size());
|
||||
if (funcName != "connect" && funcName != "disconnect")
|
||||
return SignalSlotType::None;
|
||||
|
||||
Scope *scope = document->globalNamespace();
|
||||
for (auto it = path.crbegin(); it != path.crend(); ++it) {
|
||||
if (const CompoundStatementAST * const stmtAst = (*it)->asCompoundStatement()) {
|
||||
@@ -398,12 +415,8 @@ SignalSlotType CppModelManager::getSignalSlotType(const FilePath &filePath,
|
||||
break;
|
||||
}
|
||||
}
|
||||
const NameAST *nameAst = nullptr;
|
||||
const LookupContext context(document, snapshot);
|
||||
if (const IdExpressionAST * const idAst = callAst->base_expression->asIdExpression()) {
|
||||
nameAst = idAst->name;
|
||||
} else if (const MemberAccessAST * const ast = callAst->base_expression->asMemberAccess()) {
|
||||
nameAst = ast->member_name;
|
||||
if (const MemberAccessAST * const ast = callAst->base_expression->asMemberAccess()) {
|
||||
TypeOfExpression exprType;
|
||||
exprType.setExpandTemplates(true);
|
||||
exprType.init(document, snapshot);
|
||||
@@ -433,14 +446,6 @@ SignalSlotType CppModelManager::getSignalSlotType(const FilePath &filePath,
|
||||
if (!scope)
|
||||
return SignalSlotType::None;
|
||||
}
|
||||
if (!nameAst || !nameAst->name)
|
||||
return SignalSlotType::None;
|
||||
const Identifier * const id = nameAst->name->identifier();
|
||||
if (!id)
|
||||
return SignalSlotType::None;
|
||||
const QString funcName = QString::fromUtf8(id->chars(), id->size());
|
||||
if (funcName != "connect" && funcName != "disconnect")
|
||||
return SignalSlotType::None;
|
||||
|
||||
// Is the function a member function of QObject?
|
||||
const QList<LookupItem> matches = context.lookup(nameAst->name, scope);
|
||||
@@ -463,10 +468,8 @@ SignalSlotType CppModelManager::getSignalSlotType(const FilePath &filePath,
|
||||
|
||||
expression = expressionUnderCursor(cursor);
|
||||
|
||||
const int argumentPosition = argumentPositionOf(path.last(), callAst);
|
||||
if ((expression.endsWith(QLatin1String("SIGNAL"))
|
||||
&& (argumentPosition == 2 || argumentPosition == 4))
|
||||
|| (expression.endsWith(QLatin1String("SLOT")) && argumentPosition == 4))
|
||||
if (expression.endsWith(QLatin1String("SIGNAL"))
|
||||
|| (expression.endsWith(QLatin1String("SLOT")) && argumentPosition == 4))
|
||||
return SignalSlotType::OldStyleSignal;
|
||||
|
||||
if (argumentPosition == 2)
|
||||
|
Reference in New Issue
Block a user