Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 04-Sep-2020 | - | ||||
demo-widget/ | H | 04-Sep-2020 | - | 95 | 71 | |
demo-window/ | H | 04-Sep-2020 | - | 95 | 71 | |
.gitignore | H A D | 04-Sep-2020 | 434 | 45 | 33 | |
ImGuiRenderer.cpp | H A D | 04-Sep-2020 | 14.7 KiB | 385 | 313 | |
ImGuiRenderer.h | H A D | 04-Sep-2020 | 1.6 KiB | 61 | 48 | |
LICENSE | H A D | 04-Sep-2020 | 1.1 KiB | 22 | 17 | |
QtImGui.cpp | H A D | 04-Sep-2020 | 1.6 KiB | 79 | 65 | |
QtImGui.h | H A D | 04-Sep-2020 | 184 | 16 | 10 | |
README.md | H A D | 04-Sep-2020 | 1.1 KiB | 39 | 28 | |
qtimgui.pri | H A D | 04-Sep-2020 | 256 | 14 | 10 | |
qtimgui.pro | H A D | 04-Sep-2020 | 55 | 4 | 2 |
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