Results 1 to 4 of 4

Thread: QTableView 2 rows inside every row

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

    Angry QTableView 2 rows inside every row

    Hello,
    i need to create a tableview where in every row you can see an information for
    the complete row but later to define the units for every size make a division
    inside the row, like this:

    Qt Code:
    1. Header: Model | Description | Price | Size / Qty
    2. ROW: 15415 | Beautiful Shoes | 15.50 | 9.5 10 9
    3. SAME ROW: | | | 5 3 0
    To copy to clipboard, switch view to plain text mode 

    I dont know how represent this exactly with chars but i think you can see the
    idea, the row should have a height bigger than normal to contain the division
    and the columns Model, Description and Price should be Center aligned in the
    row. The size should be header like but i suppose i can get the effect simply
    changing the colors.

    What would be the better way to do this with qt? Thanks.

    Regards,
    Miguel Angel.

  2. #2
    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: QTableView 2 rows inside every row

    Looks like you want a QTreeView and a model that returns the secondary row information as a row with a parent pointing at the primary row. Certainly where I'd start to look.

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView 2 rows inside every row

    Ya probably you could opt for QTreeView as said above.
    Or you can choose delegates. You will need to draw yourself, and you can divide the area as you like

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

    Smile Re: QTableView 2 rows inside every row

    I would like to see all in the same row, i will try with delegates and if i dont get the result i want i will try with treeview, thanks to both for the suggestions.

Similar Threads

  1. Set height of QTableView to fit exact number of rows.
    By Ben.Hines in forum Qt Programming
    Replies: 3
    Last Post: 17th January 2019, 01:49
  2. Remove selected rows from a QTableView
    By niko in forum Qt Programming
    Replies: 4
    Last Post: 3rd March 2016, 12:49
  3. QTableView has constant number of rows
    By tomeks in forum Qt Programming
    Replies: 5
    Last Post: 10th December 2008, 15:29
  4. iterating selected rows in a qtableview
    By JeanC in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2008, 14:29
  5. QTableView number of rows and scrollbar issue
    By jnk5y in forum Qt Programming
    Replies: 3
    Last Post: 1st March 2006, 06:55

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.