Results 1 to 3 of 3

Thread: How do you synchronize GUI elements to a (non-database) data source?

  1. #1
    Join Date
    Apr 2014
    Posts
    34
    Thanks
    14
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11

    Default How do you synchronize GUI elements to a (non-database) data source?

    I have an array of items. An item is represented by a class that contains three string fields. I have a GUI with three line edits to display/edit the fields of an item. I also have a slider to access the items within the array.

    I want to synchronize the items within the array with any changes made to the line edits. Is there a way to do that automatically, such that a change to the line edit updates the data? (And vice-versa?)

  2. #2
    Join Date
    Oct 2012
    Posts
    132
    Thanks
    10
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: How do you synchronize GUI elements to a (non-database) data source?

    Your data structure seems like a table (rows are the elements in your array, columns are the three string values). Hence you might want to subclass the QAbstractTableModel.

    I don't think what you want to do can be done automatically.

  3. #3
    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 do you synchronize GUI elements to a (non-database) data source?

    I'd say maybe QAbstractTableModel with a QDataWidgetMapper

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 6th April 2014, 11:07
  2. Synchronize data with server
    By plopes21 in forum Qt Programming
    Replies: 1
    Last Post: 29th May 2012, 00:14
  3. Database drivers provided with Qt Open Source Edition
    By babygal in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2010, 07:47
  4. remote ODBC data source
    By mchara in forum Qt Programming
    Replies: 7
    Last Post: 10th December 2007, 10:39
  5. Connecting to an ODBC Data Source
    By kikapu in forum Newbie
    Replies: 9
    Last Post: 25th June 2007, 12:18

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.