• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..04-Sep-2020-

demo-widget/H04-Sep-2020-9571

demo-window/H04-Sep-2020-9571

.gitignoreH A D04-Sep-2020434 4533

ImGuiRenderer.cppH A D04-Sep-202014.7 KiB385313

ImGuiRenderer.hH A D04-Sep-20201.6 KiB6148

LICENSEH A D04-Sep-20201.1 KiB2217

QtImGui.cppH A D04-Sep-20201.6 KiB7965

QtImGui.hH A D04-Sep-2020184 1610

README.mdH A D04-Sep-20201.1 KiB3928

qtimgui.priH A D04-Sep-2020256 1410

qtimgui.proH A D04-Sep-202055 42

README.md

1# QtImGui
2
3Qt (QOpenGLWidget / QOpenGLWindow) backend for [ImGui](https://github.com/ocornut/imgui)
4
5It enables ImGui to run in QOpenGLWidget / QOpenGLWindow.
6
7[![https://gyazo.com/eb68699c96b9147cca3d5ea9fadfc263](https://i.gyazo.com/eb68699c96b9147cca3d5ea9fadfc263.gif)](https://gyazo.com/eb68699c96b9147cca3d5ea9fadfc263)
8
9## How to use
10
11* Add QtImGui sources and headers to your project
12    * If you are using git submodule, run `git submodule update --init --recursive` to ensure that the inner submodule is initialized as well.
13* Add `include(path/to/qtimgui.pri)` to youre `.pro` file
14* Subclass `QOpenGLWindow` or `QOpenGLWidget` and:
15
16```cpp
17class DemoWindow : public QOpenGLWindow
18{
19protected:
20    void initializeGL() override
21    {
22        QtImGui::initialize(this);
23    }
24    void paintGL() override
25    {
26        // you can do custom GL rendering as well in paintGL
27
28        QtImGui::newFrame();
29
30        ImGui::Text("Hello");
31        // more widgets...
32
33        ImGui::Render();
34    }
35};
36```
37
38See [QOpenGLWidget example](demo-widget/demo-widget.cpp) and [QOpenGLWindow example](/demo-window/demo-window.cpp) for details.
39