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, orQDataWidgetMapper
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 andaddWidget()
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. AQStackedWidget
shows only one widget at a time from a collection of widgets.
-