Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can support ImGuiConfigFlags_ViewportsEnable? #1

Open
Wuqiqi123 opened this issue Jan 12, 2023 · 2 comments
Open

Can support ImGuiConfigFlags_ViewportsEnable? #1

Wuqiqi123 opened this issue Jan 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Wuqiqi123
Copy link

Wuqiqi123 commented Jan 12, 2023

I test it in qt5 and it works perfect.
Can you support Viewports and docking, I really like this two features.
Thanks.

@dpaulat
Copy link
Owner

dpaulat commented Jan 13, 2023

Excellent - great to hear it works with Qt 5!

The backend is designed to work with Qt graphics contexts defined external to ImGui. With multi-viewports, ImGui manages the viewports and graphics contexts. I played around with it briefly, but I wasn't able to find a good way to separate that functionality and make them externally managed. The solution I had was to create an ImGui context for each widget, and that seemed to work well for my purposes. That said, I'm open to alternate solutions.

I think docking might be a little bit easier to achieve. First, instead of creating an ImGui context per widget, you'd have to return to sharing a single ImGui context (this should work decently, I've tested this part). In addition, you'll need to enable docking via the enable flag using the docking branch. Per the Docking documentation, that should get you 90% of the features. While it's a starting point, I'm skeptical, as I haven't tested it with this backend. I do have some code that checks whether input occurred on a given widget, and I suspect this might need some tweaking.

I'm not sure what an entire-screen docking approach would look like, I would imagine there's a way to create an invisible Qt OpenGL widget over the entire screen as your main viewport.

There has been at least some discussion around a similar use case:
ocornut/imgui#4298

@dpaulat dpaulat added the enhancement New feature or request label Jan 13, 2023
@Wuqiqi123
Copy link
Author

Yes! I checkout imgui to docking branch and test DemoWindow. It looks works.
Peek 2023-01-13 13-50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants