robertknight / Qt-Inspector

Utility to browse the Qt object tree of a running Qt application and edit object properties on the fly.
GNU Lesser General Public License v3.0
401 stars 70 forks source link
qt

Qt Inspector

Qt Inspector is a tool to browse the object/widget tree of Qt applications.

Screenshot

Qt Inspector starts a specified application or connects to a specified process and once connected it can:

Building Qt inspector

Qt Inspector currently runs on Linux and Mac.

You will need protoc in your PATH. On Debian/Ubuntu, install protobuf-compiler and libprotobuf-dev.

    cmake <path to Qt inspector src>
    make -j2

Usage

Qt Inspector can either attach to an existing application or launch a specified application and then attach to it.

Recommended usage is to specify the program name and arguments.

    ./qtinspector <program name> <args>
    ./qtinspector <process ID of running Qt app>

Design

Qt Inspector operates by injecting a helper library into the target process when starting it using LD_PRELOAD / DYLD_INSERT_LIBRARIES or via gdb (if attaching to an existing process).

This helper library sets up a local socket and listens for requests from the inspector process. The inspector and target process communicate via protocol buffer messages over this socket.