Results 1 to 2 of 2

Thread: Looking for Example of QML using a table view editor via a C++ back end to edit XML

  1. #1
    Join Date
    Oct 2014
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Looking for Example of QML using a table view editor via a C++ back end to edit XML

    Right now I like the way the tableview example works, but I want to be able to edit and save the XML file, and it seems this example is read only using XmlListModel, and using the delegate to edit it, I need the data source to be editable, and not read only, I know I need to do this in the C++ back end, which I know how to create, and is very nice and powerful, but not sure what data type I should use to store the data in to allow saving it as an xml file when complete, this is where an example would be great, but I have been searching the internet for over a week, and I can not find one anywhere, it seems odd that they do not have an Example for such a useful feature as this, but I am sure there is a data type or Data Model, maybe its as simple as a class derived from QObject set to the source of a ListModel, but in the end, I have to save it as XML, which I am guessing I need to use QXmlStreamWriter, and maybe iterate through the data and fill in the right properties, so I am sure I will be able to figure it out the hard way, the old fashion way, write it and find out, but my guess is that there is an easier way to do it.

    BTW: This app is called Qut Wizard, its part of the WittyWizard.org Open Source Project that uses Wt for the Web Application and a Qt version of the Wizard called Qut Wizard, the idea is using a Qt Quick QML app to edit the web site, which is stored in XML documents, which can be uploaded later using ssh or ftp, which is more secure then a web based back end.

    Thanks
    Jeff Flesher

  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: Looking for Example of QML using a table view editor via a C++ back end to edit X

    The data structure of your model depends on your data and your needs.

    You probably have rows of records, so your data structure could be a QList or QVector of record objects.

    The model could then be a simple QAbstractListModel derived class, where the row indexes into the list and the role indexes into the record.

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 8th June 2011, 15:13
  2. Edit table for my own table-widget
    By MasterMatrix in forum Qt Programming
    Replies: 0
    Last Post: 1st December 2010, 08:05
  3. Replies: 1
    Last Post: 3rd April 2010, 16:47
  4. Replies: 5
    Last Post: 3rd April 2010, 05:07
  5. View/edit database in a table and in a form
    By igorko in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2006, 10:09

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