So after tackling this case, AST generation would not be rocket-science (nor brain surgery). That said, the Q_PROPERTY is probably the most complex case. (Oh, and the read/write/notify methods/slots have to be declared, obviously.)Īnd no, I did not want to do that (yet?). So this would require to either properly parse it, or to be able to get the macro contents (with the macro recorder, which is currently only used when the parser is instantiated by libclang) and then re-parse it in a plug-in. I implemented it with in Qt Creator for our current parser, and the syntax is roughly that after the lparen there has to be a (variable) declaration, the parameter-pack for the read/write/notify method is optional (but for the write/notify method it can be a maximum of 1). Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)įor the compiler, this macro expands to empty. For my current use-case (the Qt Creator IDE) I/we do not need that (yet). One of the obviously missing things is an attribute for use in/with the Q_OBJECT macro.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |