Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Best approach for xml processing using model/view

Best approach for xml processing using model/view

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    panosk
    wrote on 31 Jul 2012, 11:49 last edited by
    #1

    Hi,

    I' working on an xml app while trying to learn and practice the model/view concepts. Currently, the application uses QXmlStreamReader(Writer) to parse the xml files and loads the required element texts in a QStandardItemModel which in turn uses a QTableView for displaying the data. The model's rows and columns are added dynamically, but for the purposes of my question I'll use the most common scenario, which is 2 columns and thousand rows. The model's items consist of QStrings (first column contains a sentence, the second contains its translation).

    Now I have decided to include more items from the xml files, such as attributes. This means, for each record (columns 1 and 2) I have to find a way to populate the model with a QMap with attribute names and values for this record, and present them somehow (probably in a widget using QDataWidgetMapper). I don't think this is possible with the QStandardItemModel I have selected, and that I have to either create a custom model or switch to QsqlRelationalTableModel, but if there's any way to do that with the current approach I've followed I'll be glad to know.

    I would appreciate any advice or recommendation.

    Thanks.

    1 Reply Last reply
    0

    1/1

    31 Jul 2012, 11:49

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved