Fix handling of Doxygen property members (Q_PROPERTY)#1047
Open
AlexanderKosik wants to merge 1 commit intobreathe-doc:mainfrom
Open
Fix handling of Doxygen property members (Q_PROPERTY)#1047AlexanderKosik wants to merge 1 commit intobreathe-doc:mainfrom
AlexanderKosik wants to merge 1 commit intobreathe-doc:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a crash in Breathe that occurs when Doxygen emits a element, which is typically produced when parsing Qt’s Q_PROPERTY macro. Breathe currently has no mapping for the property kind in the internal DomainDirectiveFactory, causing a KeyError during documentation rendering.
This change adds handling for Doxygen "property" members and maps them to an appropriate Sphinx C++ domain directive so that Breathe can continue rendering without error.
Problem
Qt’s Q_PROPERTY macro is widely used in C++/Qt projects.
Doxygen interprets these macros and generates XML entries like:
<memberdef kind="property" ...>When Breathe processes the XML and attempts to dispatch this member kind, it fails because "property" is not included in the cpp_classes mapping.
This results in an exception:
Reproduction/Example
With this input, Doxygen generates a property entry which Breathe cannot process, triggering the above KeyError.
Thank you
Thank you for maintaining Breathe and continuing to support the C++/Sphinx ecosystem.
I hope this patch helps improve Qt compatibility and avoid crashes for other users facing the same issue.