Merge remote-tracking branch 'origin/7.0'

Conflicts:
	src/libs/utils/qtcprocess.cpp
	src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp
	src/plugins/qmldesigner/components/itemlibrary/itemlibrarymodel.cpp

Change-Id: Id0c31719e46d1c44770ea89663eee321a0517ff4
This commit is contained in:
Eike Ziller
2022-02-24 11:42:13 +01:00
115 changed files with 1239 additions and 969 deletions

View File

@@ -2779,6 +2779,8 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
|| path.rbegin()->kind() == "CXXConstruct")) {
return false;
}
if (path.rbegin()->hasConstType())
return false;
for (auto it = path.rbegin() + 1; it != path.rend(); ++it) {
if (it->kind() == "Call" || it->kind() == "CXXConstruct"
|| it->kind() == "MemberInitializer") {
@@ -2810,8 +2812,9 @@ static void semanticHighlighter(QFutureInterface<HighlightingResult> &future,
const AstNode n = firstChildTree.takeFirst();
const QString detail = n.detail().value_or(QString());
if (detail.startsWith("operator")) {
return !detail.contains('=') && !detail.contains("++")
&& !detail.contains("--");
return !detail.contains('=')
&& !detail.contains("++") && !detail.contains("--")
&& !detail.contains("<<") && !detail.contains(">>");
}
firstChildTree << n.children().value_or(QList<AstNode>());
}
@@ -4122,7 +4125,7 @@ class MemoryTreeModel : public Utils::BaseTreeModel
public:
MemoryTreeModel(QObject *parent) : BaseTreeModel(parent)
{
setHeader({tr("Component"), tr("Total Memory")});
setHeader({MemoryUsageWidget::tr("Component"), MemoryUsageWidget::tr("Total Memory")});
}
void update(const MemoryTree &tree)

View File

@@ -1295,6 +1295,13 @@ void ClangdTestHighlighting::test_data()
QTest::newRow("keywords: true") << 920 << 15 << 920 << 19 << QList<int>{C_KEYWORD} << 0;
QTest::newRow("keywords: false") << 921 << 15 << 921 << 20 << QList<int>{C_KEYWORD} << 0;
QTest::newRow("keywords: nullptr") << 922 << 15 << 922 << 22 << QList<int>{C_KEYWORD} << 0;
QTest::newRow("operator<<") << 934 << 10 << 934 << 14 << QList<int>{C_GLOBAL} << 0;
QTest::newRow("operator>>") << 936 << 10 << 936 << 13 << QList<int>{C_GLOBAL} << 0;
QTest::newRow("operator>>") << 936 << 17 << 936 << 18 << QList<int>{C_LOCAL} << 0;
QTest::newRow("input arg from passed object") << 945 << 17 << 945 << 18
<< QList<int>{C_FIELD} << 0;
QTest::newRow("output arg") << 945 << 20 << 945 << 23
<< QList<int>{C_LOCAL, C_OUTPUT_ARGUMENT} << 0;
}
void ClangdTestHighlighting::test()

View File

@@ -921,3 +921,26 @@ void keywords()
bool b2 = false;
void *p = nullptr;
}
namespace std {
struct Debug {};
Debug& operator<<(Debug &dbg, int) { return dbg; }
Debug& operator>>(Debug &dbg, int&) { return dbg; }
static Debug cout;
static Debug cin;
}
void outputOperator()
{
std::cout << 0;
int i;
std::cin >> i;
}
template <typename To, typename From, typename Op>
void transform(const From &from, To &&to, Op op) {}
struct WithVector { std::vector<int> v; };
void inputsAndOutputsFromObject(const WithVector &s)
{
std::vector<int> out;
transform(s.v, out, [] {});
}