Results 1 to 6 of 6

Thread: New item not saved to combobox when added dynamically

Hybrid View

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

    Default Re: New item not saved to combobox when added dynamically

    Your posting does not contain any code that would persist items in any way.

    So if "when i closed the app and open the app" means you stop the program and run it again, then of course there won't be any data in the newly started instance of your program.

    Cheers,
    _

  2. #2
    Join Date
    Oct 2013
    Posts
    142
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android
    Thanks
    36
    Thanked 3 Times in 3 Posts

    Default Re: New item not saved to combobox when added dynamically

    You can:
    -write the data into a file using either QTextStream either QDataStream(on closing or when you add the item to the qcombobox) and when the QComboBox is loaded set it to read the file for content and add the saved content to your combobox
    -use Sqlite in combination with QSqlDatabase,QSqlQuery to store and retrieve data from local database.

Similar Threads

  1. Replies: 2
    Last Post: 3rd June 2013, 16:45
  2. Replies: 8
    Last Post: 2nd February 2012, 19:52
  3. Replies: 0
    Last Post: 25th July 2011, 14:11
  4. Automatic file extension is not added to saved file on mac os x
    By sanjayshelke in forum Qt Programming
    Replies: 0
    Last Post: 30th October 2009, 06:56
  5. Connecting dynamically added properties
    By stefkeB in forum Qt Programming
    Replies: 1
    Last Post: 5th December 2008, 15:19

Tags for this Thread

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.