tree: 6b423c1163802d71a38f79f764f59f6543c6c366 [path history] [tgz]
  1. demo-widget/
  2. demo-window/
  3. .gitignore
  4. ImGuiRenderer.cpp
  5. ImGuiRenderer.h
  6. LICENSE
  7. QtImGui.cpp
  8. QtImGui.h
  9. qtimgui.pri
  10. qtimgui.pro
  11. README.md
3rdparty/qtimgui/README.md

QtImGui

Qt (QOpenGLWidget / QOpenGLWindow) backend for ImGui

It enables ImGui to run in QOpenGLWidget / QOpenGLWindow.

https://gyazo.com/eb68699c96b9147cca3d5ea9fadfc263

How to use

  • Add QtImGui sources and headers to your project
    • If you are using git submodule, run git submodule update --init --recursive to ensure that the inner submodule is initialized as well.
  • Add include(path/to/qtimgui.pri) to youre .pro file
  • Subclass QOpenGLWindow or QOpenGLWidget and:
class DemoWindow : public QOpenGLWindow
{
protected:
    void initializeGL() override
    {
        QtImGui::initialize(this);
    }
    void paintGL() override
    {
        // you can do custom GL rendering as well in paintGL

        QtImGui::newFrame();

        ImGui::Text("Hello");
        // more widgets...

        ImGui::Render();
    }
};

See QOpenGLWidget example and QOpenGLWindow example for details.