aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
diff options
context:
space:
mode:
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 263c0a0bb..d08720934 100644
--- a/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
+++ b/sources/shiboken2/ApiExtractor/clangparser/clangbuilder.cpp
@@ -1117,6 +1117,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.second - snippet.first;
+ if (length > 12 && *(snippet.second - 1) == ')'
+ && std::strncmp(snippet.first, "Q_PROPERTY(", 11) == 0) {
+ const QString qProperty = QString::fromUtf8(snippet.first + 11, length - 12);
+ d->m_currentClass->addPropertyDeclaration(qProperty);
+ }
+ }
+ break;
default:
break;
}