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

How can i update a widget live



  • This post is deleted!


  • @benyeyeye
    Hi there.

    I don't think anyone can answer this without clarifying the information you give. What widgets, how are they connected to the database, are you using model-view etc.? For example, QTableView is commonly used to display multiple rows & columns in a visual table from a database model, or QDataWidgetMapper can be used if you want to diaply information about just one row, with separate widgets for each of the columns.



  • This post is deleted!


  • @benyeyeye said in How can i update a widget live:

    Is where i have a singular button in a frame. when pressed i want that button to be removed and 4 different buttons in its place

    You could do this in a number of ways:

    • To do it literally, you could use a layout's removeWidget() to remove the button and addWidget() to add a bunch of new ones.

    • You could use a button/widget's show/hide/setVisible() methods to hide the first button and show the other ones.

    • You could use a QStackedWidget to swap between one widget having just the first button and another widget having the three other buttons. A QStackedWidget shows only one widget at a time from a collection of widgets.


Log in to reply