Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seanchas116/qtimgui
Qt (QOpenGLWidget / QOpenGLWindow) backend for ImGui
https://github.com/seanchas116/qtimgui
cpp imgui opengl qt
Last synced: 2 days ago
JSON representation
Qt (QOpenGLWidget / QOpenGLWindow) backend for ImGui
- Host: GitHub
- URL: https://github.com/seanchas116/qtimgui
- Owner: seanchas116
- License: mit
- Created: 2017-06-22T10:52:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-30T05:24:00.000Z (about 1 year ago)
- Last Synced: 2024-12-22T17:15:26.528Z (9 days ago)
- Topics: cpp, imgui, opengl, qt
- Language: C++
- Homepage:
- Size: 99.6 KB
- Stars: 376
- Watchers: 19
- Forks: 96
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QtImGui
Qt (QOpenGLWidget / QOpenGLWindow) backend for [ImGui](https://github.com/ocornut/imgui)
It enables ImGui to run in QOpenGLWidget / QOpenGLWindow.
[![https://gyazo.com/eb68699c96b9147cca3d5ea9fadfc263](https://i.gyazo.com/eb68699c96b9147cca3d5ea9fadfc263.gif)](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.
* CMake:
* Add `add_subdirectory(path/to/qtimgui)` to your `CMakeLists.txt` file
* Link `qt_imgui_quick` (for Qt Quick apps or apps that don't use QOpenGLWidget) or `qt_imgui_widget` (for apps using QOpenGLWidget)
* qmake:
* Add `include(path/to/qtimgui/qtimgui.pri)` to your `.pro` file
* Subclass `QOpenGLWindow` or `QOpenGLWidget` and:```cpp
class DemoWindow : public QOpenGLWindow
{
protected:
void initializeGL() override
{
QtImGui::initialize(this);
}
void paintGL() override
{
// you can do custom GL rendering as well in paintGLQtImGui::newFrame();
ImGui::Text("Hello");
// more widgets...ImGui::Render();
QtImGui::render();
}
};
```See [QOpenGLWidget example](examples/widget) and [QOpenGLWindow example](examples/window) for details.
## Specific notes for Android, when using cmake
Two projects are provided: `qtimgui.pro` and `CMakeLists.txt`.
When using CMake under Android, this project will uses [qt-android-cmake](https://github.com/LaurentGomila/qt-android-cmake), which is a CMake utility for building and deploying Qt based applications on Android without Qt Creator.
*In order to successfuly deploy the app to a device, the cmake variable `ANDROID_NATIVE_API_LEVEL` should elevated to 21 or 26 (depending on the native levels installed in your android sdk)
You will need to set it via the CMake command line, or inside Qt Creator (in the project view).*