Results 1 to 2 of 2

Thread: Question about custom view (or custom delegate)

  1. #1
    Join Date
    Oct 2007
    Posts
    65
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Question about custom view (or custom delegate)

    Hello,
    I need to create an editor table and i would like to hear your suggestions because i am not sure what could be the best method to get it done.

    I have an sql model with a QTableView that i have to maintain like an alternate method to input data to the database so i will make the model for the new view a QAbstractProxyModel subclass so the two views get updated with the model, i have done this before without problem but never i needed a view like that.

    Original SQL Model has this columns.
    barcode | supplier code | description | size | units | price | total | date

    And i need to get an editor like this:
    Qt Code:
    1. barcode | supplier code | description | price | total price
    2. 15831500 090123-543 blue t-shirt 25$ 275$
    3. | Date | XXL | XL | L | M | S | TOTAL
    4. 2009-11-15 1 1 2 2 1 7
    5. | Date | XXL | XL | L | M | S | TOTAL
    6. 2009-12-01 0 2 1 1 0 4
    To copy to clipboard, switch view to plain text mode 

    It seems like a QTreeView but the columns of parent and children are not in sync, and the children of other root items will not have the same number of size columns, i have thought make it a big column and add the headers in the cell with delegate paint method but then to me it does not seems like a treeview no more. I am sure will be much better ways to do that, any ideas please?

    Regards,
    Miguel Angel.

  2. #2
    Join Date
    Oct 2007
    Posts
    65
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Question about custom view (or custom delegate)

    please nobody has a better suggestion or a confirmation of what i am thinking it is a correct way?

Similar Threads

  1. Model / View - Design Question
    By antarctic in forum Qt Programming
    Replies: 8
    Last Post: 8th June 2009, 07:39
  2. Custom tree view suggestions
    By jtourville in forum Qt Programming
    Replies: 2
    Last Post: 7th May 2009, 02:23
  3. Painting a CC_ToolButton in a custom delegate
    By victor.fernandez in forum Qt Programming
    Replies: 2
    Last Post: 17th October 2008, 12:11
  4. setSelection() in custom view
    By krudio in forum Qt Programming
    Replies: 13
    Last Post: 6th February 2008, 20:03
  5. Replies: 1
    Last Post: 13th July 2006, 21:10

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.