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. [Solved] Best method to Display Data from XML: TableView or ListView or...
QtWS25 Last Chance

[Solved] Best method to Display Data from XML: TableView or ListView or...

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.8k 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.
  • MeerMusikM Offline
    MeerMusikM Offline
    MeerMusik
    wrote on last edited by MeerMusik
    #1

    Hello Forum.

    My little Project will contain some kind of Contact Database which includes different Data (Addresses, eMail Data, Type of Contact, Links etc.). These Type of Data should be categorized in the following way (as it currently stands):

    • Federal State
    • Region
    • City
    • Postal Area Code
    • Name of Contact
    • Type of Contact [multiple Values possible]
    • Addresses
    • eMail [Clicking the eMail Address should be open with mailto:]
    • Weblink [Clicking the Weblink should be opened directly in a already semi-implemented WebView]

    The Data should be:

    • Searchable by the User while selecting one or more specific Categories or simply search for everything

    As I am not familiar with JSON (and I am not sure If JSON can used in the Way I want it], I think I will store those Data either

    • In one Single XML File
    • Or in 1 XML File per Federal State (which will be 16 here in that case)

    It is possible, that more Countrys will be added at a later point.

    I currently play with a QTableView and I think it is very good customizable(?!) for my plans.

    Any Beginner Tips how to approach it and what View I should use in that case, are greatly welcome :)

    Thanks
    Oliver

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rondog
      wrote on last edited by
      #2

      My approach would be a custom widget to display the information from a particular data index and not try to use QTableView for this purpose. You have very specific fields to display. If there are changes to the data you simply need to update your custom widget. If the fields were unknown or random using a QTableView or QTableWidget makes more sense.

      For all the records a QListView or QListWidget (depends on how much data you anticipate on having). If using a QListWidget you can create a custom QListWidgetItem that would display information from its associated record in some way that is easy to visually scan. When an item in the list is selected the contents populate your custom widget for viewing (or editing).

      For the data, if using XML or JSON, (note: SQL database might be the best option in this case) I think it is more important to design your format carefully and consider future additions. There may be advantages of one or the other but I don't think this is as important as how you use make use of any of these options.

      MeerMusikM 1 Reply Last reply
      0
      • R Rondog

        My approach would be a custom widget to display the information from a particular data index and not try to use QTableView for this purpose. You have very specific fields to display. If there are changes to the data you simply need to update your custom widget. If the fields were unknown or random using a QTableView or QTableWidget makes more sense.

        For all the records a QListView or QListWidget (depends on how much data you anticipate on having). If using a QListWidget you can create a custom QListWidgetItem that would display information from its associated record in some way that is easy to visually scan. When an item in the list is selected the contents populate your custom widget for viewing (or editing).

        For the data, if using XML or JSON, (note: SQL database might be the best option in this case) I think it is more important to design your format carefully and consider future additions. There may be advantages of one or the other but I don't think this is as important as how you use make use of any of these options.

        MeerMusikM Offline
        MeerMusikM Offline
        MeerMusik
        wrote on last edited by
        #3

        @Rondog Sorry I simply forgot to answer. Just wanted to say Thanks for your Feedback.

        I decided to use a QTableView. I read the Data from the different XML Files into different QTableViews. The Database Files are read after manually selection. So for now, no Speed Problems. I hope it stays that way, when all Data are edited in.

        Thanks :)
        Oliver

        1 Reply Last reply
        0

        • Login

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