Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. can i use 2 widget at the same place, and everytime i only allow 1 widget visible?

can i use 2 widget at the same place, and everytime i only allow 1 widget visible?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 587 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.
  • O Offline
    O Offline
    opengpu2
    wrote on last edited by
    #1

    can i use 2 widget at the same place, and everytime i only allow 1 widget visible?
    for many reason, it seems that i have to use 2 widget (QTreeWidget & QListWidget) at the Same place, and everytime I allow the user only see 1 of them.
    how could i do this?
    set them to a parent Layout or a Widget? and then setVisible() to control which one is shown to the user?

    S 1 Reply Last reply
    0
    • O opengpu2

      can i use 2 widget at the same place, and everytime i only allow 1 widget visible?
      for many reason, it seems that i have to use 2 widget (QTreeWidget & QListWidget) at the Same place, and everytime I allow the user only see 1 of them.
      how could i do this?
      set them to a parent Layout or a Widget? and then setVisible() to control which one is shown to the user?

      S Offline
      S Offline
      Sam
      wrote on last edited by
      #2

      @opengpu2

      Yes you can put them in a layout and use setVisible(false/true) to hide or show the widget.

      1 Reply Last reply
      0
      • O Offline
        O Offline
        opengpu2
        wrote on last edited by
        #3

        QStackedLayout and QStackedWidget seems to do this work.

        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