Results 1 to 2 of 2

Thread: Qtableviews question

  1. #1
    Join Date
    Oct 2024
    Posts
    1
    Qt products
    PyQt3 PyQt4
    Platforms
    Unix/X11

    Default Qtableviews question

    Hello,

    I have a Qtableview that's 10 rows, ten columns. I am selecting by rows. How can I have a button that prints out the value of a cell from the row I'm selecting, in a specific column? I know that for a qtablewidget it's something like model.item(), but it doesn't work with Qtableview.
    Any advice?

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    516
    Thanks
    12
    Thanked 77 Times in 75 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qtableviews question

    Hi, there's QAbstractItemView::model() that you can use to get the model, and then use the index() and data() function of the model to get the content of the desired cell.

    Ginsengelf

Similar Threads

  1. Replies: 2
    Last Post: 6th July 2021, 04:31
  2. 2 QTableViews data
    By guidupas in forum Qt Programming
    Replies: 0
    Last Post: 30th April 2014, 21:26
  3. Drag&Drop between QTableViews
    By Babi07 in forum Qt Programming
    Replies: 0
    Last Post: 9th November 2012, 16:56
  4. Linking of 2 QTableViews
    By Taxi in forum Newbie
    Replies: 6
    Last Post: 4th October 2011, 10:32
  5. Match Height between 2 Adjoining QTableViews
    By ChrisW67 in forum Qt Programming
    Replies: 0
    Last Post: 14th April 2009, 04:52

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.