aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-13 13:03:18 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-07-13 13:07:52 +0200
commit843b476cf4bf7f20c7a3c433e41a76995b0cebca (patch)
tree3f3dc80c8c8c370e0d62462f9d352412b9cb4595 /sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
parent3899ed571eb2b453736b3b55a8991df83d33d609 (diff)
parent7211180820d76814c7060d39d7ce0e9902865e14 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
index 8765f9c3a..ef3471d6a 100644
--- a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
@@ -1138,6 +1138,19 @@ BaseVisitor::StartTokenResult Builder::startToken(const CXCursor &cursor)
if (!d->m_currentFunction.isNull())
d->m_currentFunction->setOverride(true);
break;
+ case CXCursor_StaticAssert:
+ // Check for Q_PROPERTY() (see PySide2/global.h.in for an explanation
+ // how it is defined, and qdoc).
+ if (clang_isDeclaration(cursor.kind) && !d->m_currentClass.isNull()) {
+ auto snippet = getCodeSnippet(cursor);
+ const auto length = snippet.size();
+ if (length > 12 && *snippet.rbegin() == ')'
+ && snippet.compare(0, 11, "Q_PROPERTY(") == 0) {
+ const QString qProperty = QString::fromUtf8(snippet.data() + 11, length - 12);
+ d->m_currentClass->addPropertyDeclaration(qProperty);
+ }
+ }
+ break;
default:
break;
}