Community
Participate
Working Groups
Build ID: I20070621-1340 Steps To Reproduce: 1. download sources of Kdenlive project 2. go to main.cpp 3. try to use Content Assist for Gui::KdenliveApp or its instance More information: Project Kdenlive. http://www.kdenlive.org/ svn co https://kdenlive.svn.sourceforge.net/svnroot/kdenlive/trunk/kdenlive kdenlive Content Assist is severely broken. It recognizes most of Qt and KDE symbols but fails on many internal symbols. See this example --------------------------- kdenlive.h .. namespace Gui { ... class KdenliveApp:public KDockMainWindow { Q_OBJECT public: KdenliveApp(bool newDoc, QWidget * parent = 0, const char *name = 0); ... } --------------------------- kdenlive.cpp #include "kdenlive.h" ... int main(int argc, char *argv[]) { ... Gui::KdenliveApp * kdenlive = new Gui::KdenliveApp(args->count()); ... } Gui::KdenliveApp “Open Declaration” function gives a long list of forward references but not relevant declaration (resp. definition) in kdenlive.h. “Declarations function” – the same problem, long list of various places forward referencing Gui::KdenliveApp, but not kdenlive.h. References function works as expected. There is no Code Assist for “kdenlive” instance. Gui::KdenliveApp is recognized as a type but somehow an empty type, no methods, no fields. CDT does not seems to distinguish much declaration from definition like in JDT, or am I missing something? Gui::KdenliveApp is main structure around the whole application is build so Content Assist functionality is sadly missed and renders CDT in that sense unusable. As for the KDE libs. KApplicaion is not recognized as a type, but KCmdLineArgs is. Both from KDE libs. Generally, most of the KDE symbols are well recognized and Content Assist is provided. Kdenlive is a KDE and GNU Autotools driven application. It should not matter so much. It compiles and run well for me. I didn't install any autotools plugin. Or should I? I just created classic C++ Eclipse project and attached a directory with existing sources to it and compiled Kdenlive outside using command line tools. BTW, do I need to compile sources to Content Assist start to work or running only ./configure is required?
Qt source is not pure C++, but uses some extensions which can cause problems parsing the code. See also bug 104946.
OK. Thank you for the info. Is there any plugin to fix thid? Qt Eclipse integration plugin? Is there any CDT team effort to make Qt/KDE based projects not to break content assist, i.e. ignore Qt preprocessor extra symbols?
(In reply to comment #2) > OK. Thank you for the info. > Is there any plugin to fix thid? Qt Eclipse integration plugin? > Is there any CDT team effort to make Qt/KDE based projects not to break content > assist, i.e. ignore Qt preprocessor extra symbols? Not that I know of. It would require a new language variant (extension point "org.eclipse.cdt.core.language"). Defining default preprocessor macros as suggested in bug 104946 comment 2 to substitute Qt's keywords would be quite easy. *** This bug has been marked as a duplicate of bug 104946 ***
I discovered that my Qt libraries are not under /usr/include, but in /usr/lib/qt3/include/ (Qt3) and /usr/lib/qt4/include/ (Qt4). So I added /usr/lib/qt3/include/ to project properties and rebuild index and whohooo it started to work! It seems to be fine now. Outline View, Reference and Declarations search, Content Assist as expected. It was quite confusing since Qt classes were marked as recognized. So sorry for this report, problem was (mostly) on my side. My explanations of problem: CDT Indexer found KDE header files, they are under /usr/include, but not Qt. Indexer got confused and considered Qt forward references as definitions of Qt classes. There is a lot of such forward references in KDE header files. This caused Qt classes became recognized by indexer, but as somewhat empty objects. Definition of Q_OBJECT and other Qt specialties was missed and this caused another confusion in Kdenlive (ie my project) sources. Does it make sense? So even parser/indexer seems to work with KDE/Qt sources well there is a (latent?) problem. Indexer should report missing definitions, like missing Qt classes and get confused.