Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [solved]How to implement a component with swappable subcomponents?
Forum Updated to NodeBB v4.3 + New Features

[solved]How to implement a component with swappable subcomponents?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bobbaluba
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      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.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bobbaluba
        wrote on last edited by
        #3

        StackView seems perfect, thanks a lot!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved