Results 1 to 2 of 2

Thread: How to refresh a ListWidget in a mainwindow from a dialog?

  1. #1
    Join Date
    Nov 2016
    Posts
    5
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default How to refresh a ListWidget in a mainwindow from a dialog?

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to refresh a ListWidget in a mainwindow from a dialog?

    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,
    _

Similar Threads

  1. about dialog and mainwindow (ui,,ui)
    By Newbit in forum Newbie
    Replies: 0
    Last Post: 28th October 2014, 08:41
  2. Refresh the mainwindow / functions called in the main loop
    By valerianst in forum Qt Programming
    Replies: 7
    Last Post: 2nd October 2013, 14:57
  3. Replies: 1
    Last Post: 25th August 2009, 13:26
  4. Refresh the Mainwindow at run time
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 15th November 2007, 13:16
  5. mainwindow does not refresh
    By edb in forum Qt Programming
    Replies: 22
    Last Post: 25th January 2006, 16:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.