[solved]How to implement a component with swappable subcomponents?
QML and Qt Quick
3
Posts
2
Posters
1.2k
Views
1
Watching
-
Screenshot of my application for context:
!http://i.imgur.com/4SlXrnM.png(screenshot)!On the right, I'm going to have some sort of inspector that will let me edit the selected node. I want to develop something similar to Unity3D's inspector.
The issue I am facing, is that I want to be able to have a different editor for different selected elements, what would be the best way to solve this?
What I'm considering right now is:
- Let the inspector have different states, with a different editor visible in each state.
- Somehow add and remove editors as children during runtime.
I'm sure this is a common problem, I just don't know how to formulate it so google will tell me :P
-
Hi,
TabView/StackView (QML) or QTabWidget/QStackedWidget (C++) are created for this purpose.
Also read up on Layouts -- they help you to arrange components, and you can add/remove components dynamically.