Results 1 to 7 of 7

Thread: Advice on what is best to use when displaying lots of numerical data

  1. #1
    Join Date
    May 2011
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Advice on what is best to use when displaying lots of numerical data

    Hi,
    I'm recently new to QT - and want some advice about displaying lots of numerical data.

    I'm attempting to write a front end to my trading application, the requirements are that it would need to display about 100 rows each with 50 columns of data - where about 5 columns in each row might be changing fairly rapidly. I also want some columns displaying as checkboxes instead of data, and maybe some columns as drop downs. Some columns would be read-only, while others would be read/write - and after changing a value I need to detect which row/column has changed.

    What I am currently thinking is start with either a QTableView, QTreeView or a QTreeWidget. QTableView and QTreeView seems to be better at displaying row data (compared to QTreeWidget) - but I'd have to add my own code to do checkboxes/drop downs etc

    Performance is something I also need to consider - I might potentially want to expand it to display 1000's of rows.

    I've been playing around with all three of the above - QTreeWidget can do checkboxes, but manipulating the data is a bit trickier.

    Or is there a better way(s)?

    Any advice/options would be welcome.
    Last edited by Drew; 13th May 2011 at 10:05.

  2. #2
    Join Date
    May 2011
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Advice on what is best to use when displaying lots of numerical data

    Surely someone must have an option? Help a new guy out

  3. #3
    Join Date
    Apr 2011
    Posts
    124
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Advice on what is best to use when displaying lots of numerical data

    Only you understand your requirements. There are a dozen different techniques that could be made to work, some easy, some not so. Some (sort of) fast, some slow. Some that will be pleasing to the eye, many that won't.

    You'll have to try several techniques and see what works for you.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Advice on what is best to use when displaying lots of numerical data

    QTableView (it is tabular data after all) and a model that supplies your data. You can control read/write ability with the flags method. Checkboxes using the relevant role in the data() call. The model knows when the user changes a value because setData() has to store it. A custom editor for a column can be done with a delegate and QComboBox etc.

    The precise details of the solution are up to you and your customer.

  5. The following user says thank you to ChrisW67 for this useful post:

    Drew (16th May 2011)

  6. #5
    Join Date
    May 2011
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Advice on what is best to use when displaying lots of numerical data

    Thanks Dan - that's a fair call. I suppose what I'm interested in hearing is about any of these dozen different techniques - especially those that don't use any of the things I've mentioned in the OP. Currently I'm learning towards using a QTableView or QTreeView - just want to beware of any potential gotcha's.

    If anyone's used had experience displaying large datasets and had success/problems - I'd be interested to hear their learnings (ie would they recommend it or if they were going to do it again, would they do it differently).

    Cheers

    [Edit] - Thanks also Chris - I was posted this and then saw your response

  7. #6
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Advice on what is best to use when displaying lots of numerical data

    Putting thousands of user interface widgets on display is almost certainly not going to perform well, particularly if many of them are receiving updates rapidly. You may be better off simply painting a grid yourself. If the checkboxes are for display only (not interactive) this would be fast and trivial - just reuse a check image over and over, along with a blank or unchecked image. If you need interactivity, that would take a little more work - but not very much, as it's just a matter of capturing mouse clicks and resolving them to a given rectangular area. This will almost certainly give you the best performance.

    But as others have said, it's really impossible to provide any guidance without more specific requirements.

  8. #7
    Join Date
    Apr 2011
    Posts
    124
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: Advice on what is best to use when displaying lots of numerical data

    Thousands of data points are better displayed as some sort of graph. I've seen many implementations where details about any particular data point are displayed in a pop-up when you hover the cursor over a point in the graph, eg, if you need to provide access to the detailed data.

    It would also help to know whether you're talking phone (I hope not) or desktop.

Similar Threads

  1. displaying data
    By willief in forum Newbie
    Replies: 4
    Last Post: 10th March 2011, 06:33
  2. Replies: 9
    Last Post: 30th July 2010, 09:13
  3. Reading lots of Data from QProcess without freezing
    By nightghost in forum Qt Programming
    Replies: 12
    Last Post: 27th January 2010, 08:23
  4. Best way to display lots of data fast
    By New2QT in forum Newbie
    Replies: 4
    Last Post: 16th October 2008, 22:46
  5. Displaying data in QTable
    By raghvendramisra in forum Qt Tools
    Replies: 1
    Last Post: 6th September 2007, 12:48

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.