PDA

View Full Version : How to refresh a ListWidget in a mainwindow from a dialog?



Nicklax
18th November 2016, 22:19
Hello, I have a program where the user adds list items to a list widget in main window from a separate dialog that pops up upon pressing the add button on the mainwindow. The program works fine but the list widget does not register the change until the program is closed and reopened and im unsure of how to get the new item to immediately appear on the list after the user is finished entering it in and hits the done button on the dialog.

anda_skoa
19th November 2016, 12:34
Do do you added the new item from the dialog?

Do you emit the data via signal and add the item in the main window code?

Do you pass the list widget to the dialog and let it add the item?

Do dialog and mainwindow access some shared list data? Does that list data notify the mainwindow about the change?

Cheers,
_