Results 1 to 3 of 3

Thread: Plugin: CppTools::ProjectInfo project sources and include paths

  1. #1
    Join Date
    Sep 2010
    Posts
    22
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Plugin: CppTools::ProjectInfo project sources and include paths

    Hello,
    I'm writing my first plugin for Qt Creator to integrate PC Lint check into projects. In order to provide Lint with required information I get active project information this way:
    Qt Code:
    1. CppTools::CppModelManager* modelManager = CppTools::CppModelManager::instance();
    2. Project* project=SessionManager::startupProject();
    3. CppTools::ProjectInfo info=modelManager->projectInfo(project);
    4. CppTools::ProjectPart::HeaderPaths includePath=info.headerPaths();
    5. QByteArray defs=info.defines();
    6. const QSet<QString> sourceFiles=info.sourceFiles();
    To copy to clipboard, switch view to plain text mode 
    The problem is that if I have conditions in qmake .pro file and some sources and include paths are added only for special configuration, I still get all source files from ProjectInfo, but include paths only for active configuration. Consequently Lint cannot resolve some includes and stops with error. Example application.pro:
    Qt Code:
    1. HEADERS += main/file1.h
    2. CONFIG(with_smth) {
    3. HEADERS += dynamic/file2.h
    4. }
    5. SOURCES += main/file1.cpp
    6. CONFIG(with_smth) {
    7. SOURCES += dynamic/file2.cpp
    8. }
    9. INCLUDEPATH += main
    10. CONFIG(with_smth) {
    11. INCLUDEPATH += dynamic
    12. }
    To copy to clipboard, switch view to plain text mode 
    In such case I have file1.cpp and file2.cpp, but only ./main in include paths and file2.h cannot be resolved.
    Is there anothe way to get project information from Qt Creator internals?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Plugin: CppTools::ProjectInfo project sources and include paths

    That sounds like a question that is more likely to get an anwer on the QtCreator development mailing list
    http://lists.qt-project.org/mailman/listinfo/qt-creator

    Cheers,
    _

  3. #3
    Join Date
    Sep 2010
    Posts
    22
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: Plugin: CppTools::ProjectInfo project sources and include paths

    Thanks, I've posted it there.

Similar Threads

  1. Replies: 14
    Last Post: 27th September 2012, 06:12
  2. Replies: 0
    Last Post: 23rd March 2011, 10:34
  3. X11 include and lib paths
    By Oluwafemi in forum Installation and Deployment
    Replies: 1
    Last Post: 3rd April 2010, 15:25
  4. Replies: 7
    Last Post: 10th September 2009, 21:21
  5. include paths
    By altec in forum Installation and Deployment
    Replies: 0
    Last Post: 8th August 2008, 11:59

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.