Results 1 to 3 of 3

Thread: Change QTableView orientation

  1. #1
    Join Date
    May 2010
    Location
    Russia, Moscow
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Change QTableView orientation

    All greetings!

    I have a model of data QAbstractTableModel I connect it to QTableView and all perfectly works. Whether it is possible as that at class QTableView to change property that it showed table heading at the left on a vertical and lines across? That without change of model of the data it was possible to display the table not from top to down and on the right-on the left?
    Thanks.

  2. #2
    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: Change QTableView orientation

    If I guess right, you want to transform the rows to columns and columns to rows ?
    If yes, you can use a proxy model and in data function u can do -
    return baseModel::data(QModelIndex(col,row));

    hope you get what I mean

  3. #3
    Join Date
    May 2010
    Location
    Russia, Moscow
    Posts
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Change QTableView orientation

    Yes, you have correctly understood!

    Then in proxy model in headerData function it is necessary to transform the rows to columns and columns to rows too.

    Thanks!


    Table_orientatio&#110.jpg

Similar Threads

  1. How can I change row heigth in QTableView?
    By Tamara in forum Qt Programming
    Replies: 8
    Last Post: 18th August 2011, 20:41
  2. How to change the order of QTableView Column ?
    By Kode.Cooper in forum Qt Programming
    Replies: 1
    Last Post: 27th January 2010, 08:55
  3. Replies: 2
    Last Post: 26th November 2009, 04:45
  4. Change appearence of selected row in QTableView
    By mourad in forum Qt Programming
    Replies: 5
    Last Post: 4th June 2009, 14:56
  5. how to change text color in QTableView?
    By phillip_Qt in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2008, 10:03

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.