forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.14' into master
Change-Id: Ib4363db8e71488e1d13e8c1012023abfaf06286b
This commit is contained in:
3
.github/workflows/build_cmake.yml
vendored
3
.github/workflows/build_cmake.yml
vendored
@@ -426,12 +426,13 @@ jobs:
|
|||||||
set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON")
|
set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON")
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ctest -j ${N}
|
COMMAND ctest -j ${N} --timeout 5
|
||||||
WORKING_DIRECTORY build/build
|
WORKING_DIRECTORY build/build
|
||||||
RESULT_VARIABLE result
|
RESULT_VARIABLE result
|
||||||
OUTPUT_VARIABLE output
|
OUTPUT_VARIABLE output
|
||||||
ERROR_VARIABLE output
|
ERROR_VARIABLE output
|
||||||
ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE
|
ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE
|
||||||
|
TIMEOUT 600
|
||||||
)
|
)
|
||||||
if (NOT result EQUAL 0)
|
if (NOT result EQUAL 0)
|
||||||
string(REGEX MATCH "[0-9]+% tests.*[0-9.]+ sec.*$" test_results "${output}")
|
string(REGEX MATCH "[0-9]+% tests.*[0-9.]+ sec.*$" test_results "${output}")
|
||||||
|
5
cmake/Config.cmake.in
Normal file
5
cmake/Config.cmake.in
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
@PACKAGE_INIT@
|
||||||
|
|
||||||
|
if (NOT TARGET QtCreator::@target_name@)
|
||||||
|
include ("${CMAKE_CURRENT_LIST_DIR}/@export@Targets.cmake")
|
||||||
|
endif()
|
@@ -29,6 +29,9 @@ list(APPEND DEFAULT_DEFINES
|
|||||||
RELATIVE_DOC_PATH="${RELATIVE_DOC_PATH}"
|
RELATIVE_DOC_PATH="${RELATIVE_DOC_PATH}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# use CMAKE_CURRENT_FUNCTION_LIST_DIR when we can require CMake 3.17
|
||||||
|
set(_THIS_MODULE_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
|
|
||||||
option(BUILD_PLUGINS_BY_DEFAULT "Build plugins by default. This can be used to build all plugins by default, or none." ON)
|
option(BUILD_PLUGINS_BY_DEFAULT "Build plugins by default. This can be used to build all plugins by default, or none." ON)
|
||||||
option(BUILD_EXECUTABLES_BY_DEFAULT "Build executables by default. This can be used to build all executables by default, or none." ON)
|
option(BUILD_EXECUTABLES_BY_DEFAULT "Build executables by default. This can be used to build all executables by default, or none." ON)
|
||||||
option(BUILD_LIBRARIES_BY_DEFAULT "Build libraries by default. This can be used to build all libraries by default, or none." ON)
|
option(BUILD_LIBRARIES_BY_DEFAULT "Build libraries by default. This can be used to build all libraries by default, or none." ON)
|
||||||
@@ -214,7 +217,7 @@ function(add_qtc_library name)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS ${name}
|
install(TARGETS ${name}
|
||||||
EXPORT ${IDE_CASED_ID}
|
EXPORT QtCreator
|
||||||
RUNTIME
|
RUNTIME
|
||||||
DESTINATION "${_DESTINATION}"
|
DESTINATION "${_DESTINATION}"
|
||||||
${COMPONENT_OPTION}
|
${COMPONENT_OPTION}
|
||||||
@@ -264,7 +267,7 @@ endfunction(add_qtc_library)
|
|||||||
|
|
||||||
function(add_qtc_plugin target_name)
|
function(add_qtc_plugin target_name)
|
||||||
cmake_parse_arguments(_arg
|
cmake_parse_arguments(_arg
|
||||||
"EXPERIMENTAL;SKIP_DEBUG_CMAKE_FILE_CHECK;SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION"
|
"EXPERIMENTAL;SKIP_DEBUG_CMAKE_FILE_CHECK;SKIP_INSTALL;INTERNAL_ONLY;SKIP_TRANSLATION;EXPORT"
|
||||||
"VERSION;COMPAT_VERSION;PLUGIN_JSON_IN;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT"
|
"VERSION;COMPAT_VERSION;PLUGIN_JSON_IN;PLUGIN_PATH;PLUGIN_NAME;OUTPUT_NAME;BUILD_DEFAULT"
|
||||||
"CONDITION;DEPENDS;PUBLIC_DEPENDS;DEFINES;PUBLIC_DEFINES;INCLUDES;PUBLIC_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PLUGIN_DEPENDS;PLUGIN_RECOMMENDS;PROPERTIES"
|
"CONDITION;DEPENDS;PUBLIC_DEPENDS;DEFINES;PUBLIC_DEFINES;INCLUDES;PUBLIC_INCLUDES;SOURCES;EXPLICIT_MOC;SKIP_AUTOMOC;EXTRA_TRANSLATIONS;PLUGIN_DEPENDS;PLUGIN_RECOMMENDS;PROPERTIES"
|
||||||
${ARGN}
|
${ARGN}
|
||||||
@@ -459,8 +462,14 @@ function(add_qtc_plugin target_name)
|
|||||||
enable_pch(${target_name})
|
enable_pch(${target_name})
|
||||||
|
|
||||||
if (NOT _arg_SKIP_INSTALL)
|
if (NOT _arg_SKIP_INSTALL)
|
||||||
|
if (_arg_EXPORT)
|
||||||
|
set(export QtCreator${target_name})
|
||||||
|
else()
|
||||||
|
set(export QtCreator)
|
||||||
|
endif()
|
||||||
|
|
||||||
install(TARGETS ${target_name}
|
install(TARGETS ${target_name}
|
||||||
EXPORT ${IDE_CASED_ID}
|
EXPORT ${export}
|
||||||
RUNTIME DESTINATION "${plugin_dir}" OPTIONAL
|
RUNTIME DESTINATION "${plugin_dir}" OPTIONAL
|
||||||
LIBRARY DESTINATION "${plugin_dir}" OPTIONAL
|
LIBRARY DESTINATION "${plugin_dir}" OPTIONAL
|
||||||
ARCHIVE
|
ARCHIVE
|
||||||
@@ -468,6 +477,30 @@ function(add_qtc_plugin target_name)
|
|||||||
COMPONENT Devel EXCLUDE_FROM_ALL
|
COMPONENT Devel EXCLUDE_FROM_ALL
|
||||||
OPTIONAL
|
OPTIONAL
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (_arg_EXPORT)
|
||||||
|
# export of external plugins
|
||||||
|
install(EXPORT ${export}
|
||||||
|
FILE ${export}Targets.cmake
|
||||||
|
DESTINATION lib/cmake/${export}
|
||||||
|
COMPONENT Devel EXCLUDE_FROM_ALL
|
||||||
|
NAMESPACE QtCreator::
|
||||||
|
)
|
||||||
|
include(CMakePackageConfigHelpers)
|
||||||
|
configure_package_config_file(${_THIS_MODULE_BASE_DIR}/Config.cmake.in
|
||||||
|
"${CMAKE_BINARY_DIR}/cmake/${export}Config.cmake"
|
||||||
|
INSTALL_DESTINATION lib/cmake/${export}
|
||||||
|
)
|
||||||
|
install(
|
||||||
|
FILES ${CMAKE_BINARY_DIR}/cmake/${export}Config.cmake
|
||||||
|
DESTINATION lib/cmake/${export}
|
||||||
|
COMPONENT Devel EXCLUDE_FROM_ALL
|
||||||
|
)
|
||||||
|
export(EXPORT ${export}
|
||||||
|
NAMESPACE QtCreator::
|
||||||
|
FILE ${CMAKE_BINARY_DIR}/cmake/${export}Targets.cmake
|
||||||
|
)
|
||||||
|
endif()
|
||||||
get_target_property(target_suffix ${target_name} SUFFIX)
|
get_target_property(target_suffix ${target_name} SUFFIX)
|
||||||
get_target_property(target_prefix ${target_name} PREFIX)
|
get_target_property(target_prefix ${target_name} PREFIX)
|
||||||
if (target_suffix STREQUAL "target_suffix-NOTFOUND")
|
if (target_suffix STREQUAL "target_suffix-NOTFOUND")
|
||||||
|
@@ -1117,6 +1117,7 @@ class Dumper(DumperBase):
|
|||||||
self.qtCustomEventPltFunc = self.findSymbol(sym)
|
self.qtCustomEventPltFunc = self.findSymbol(sym)
|
||||||
|
|
||||||
sym = '_ZNK%s7QObject8propertyEPKc' % strns
|
sym = '_ZNK%s7QObject8propertyEPKc' % strns
|
||||||
|
if not self.isWindowsTarget(): # prevent calling the property function on windows
|
||||||
self.qtPropertyFunc = self.findSymbol(sym)
|
self.qtPropertyFunc = self.findSymbol(sym)
|
||||||
|
|
||||||
def assignValue(self, args):
|
def assignValue(self, args):
|
||||||
|
@@ -1982,18 +1982,9 @@ def qdump__QVariant(d, value):
|
|||||||
if d.isExpanded():
|
if d.isExpanded():
|
||||||
innerType = None
|
innerType = None
|
||||||
with Children(d):
|
with Children(d):
|
||||||
ev = d.parseAndEvaluate
|
try:
|
||||||
p = None
|
p = d.call('const char *', value, 'typeName')
|
||||||
if p is None:
|
except:
|
||||||
# Without debug info.
|
|
||||||
symbol = d.mangleName(d.qtNamespace() + 'QMetaType::typeName') + 'i'
|
|
||||||
p = ev('((const char *(*)(int))%s)(%d)' % (symbol, variantType))
|
|
||||||
#if p is None:
|
|
||||||
# p = ev('((const char *(*)(int))%sQMetaType::typeName)(%d)' % (ns, variantType))
|
|
||||||
if p is None:
|
|
||||||
# LLDB on Linux
|
|
||||||
p = ev('((const char *(*)(int))QMetaType::typeName)(%d)' % variantType)
|
|
||||||
if p is None:
|
|
||||||
d.putSpecialValue('notcallable')
|
d.putSpecialValue('notcallable')
|
||||||
return None
|
return None
|
||||||
ptr = p.pointer()
|
ptr = p.pointer()
|
||||||
|
@@ -102,33 +102,35 @@ QtObject {
|
|||||||
readonly property string lockOn: "\u005F"
|
readonly property string lockOn: "\u005F"
|
||||||
readonly property string mergeCells: "\u0060"
|
readonly property string mergeCells: "\u0060"
|
||||||
readonly property string minus: "\u0061"
|
readonly property string minus: "\u0061"
|
||||||
readonly property string plus: "\u0062"
|
readonly property string pin: "\u0062"
|
||||||
readonly property string redo: "\u0063"
|
readonly property string plus: "\u0063"
|
||||||
readonly property string splitColumns: "\u0064"
|
readonly property string redo: "\u0064"
|
||||||
readonly property string splitRows: "\u0065"
|
readonly property string splitColumns: "\u0065"
|
||||||
readonly property string startNode: "\u0066"
|
readonly property string splitRows: "\u0066"
|
||||||
readonly property string testIcon: "\u0067"
|
readonly property string startNode: "\u0067"
|
||||||
readonly property string textAlignBottom: "\u0068"
|
readonly property string testIcon: "\u0068"
|
||||||
readonly property string textAlignCenter: "\u0069"
|
readonly property string textAlignBottom: "\u0069"
|
||||||
readonly property string textAlignLeft: "\u006A"
|
readonly property string textAlignCenter: "\u006A"
|
||||||
readonly property string textAlignMiddle: "\u006B"
|
readonly property string textAlignLeft: "\u006B"
|
||||||
readonly property string textAlignRight: "\u006C"
|
readonly property string textAlignMiddle: "\u006C"
|
||||||
readonly property string textAlignTop: "\u006D"
|
readonly property string textAlignRight: "\u006D"
|
||||||
readonly property string textBulletList: "\u006E"
|
readonly property string textAlignTop: "\u006E"
|
||||||
readonly property string textFullJustification: "\u006F"
|
readonly property string textBulletList: "\u006F"
|
||||||
readonly property string textNumberedList: "\u0070"
|
readonly property string textFullJustification: "\u0070"
|
||||||
readonly property string tickIcon: "\u0071"
|
readonly property string textNumberedList: "\u0071"
|
||||||
readonly property string triState: "\u0072"
|
readonly property string tickIcon: "\u0072"
|
||||||
readonly property string undo: "\u0073"
|
readonly property string triState: "\u0073"
|
||||||
readonly property string upDownIcon: "\u0074"
|
readonly property string undo: "\u0074"
|
||||||
readonly property string upDownSquare2: "\u0075"
|
readonly property string unpin: "\u0075"
|
||||||
readonly property string visibilityOff: "\u0076"
|
readonly property string upDownIcon: "\u0076"
|
||||||
readonly property string visibilityOn: "\u0077"
|
readonly property string upDownSquare2: "\u0077"
|
||||||
readonly property string wildcard: "\u0078"
|
readonly property string visibilityOff: "\u0078"
|
||||||
readonly property string zoomAll: "\u0079"
|
readonly property string visibilityOn: "\u0079"
|
||||||
readonly property string zoomIn: "\u007A"
|
readonly property string wildcard: "\u007A"
|
||||||
readonly property string zoomOut: "\u007B"
|
readonly property string zoomAll: "\u007B"
|
||||||
readonly property string zoomSelection: "\u007C"
|
readonly property string zoomIn: "\u007C"
|
||||||
|
readonly property string zoomOut: "\u007D"
|
||||||
|
readonly property string zoomSelection: "\u007E"
|
||||||
|
|
||||||
readonly property font iconFont: Qt.font({
|
readonly property font iconFont: Qt.font({
|
||||||
"family": controlIcons.name,
|
"family": controlIcons.name,
|
||||||
|
Binary file not shown.
@@ -76,6 +76,7 @@ file(COPY
|
|||||||
${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPI.cmake
|
${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPI.cmake
|
||||||
${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPIInternal.cmake
|
${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPIInternal.cmake
|
||||||
${PROJECT_SOURCE_DIR}/cmake/FindQt5.cmake
|
${PROJECT_SOURCE_DIR}/cmake/FindQt5.cmake
|
||||||
|
${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in
|
||||||
DESTINATION ${CMAKE_BINARY_DIR}/cmake
|
DESTINATION ${CMAKE_BINARY_DIR}/cmake
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -87,6 +88,8 @@ install(
|
|||||||
${PROJECT_SOURCE_DIR}/cmake/QtCreatorDocumentation.cmake
|
${PROJECT_SOURCE_DIR}/cmake/QtCreatorDocumentation.cmake
|
||||||
${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPI.cmake
|
${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPI.cmake
|
||||||
${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPIInternal.cmake
|
${PROJECT_SOURCE_DIR}/cmake/QtCreatorAPIInternal.cmake
|
||||||
|
${PROJECT_SOURCE_DIR}/cmake/FindQt5.cmake
|
||||||
|
${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in
|
||||||
${CMAKE_BINARY_DIR}/cmake/QtCreatorConfig.cmake
|
${CMAKE_BINARY_DIR}/cmake/QtCreatorConfig.cmake
|
||||||
DESTINATION lib/cmake/QtCreator
|
DESTINATION lib/cmake/QtCreator
|
||||||
COMPONENT Devel EXCLUDE_FROM_ALL
|
COMPONENT Devel EXCLUDE_FROM_ALL
|
||||||
|
@@ -348,6 +348,8 @@ Usage::Type FindUsages::getType(int line, int column, int tokenIndex)
|
|||||||
}
|
}
|
||||||
if ((*it)->asCall())
|
if ((*it)->asCall())
|
||||||
return checkPotentialWrite(getUsageTypeForCall(it), it + 1);
|
return checkPotentialWrite(getUsageTypeForCall(it), it + 1);
|
||||||
|
if ((*it)->asDeleteExpression())
|
||||||
|
return Usage::Type::Write;
|
||||||
if (const auto binExpr = (*it)->asBinaryExpression()) {
|
if (const auto binExpr = (*it)->asBinaryExpression()) {
|
||||||
if (binExpr->left_expression == *(it - 1) && isAssignment(binExpr->binary_op_token))
|
if (binExpr->left_expression == *(it - 1) && isAssignment(binExpr->binary_op_token))
|
||||||
return checkPotentialWrite(Usage::Type::Write, it + 1);
|
return checkPotentialWrite(Usage::Type::Write, it + 1);
|
||||||
|
@@ -226,6 +226,9 @@ bool TestDataFunctionVisitor::visit(CallAST *ast)
|
|||||||
bool ok = false;
|
bool ok = false;
|
||||||
QString name = extractNameFromAST(stringLiteral, &ok);
|
QString name = extractNameFromAST(stringLiteral, &ok);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
// if it's a format string we skip as we cannot assure correct tag name
|
||||||
|
if (name.contains('%') && expressionListAST->next != nullptr)
|
||||||
|
return true;
|
||||||
int line = 0;
|
int line = 0;
|
||||||
int column = 0;
|
int column = 0;
|
||||||
m_currentDoc->translationUnit()->getTokenStartPosition(
|
m_currentDoc->translationUnit()->getTokenStartPosition(
|
||||||
@@ -279,10 +282,12 @@ bool TestDataFunctionVisitor::newRowCallFound(CallAST *ast, unsigned *firstToken
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (const auto qualifiedNameAST = exp->name->asQualifiedName()) {
|
if (const auto qualifiedNameAST = exp->name->asQualifiedName()) {
|
||||||
found = m_overview.prettyName(qualifiedNameAST->name) == "QTest::newRow";
|
const QString name = m_overview.prettyName(qualifiedNameAST->name);
|
||||||
|
found = (name == "QTest::newRow" || name == "QTest::addRow");
|
||||||
*firstToken = qualifiedNameAST->firstToken();
|
*firstToken = qualifiedNameAST->firstToken();
|
||||||
} else if (m_insideUsingQTest) {
|
} else if (m_insideUsingQTest) {
|
||||||
found = m_overview.prettyName(exp->name->name) == "newRow";
|
const QString name = m_overview.prettyName(exp->name->name);
|
||||||
|
found = (name == "newRow" || name == "addRow");
|
||||||
*firstToken = exp->name->firstToken();
|
*firstToken = exp->name->firstToken();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4283,6 +4283,23 @@ void CppEditorPlugin::test_quickfix_InsertDefsFromDecls_data()
|
|||||||
|
|
||||||
} // namespace N)";
|
} // namespace N)";
|
||||||
QTest::addRow("no candidates")
|
QTest::addRow("no candidates")
|
||||||
|
<< QByteArrayList{origHeader, origHeader}
|
||||||
|
<< QByteArrayList{origSource, origSource}
|
||||||
|
<< int(InsertDefsFromDecls::Mode::Alternating);
|
||||||
|
|
||||||
|
origHeader = R"(
|
||||||
|
namespace N {
|
||||||
|
class @C
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
friend void ignoredFriend();
|
||||||
|
void ignoredImplemented() {};
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void ignoredSignal();
|
||||||
|
};
|
||||||
|
} // namespace N)";
|
||||||
|
QTest::addRow("no member functions")
|
||||||
<< QByteArrayList{origHeader, ""}
|
<< QByteArrayList{origHeader, ""}
|
||||||
<< QByteArrayList{origSource, ""}
|
<< QByteArrayList{origSource, ""}
|
||||||
<< int(InsertDefsFromDecls::Mode::Alternating);
|
<< int(InsertDefsFromDecls::Mode::Alternating);
|
||||||
|
@@ -3487,12 +3487,11 @@ public:
|
|||||||
m_classAST = path.at(path.size() - 2)->asClassSpecifier();
|
m_classAST = path.at(path.size() - 2)->asClassSpecifier();
|
||||||
if (!m_classAST)
|
if (!m_classAST)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const Class * const theClass = m_classAST->symbol;
|
const Class * const theClass = m_classAST->symbol;
|
||||||
if (!theClass)
|
if (!theClass)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Collect all member functions without an implementation.
|
// Collect all member functions.
|
||||||
for (auto it = theClass->memberBegin(); it != theClass->memberEnd(); ++it) {
|
for (auto it = theClass->memberBegin(); it != theClass->memberEnd(); ++it) {
|
||||||
Symbol * const s = *it;
|
Symbol * const s = *it;
|
||||||
if (!s->identifier() || !s->type() || !s->isDeclaration() || s->asFunction())
|
if (!s->identifier() || !s->type() || !s->isDeclaration() || s->asFunction())
|
||||||
@@ -3500,8 +3499,6 @@ public:
|
|||||||
Function * const func = s->type()->asFunctionType();
|
Function * const func = s->type()->asFunctionType();
|
||||||
if (!func || func->isSignal() || func->isFriend())
|
if (!func || func->isSignal() || func->isFriend())
|
||||||
continue;
|
continue;
|
||||||
if (SymbolFinder().findMatchingDefinition(s, interface.snapshot()))
|
|
||||||
continue;
|
|
||||||
m_declarations << s;
|
m_declarations << s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3512,7 +3509,14 @@ public:
|
|||||||
private:
|
private:
|
||||||
void perform() override
|
void perform() override
|
||||||
{
|
{
|
||||||
QTC_ASSERT(!m_declarations.isEmpty(), return);
|
QList<Symbol *> unimplemented;
|
||||||
|
SymbolFinder symbolFinder;
|
||||||
|
for (Symbol * const s : qAsConst(m_declarations)) {
|
||||||
|
if (!symbolFinder.findMatchingDefinition(s, snapshot()))
|
||||||
|
unimplemented << s;
|
||||||
|
}
|
||||||
|
if (unimplemented.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
CppRefactoringChanges refactoring(snapshot());
|
CppRefactoringChanges refactoring(snapshot());
|
||||||
const bool isHeaderFile = ProjectFile::isHeader(ProjectFile::classify(filePath().toString()));
|
const bool isHeaderFile = ProjectFile::isHeader(ProjectFile::classify(filePath().toString()));
|
||||||
@@ -3520,7 +3524,7 @@ private:
|
|||||||
if (isHeaderFile) {
|
if (isHeaderFile) {
|
||||||
InsertionPointLocator locator(refactoring);
|
InsertionPointLocator locator(refactoring);
|
||||||
for (const InsertionLocation &location
|
for (const InsertionLocation &location
|
||||||
: locator.methodDefinition(m_declarations.first(), false, {})) {
|
: locator.methodDefinition(unimplemented.first(), false, {})) {
|
||||||
if (!location.isValid())
|
if (!location.isValid())
|
||||||
continue;
|
continue;
|
||||||
const QString fileName = location.fileName();
|
const QString fileName = location.fileName();
|
||||||
@@ -3538,7 +3542,7 @@ private:
|
|||||||
MemberFunctionImplSettings settings;
|
MemberFunctionImplSettings settings;
|
||||||
switch (m_mode) {
|
switch (m_mode) {
|
||||||
case InsertDefsFromDecls::Mode::User: {
|
case InsertDefsFromDecls::Mode::User: {
|
||||||
AddImplementationsDialog dlg(m_declarations, Utils::FilePath::fromString(cppFile));
|
AddImplementationsDialog dlg(unimplemented, Utils::FilePath::fromString(cppFile));
|
||||||
if (dlg.exec() == QDialog::Accepted)
|
if (dlg.exec() == QDialog::Accepted)
|
||||||
settings = dlg.settings();
|
settings = dlg.settings();
|
||||||
break;
|
break;
|
||||||
@@ -3548,7 +3552,7 @@ private:
|
|||||||
const auto incDefPos = [&defPos] {
|
const auto incDefPos = [&defPos] {
|
||||||
defPos = (defPos + 1) % (DefPosImplementationFile + 2);
|
defPos = (defPos + 1) % (DefPosImplementationFile + 2);
|
||||||
};
|
};
|
||||||
for (Symbol * const func : qAsConst(m_declarations)) {
|
for (Symbol * const func : qAsConst(unimplemented)) {
|
||||||
incDefPos();
|
incDefPos();
|
||||||
if (defPos > DefPosImplementationFile)
|
if (defPos > DefPosImplementationFile)
|
||||||
continue;
|
continue;
|
||||||
@@ -3618,8 +3622,8 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
ClassSpecifierAST *m_classAST = nullptr;
|
ClassSpecifierAST *m_classAST = nullptr;
|
||||||
QList<Symbol *> m_declarations;
|
|
||||||
InsertDefsFromDecls::Mode m_mode;
|
InsertDefsFromDecls::Mode m_mode;
|
||||||
|
QList<Symbol *> m_declarations;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -92,7 +92,7 @@ void QmakeSettings::loadSettings()
|
|||||||
m_settings.warnAgainstUnalignedBuildDir = s->value(
|
m_settings.warnAgainstUnalignedBuildDir = s->value(
|
||||||
BUILD_DIR_WARNING_KEY, Utils::HostOsInfo::isWindowsHost()).toBool();
|
BUILD_DIR_WARNING_KEY, Utils::HostOsInfo::isWindowsHost()).toBool();
|
||||||
m_settings.alwaysRunQmake = s->value(ALWAYS_RUN_QMAKE_KEY, false).toBool();
|
m_settings.alwaysRunQmake = s->value(ALWAYS_RUN_QMAKE_KEY, false).toBool();
|
||||||
m_settings.runSystemFunction = s->value(RUN_SYSTEM_KEY, false).toBool();
|
m_settings.runSystemFunction = s->value(RUN_SYSTEM_KEY, true).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmakeSettings::storeSettings() const
|
void QmakeSettings::storeSettings() const
|
||||||
@@ -121,8 +121,8 @@ public:
|
|||||||
m_alwaysRunQmakeCheckbox.setChecked(QmakeSettings::alwaysRunQmake());
|
m_alwaysRunQmakeCheckbox.setChecked(QmakeSettings::alwaysRunQmake());
|
||||||
m_ignoreSystemCheckbox.setText(tr("Ignore qmake's system() function "
|
m_ignoreSystemCheckbox.setText(tr("Ignore qmake's system() function "
|
||||||
"when parsing a project"));
|
"when parsing a project"));
|
||||||
m_ignoreSystemCheckbox.setToolTip(tr("Unchecking this option can help getting more exact "
|
m_ignoreSystemCheckbox.setToolTip(tr("Checking this option avoids unwanted side effects, "
|
||||||
"parsing results, but can have unwanted side effects."));
|
"but may result in inexact parsing results."));
|
||||||
m_ignoreSystemCheckbox.setChecked(!QmakeSettings::runSystemFunction());
|
m_ignoreSystemCheckbox.setChecked(!QmakeSettings::runSystemFunction());
|
||||||
const auto layout = new QVBoxLayout(this);
|
const auto layout = new QVBoxLayout(this);
|
||||||
layout->addWidget(&m_warnAgainstUnalignedBuildDirCheckbox);
|
layout->addWidget(&m_warnAgainstUnalignedBuildDirCheckbox);
|
||||||
|
@@ -37,7 +37,7 @@ class QmakeSettingsData {
|
|||||||
public:
|
public:
|
||||||
bool warnAgainstUnalignedBuildDir = false;
|
bool warnAgainstUnalignedBuildDir = false;
|
||||||
bool alwaysRunQmake = false;
|
bool alwaysRunQmake = false;
|
||||||
bool runSystemFunction = false;
|
bool runSystemFunction = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QmakeSettings : public QObject
|
class QmakeSettings : public QObject
|
||||||
|
@@ -111,6 +111,7 @@ public:
|
|||||||
lockOn,
|
lockOn,
|
||||||
mergeCells,
|
mergeCells,
|
||||||
minus,
|
minus,
|
||||||
|
pin,
|
||||||
plus,
|
plus,
|
||||||
redo,
|
redo,
|
||||||
splitColumns,
|
splitColumns,
|
||||||
@@ -129,6 +130,7 @@ public:
|
|||||||
tickIcon,
|
tickIcon,
|
||||||
triState,
|
triState,
|
||||||
undo,
|
undo,
|
||||||
|
unpin,
|
||||||
upDownIcon,
|
upDownIcon,
|
||||||
upDownSquare2,
|
upDownSquare2,
|
||||||
visibilityOff,
|
visibilityOff,
|
||||||
|
Submodule src/shared/qbs updated: d870a7a453...6383cac927
@@ -76,7 +76,18 @@ bool Type::isReferencingConstant() const
|
|||||||
|
|
||||||
bool Type::isOutputArgument() const
|
bool Type::isOutputArgument() const
|
||||||
{
|
{
|
||||||
return isLValueReference() && !pointeeType().isConstant();
|
if (isLValueReference() && !pointeeType().isConstant())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// We consider a pointer an output argument if it is non-const at any level.
|
||||||
|
// This is consistent with how we categorize references in CppTools.
|
||||||
|
Type t = *this;
|
||||||
|
while (t.isPointer()) {
|
||||||
|
t = t.pointeeType();
|
||||||
|
if (!t.isConstant())
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Type::isBuiltinType() const
|
bool Type::isBuiltinType() const
|
||||||
|
@@ -263,13 +263,13 @@ QtcTool {
|
|||||||
|
|
||||||
Group {
|
Group {
|
||||||
name: "puppet2 Qt 5 compatibility sources"
|
name: "puppet2 Qt 5 compatibility sources"
|
||||||
condition: useQt5Compat
|
condition: product.useQt5Compat
|
||||||
files: ["editor3d/qt5compat/qquick3darealight.cpp"]
|
files: ["editor3d/qt5compat/qquick3darealight.cpp"]
|
||||||
}
|
}
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
name: "puppet2 Qt 5 compatibility headers"
|
name: "puppet2 Qt 5 compatibility headers"
|
||||||
condition: useQt5Compat
|
condition: product.useQt5Compat
|
||||||
files: ["editor3d/qt5compat/qquick3darealight_p.h"]
|
files: ["editor3d/qt5compat/qquick3darealight_p.h"]
|
||||||
fileTags: product.useQuick3d ? [] : ["unmocable"]
|
fileTags: product.useQuick3d ? [] : ["unmocable"]
|
||||||
overrideTags: false
|
overrideTags: false
|
||||||
|
@@ -2081,6 +2081,7 @@ int main()
|
|||||||
s.n.constFunc();
|
s.n.constFunc();
|
||||||
s.n.nonConstFunc();
|
s.n.nonConstFunc();
|
||||||
s.n.constFunc(s.value);
|
s.n.constFunc(s.value);
|
||||||
|
delete s.p;
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
|
|
||||||
@@ -2165,7 +2166,7 @@ int main()
|
|||||||
QVERIFY(varS);
|
QVERIFY(varS);
|
||||||
QCOMPARE(varS->name()->identifier()->chars(), "s");
|
QCOMPARE(varS->name()->identifier()->chars(), "s");
|
||||||
find(varS);
|
find(varS);
|
||||||
QCOMPARE(find.usages().size(), 30);
|
QCOMPARE(find.usages().size(), 31);
|
||||||
QCOMPARE(find.usages().at(0).type, Usage::Type::Declaration);
|
QCOMPARE(find.usages().at(0).type, Usage::Type::Declaration);
|
||||||
QCOMPARE(find.usages().at(1).type, Usage::Type::WritableRef);
|
QCOMPARE(find.usages().at(1).type, Usage::Type::WritableRef);
|
||||||
QCOMPARE(find.usages().at(2).type, Usage::Type::WritableRef);
|
QCOMPARE(find.usages().at(2).type, Usage::Type::WritableRef);
|
||||||
@@ -2184,6 +2185,7 @@ int main()
|
|||||||
QCOMPARE(find.usages().at(15).type, Usage::Type::WritableRef);
|
QCOMPARE(find.usages().at(15).type, Usage::Type::WritableRef);
|
||||||
QCOMPARE(find.usages().at(16).type, Usage::Type::Read);
|
QCOMPARE(find.usages().at(16).type, Usage::Type::Read);
|
||||||
QCOMPARE(find.usages().at(17).type, Usage::Type::Read);
|
QCOMPARE(find.usages().at(17).type, Usage::Type::Read);
|
||||||
|
QCOMPARE(find.usages().at(18).type, Usage::Type::Write);
|
||||||
|
|
||||||
// Direct access to struct variable
|
// Direct access to struct variable
|
||||||
QCOMPARE(find.usages().at(18).type, Usage::Type::Write);
|
QCOMPARE(find.usages().at(18).type, Usage::Type::Write);
|
||||||
|
@@ -3992,22 +3992,22 @@ void tst_Dumpers::dumper_data()
|
|||||||
+ Check("my.1.value", "<1 items>", "@QStringList")
|
+ Check("my.1.value", "<1 items>", "@QStringList")
|
||||||
+ Check("my.1.value.0", "[0]", "\"World\"", "@QString")
|
+ Check("my.1.value.0", "[0]", "\"World\"", "@QString")
|
||||||
//+ CheckType("v2", "@QVariant (MyType)")
|
//+ CheckType("v2", "@QVariant (MyType)")
|
||||||
+ Check("v2.data.0.key", "1", "unsigned int") % NoCdbEngine
|
+ Check("v2.data.0.key", "1", "unsigned int") % NeedsInferiorCall
|
||||||
+ Check("v2.data.0.value", "<1 items>", "@QStringList") % NoCdbEngine
|
+ Check("v2.data.0.value", "<1 items>", "@QStringList") % NeedsInferiorCall
|
||||||
+ Check("v2.data.0.value.0", "[0]", "\"Hello\"", "@QString") % NoCdbEngine
|
+ Check("v2.data.0.value.0", "[0]", "\"Hello\"", "@QString") % NeedsInferiorCall
|
||||||
+ Check("v2.data.1.key", "3", "unsigned int") % NoCdbEngine
|
+ Check("v2.data.1.key", "3", "unsigned int") % NeedsInferiorCall
|
||||||
+ Check("v2.data.1.value", "<1 items>", "@QStringList") % NoCdbEngine
|
+ Check("v2.data.1.value", "<1 items>", "@QStringList") % NeedsInferiorCall
|
||||||
+ Check("v2.data.1.value.0", "[0]", "\"World\"", "@QString") % NoCdbEngine
|
+ Check("v2.data.1.value.0", "[0]", "\"World\"", "@QString") % NeedsInferiorCall
|
||||||
|
|
||||||
+ Check("list", "<3 items>", "@QList<int>")
|
+ Check("list", "<3 items>", "@QList<int>")
|
||||||
+ Check("list.0", "[0]", "1", "int")
|
+ Check("list.0", "[0]", "1", "int")
|
||||||
+ Check("list.1", "[1]", "2", "int")
|
+ Check("list.1", "[1]", "2", "int")
|
||||||
+ Check("list.2", "[2]", "3", "int")
|
+ Check("list.2", "[2]", "3", "int")
|
||||||
//+ Check("v3", "", "@QVariant (@QList<int>)")
|
//+ Check("v3", "", "@QVariant (@QList<int>)")
|
||||||
+ Check("v3.data", "<3 items>", TypePattern(".*QList<int>")) % NoCdbEngine
|
+ Check("v3.data", "<3 items>", TypePattern(".*QList<int>")) % NeedsInferiorCall
|
||||||
+ Check("v3.data.0", "[0]", "1", "int") % NoCdbEngine
|
+ Check("v3.data.0", "[0]", "1", "int") % NeedsInferiorCall
|
||||||
+ Check("v3.data.1", "[1]", "2", "int") % NoCdbEngine
|
+ Check("v3.data.1", "[1]", "2", "int") % NeedsInferiorCall
|
||||||
+ Check("v3.data.2", "[2]", "3", "int") % NoCdbEngine;
|
+ Check("v3.data.2", "[2]", "3", "int") % NeedsInferiorCall;
|
||||||
|
|
||||||
|
|
||||||
QTest::newRow("QVariant2")
|
QTest::newRow("QVariant2")
|
||||||
@@ -4221,8 +4221,8 @@ void tst_Dumpers::dumper_data()
|
|||||||
//+ Check("ha1.protocol", "IPv4Protocol",
|
//+ Check("ha1.protocol", "IPv4Protocol",
|
||||||
// "@QAbstractSocket::NetworkLayerProtocol") % LldbEngine
|
// "@QAbstractSocket::NetworkLayerProtocol") % LldbEngine
|
||||||
+ Check("ha1.scopeId", "\"\"", "@QString")
|
+ Check("ha1.scopeId", "\"\"", "@QString")
|
||||||
+ Check("var", "", "@QVariant (@QHostAddress)") % NoCdbEngine
|
+ Check("var", "", "@QVariant (@QHostAddress)") % NeedsInferiorCall
|
||||||
+ Check("var.data", ValuePattern(".*127.0.0.1.*"), "@QHostAddress") % NoCdbEngine;
|
+ Check("var.data", ValuePattern(".*127.0.0.1.*"), "@QHostAddress") % NeedsInferiorCall;
|
||||||
|
|
||||||
|
|
||||||
QTest::newRow("QVariantList")
|
QTest::newRow("QVariantList")
|
||||||
|
@@ -489,7 +489,7 @@ TEST_F(Cursor, HasOutputValues)
|
|||||||
|
|
||||||
auto outputArgumentLocations = callExpressionCursor.outputArgumentRanges();
|
auto outputArgumentLocations = callExpressionCursor.outputArgumentRanges();
|
||||||
|
|
||||||
ASSERT_THAT(outputArgumentLocations.size(), 1);
|
ASSERT_THAT(outputArgumentLocations.size(), 2);
|
||||||
ASSERT_THAT(outputArgumentLocations[0], outputArgumentExpectedSourceLocation);
|
ASSERT_THAT(outputArgumentLocations[0], outputArgumentExpectedSourceLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -744,13 +744,13 @@ TEST_F(Cursor, PointerIsNotRefencingConstant)
|
|||||||
ASSERT_FALSE(argument.isReferencingConstant());
|
ASSERT_FALSE(argument.isReferencingConstant());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(Cursor, PointerIsNotOutputArgument)
|
TEST_F(Cursor, PointerIsOutputArgument)
|
||||||
{
|
{
|
||||||
auto callExpressionCursor = translationUnit.cursorAt(127, 13);
|
auto callExpressionCursor = translationUnit.cursorAt(127, 13);
|
||||||
|
|
||||||
auto argument = callExpressionCursor.type().argument(0);
|
auto argument = callExpressionCursor.type().argument(0);
|
||||||
|
|
||||||
ASSERT_FALSE(argument.isOutputArgument());
|
ASSERT_TRUE(argument.isOutputArgument());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(Cursor, ConstantReferenceIsNotOutputArgument)
|
TEST_F(Cursor, ConstantReferenceIsNotOutputArgument)
|
||||||
@@ -771,13 +771,13 @@ TEST_F(Cursor, PointerToConstantIsNotOutputArgument)
|
|||||||
ASSERT_FALSE(argument.isOutputArgument()) << argument.isConstant() << argument.pointeeType().isConstant();
|
ASSERT_FALSE(argument.isOutputArgument()) << argument.isConstant() << argument.pointeeType().isConstant();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(Cursor, ConstantPointerIsNotOutputArgument)
|
TEST_F(Cursor, ConstantPointerIsOutputArgument)
|
||||||
{
|
{
|
||||||
auto callExpressionCursor = translationUnit.cursorAt(128, 21);
|
auto callExpressionCursor = translationUnit.cursorAt(128, 21);
|
||||||
|
|
||||||
auto argument = callExpressionCursor.type().argument(0);
|
auto argument = callExpressionCursor.type().argument(0);
|
||||||
|
|
||||||
ASSERT_FALSE(argument.isOutputArgument());
|
ASSERT_TRUE(argument.isOutputArgument());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(Cursor, ReferenceIsOutputArgument)
|
TEST_F(Cursor, ReferenceIsOutputArgument)
|
||||||
|
@@ -1326,7 +1326,7 @@ TEST_F(TokenProcessor, NonConstPointerArgument)
|
|||||||
infos[1];
|
infos[1];
|
||||||
|
|
||||||
ASSERT_THAT(infos[2],
|
ASSERT_THAT(infos[2],
|
||||||
HasOnlyType(HighlightingType::LocalVariable));
|
HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TokenProcessor, PointerToConstArgument)
|
TEST_F(TokenProcessor, PointerToConstArgument)
|
||||||
@@ -1346,7 +1346,7 @@ TEST_F(TokenProcessor, ConstPointerArgument)
|
|||||||
infos[1];
|
infos[1];
|
||||||
|
|
||||||
ASSERT_THAT(infos[2],
|
ASSERT_THAT(infos[2],
|
||||||
HasOnlyType(HighlightingType::LocalVariable));
|
HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TokenProcessor, NonConstPointerGetterAsArgument)
|
TEST_F(TokenProcessor, NonConstPointerGetterAsArgument)
|
||||||
@@ -1400,7 +1400,7 @@ TEST_F(TokenProcessor, NonConstPointerArgumentAsExpression)
|
|||||||
infos[1];
|
infos[1];
|
||||||
|
|
||||||
ASSERT_THAT(infos[3],
|
ASSERT_THAT(infos[3],
|
||||||
HasOnlyType(HighlightingType::LocalVariable));
|
HasTwoTypes(HighlightingType::LocalVariable, HighlightingType::OutputArgument));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(TokenProcessor, NonConstPointerArgumentAsInstanceWithMember)
|
TEST_F(TokenProcessor, NonConstPointerArgumentAsInstanceWithMember)
|
||||||
|
Reference in New Issue
Block a user