Results 1 to 3 of 3

Thread: How to get row number from tableView

  1. #1
    Join Date
    Mar 2009
    Location
    Nashville Tn.
    Posts
    53
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to get row number from tableView

    when user moves to new position in tableView via mouse or keyboard how do you get the current row number ?


    something like thisrow= (tableView->currentRow().toint); //

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get row number from tableView

    try this
    Qt Code:
    1. ...
    2. int row = tableView->currentIndex().row();
    3. ...
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Mar 2009
    Location
    Nashville Tn.
    Posts
    53
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to get row number from tableView

    Thank You Spirit, I tried every thing but that !!

Similar Threads

  1. Apparent error in QtCore/quuid.h
    By cwp500 in forum Qt Programming
    Replies: 11
    Last Post: 18th December 2008, 20:51
  2. defining number
    By mickey in forum General Programming
    Replies: 1
    Last Post: 1st February 2008, 06:19
  3. Line Number - QTextEdit...???
    By deepusrp in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2007, 16:34
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. get error number from qsqldatabase
    By mandal in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2007, 10:20

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.