Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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?
    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?



  • @opengpu2

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



  • QStackedLayout and QStackedWidget seems to do this work.


Log in to reply