Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Go to source files by F4 shortcut
Forum Updated to NodeBB v4.3 + New Features

Go to source files by F4 shortcut

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
1 Posts 1 Posters 292 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mioq
    wrote on last edited by
    #1

    I searched for solution how to simply open source files of qt library. I found only unsolved post on [qt creator] go to source files by F4 shortcut.

    I found a solution. For example, if you wont access to header file of QPushButton, you can open header file via F2. But you have no access to source of QPushButton class, as obvious.

    #include <QPushButton> points to file C:\Qt\5.14.1\mingw73_32\include\QtWidgets\qpushbutton.h. You cannot swap to source, because folder doesn't have them. But if you add source files in *.pro

    DISTFILES +=
    C:\Qt\5.14.1\Src\qtbase\src\widgets\widgets*.cpp \

    you will got access to all source files in required folder - all widgets in this case. It is not needed add each file separately. Via F4 you can swap between header and source file. Additionally, if you open source file ones, you got direct access to source definition of the function via F2 key (cursor must be on the function). You have to add some text in pro file, but I think the effort is minimal.

    Keep in mind, that you open header from different folder than source!
    Header from C:\Qt\5.14.1\mingw73_32\include\QtWidgets
    Source from C:\Qt\5.14.1\Src\qtbase\src\widgets\widgets

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved