diff options
author | Topi Reinio <topi.reinio@qt.io> | 2022-07-05 21:48:11 +0200 |
---|---|---|
committer | Topi Reinio <topi.reinio@qt.io> | 2022-08-23 23:31:15 +0200 |
commit | 9ebd62831f1d3b2c314aebf416ca69f98955af2a (patch) | |
tree | e3f66035b904f96d72ade0ede244480c0760fdc2 /src/qdoc/clangcodeparser.cpp | |
parent | edf871eba1bd47c1616e4ace31ad5c6e60bd9e63 (diff) | |
download | qttools-9ebd62831f1d3b2c314aebf416ca69f98955af2a.tar.gz |
qdoc: Store BINDABLE property members into PropertyNode
QDoc already recognized the BINDABLE attribute of Q_PROPERTY
but did not store the name of the associated member.
Store it in the list of a PropertyNode's access functions.
This information will be useful later when deciding on
whether to generate a warning for missing member functions;
functions that are associated with properties can be left
undocumented if the property itself is documented.
Add a static helper function PropertyNode that returns the
names of property access function roles. This is used when
writing the access functions into an .index file.
Convert access function-related enums to enum classes.
Change-Id: Idd59622a965895883acf3ae297297ba3f3cca20e
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Diffstat (limited to 'src/qdoc/clangcodeparser.cpp')
-rw-r--r-- | src/qdoc/clangcodeparser.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index 4c46b8c53..7a2ea72a7 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -979,9 +979,9 @@ bool ClangVisitor::parseProperty(const QString &spelling, const Location &loc) if (i < parts.size()) { QString value = parts.at(i++); if (key == "READ") { - qdb_->addPropertyFunction(property, value, PropertyNode::Getter); + qdb_->addPropertyFunction(property, value, PropertyNode::FunctionRole::Getter); } else if (key == "WRITE") { - qdb_->addPropertyFunction(property, value, PropertyNode::Setter); + qdb_->addPropertyFunction(property, value, PropertyNode::FunctionRole::Setter); property->setWritable(true); } else if (key == "STORED") { property->setStored(value.toLower() == "true"); @@ -995,11 +995,12 @@ bool ClangVisitor::parseProperty(const QString &spelling, const Location &loc) property->setDesignable(false); } } else if (key == "BINDABLE") { - property->setPropertyType(PropertyNode::Bindable); + property->setPropertyType(PropertyNode::PropertyType::BindableProperty); + qdb_->addPropertyFunction(property, value, PropertyNode::FunctionRole::Bindable); } else if (key == "RESET") { - qdb_->addPropertyFunction(property, value, PropertyNode::Resetter); + qdb_->addPropertyFunction(property, value, PropertyNode::FunctionRole::Resetter); } else if (key == "NOTIFY") { - qdb_->addPropertyFunction(property, value, PropertyNode::Notifier); + qdb_->addPropertyFunction(property, value, PropertyNode::FunctionRole::Notifier); } else if (key == "SCRIPTABLE") { QString v = value.toLower(); if (v == "true") |