Version: 2.3.2 (using KDE 4.3.2) OS: Linux Installed from: Ubuntu Packages Hello. There are problem while importing Qt-based sources. Umbrello parse Q_OBJECT macro incorrect. For example such code: class MyClass: public QObject { Q_OBJECT public: void method1(); ................... While parsing I got "Q_OBJECTpublic" class in my tree and method1 is private of course, because "public" directive was incorrectly translated. Also It will be good to understand base Qt's macros while importing the source code, such as Q_DECLARE_PUBLIC, Q_DECLARE_PRIVATE, Q_Q, Q_D, SIGNALS, SLOTS, QFLAG, QPROPERTY and so on.
The bug is also present on windows in recent svn code, which means that umbrello is currently unusable for importing any qt based code. This includes the whole kde base.
This bug is fixed in the kdevelop4 cpp parser.
Further analysis shows that the lexer, which is based on boost::spirit, returned 'Q_OBJECT' concated with the following term 'public:'. I tried to follow the calls into the boost spirit library, but get lost in the very deep call tree. When this worked before (which I assume) I guess that the problem is caused by a bug or internal change in newer versions of the boost::spirit parser. In case of an internal change it may be that there is a different or additional boost::spirit setup required, which umbrello does not follow.
To be complete: I also tried to add Q_OBJECT to the "lexer should skip word" list, but this do not fix the problem. In the lexer code there are also some hardcoded checks for Q_.. related stuff, where I added Q_OBJECT; unfortunally without any success.
Git commit 959e40b8e0de02af21ccb93b77b2cde39dda81db by Ralf Habacker. Committed on 20/01/2014 at 21:31. Pushed by habacker into branch 'master'. Add debug support to class Parser, Lexer and PreprocessLexer. This should help to find cpp parse problems easier. Debug support can be enabled for several classes through the debug window (STRG-D). M +2 -0 umbrello/codeimport/kdevcppparser/lexer.cpp M +2 -1 umbrello/codeimport/kdevcppparser/lexer.h M +113 -111 umbrello/codeimport/kdevcppparser/parser.cpp M +2 -1 umbrello/codeimport/kdevcppparser/parser.h M +2 -0 umbrello/codeimport/kdevcppparser/preprocesslexer.cpp M +2 -1 umbrello/codeimport/kdevcppparser/preprocesslexer.h http://commits.kde.org/umbrello/959e40b8e0de02af21ccb93b77b2cde39dda81db
Git commit fa356a629dbef8b352d9d3d71a5df830454a7c38 by Ralf Habacker. Committed on 21/01/2014 at 20:30. Pushed by habacker into branch 'master'. Fix Q_OBJECT macro parse error. FIXED-IN:2.12.2,4.11.6 M +6 -1 umbrello/codeimport/kdevcppparser/preprocesslexer.cpp http://commits.kde.org/umbrello/fa356a629dbef8b352d9d3d71a5df830454a7c38
Git commit 0047de9c3e3767c7dd159de7e626f3daf1eb16f0 by Ralf Habacker. Committed on 21/01/2014 at 20:30. Pushed by habacker into branch 'KDE/4.12'. Fix Q_OBJECT macro parse error. FIXED-IN:2.12.2,4.11.6 (cherry picked from commit fa356a629dbef8b352d9d3d71a5df830454a7c38) M +6 -1 umbrello/codeimport/kdevcppparser/preprocesslexer.cpp http://commits.kde.org/umbrello/0047de9c3e3767c7dd159de7e626f3daf1eb16f0
Git commit e1b421517ec1825b7c822c04c761adc789d91e38 by Ralf Habacker. Committed on 21/01/2014 at 20:30. Pushed by habacker into branch 'KDE/4.11'. Fix Q_OBJECT macro parse error. FIXED-IN:4.11.6 (cherry picked from commit fa356a629dbef8b352d9d3d71a5df830454a7c38) M +6 -1 umbrello/codeimport/kdevcppparser/preprocesslexer.cpp http://commits.kde.org/umbrello/e1b421517ec1825b7c822c04c761adc789d91e38