[qt creator] go to source files by F4 shortcut



  • How can I install Qt Source cpp files and tell Qt Creator to open this source file when I do ctrl+click on some method or by F4 shortcut?

    e.g. for:

    QFile myFile("a.txt");
    myFile.exi|sts(); // F4 at | char
    

    I have installed Sources:

    0_1503595562616_qt_installer_sources.png

    In Qt dir was of course created e:\Qt\5.9.1\Src\ folder which contains source files, how to tell Qt Creator to take into account this files?

    Thank you for any suggestions and advices.


  • Moderators

    @silverq
    QtCreator settings -> Debugger -> General -> Source Paths Mapping



  • I have tried many combination of paths, but still without success, I can't go to the source cpp files by F4 or ctrl+left click.

    0_1503649704567_source_path_mapping.png

    Paths on the picture was added automatically when I clicked Add Qt sources... button, I tried with this paths too.

    I tried this source paths:

    e:\Qt\Qt5.9.1\5.9.1\msvc2015_64\bin\
    e:\Qt\Qt5.9.1\5.9.1\msvc2015_64\
    

    And this target paths:

    e:\Qt\Qt5.9.1\5.9.1\Src\
    e:\Qt\Qt5.9.1\5.9.1\Src\qtbase\
    e:\c\build-qt_test-Desktop_Qt_5_9_1_MSVC2015_64bit-Debug\
    

    The last one is my example project.

    And even vice versa :/

    Source paths:

    e:\Qt\Qt5.9.1\5.9.1\Src\
    e:\Qt\Qt5.9.1\5.9.1\Src\qtbase\
    

    Target paths:

    e:\Qt\Qt5.9.1\5.9.1\msvc2015_64\
    

    Without success.

    Only one solution which I found and works, is to compile qt myself, like:

    configure -debug -nomake examples -nomake tests -opensource -confirm-license -platform win32-msvc2015 -developer-build
    

    When I use this kit, so F4 shortcut works as expected and even Step Into (F11) to qt sources during debugging works too.

    But I don't want to recompile qt for every new version.

    Did I Miss something?



  • So it doesn't work even with developer-build :/, so recompile myself didn't help, still any solution.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.