Results 1 to 2 of 2

Thread: How to get Current index value in QlistView

  1. #1
    Join Date
    Apr 2013
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Post How to get Current index value in QlistView

    Hi,

    I am using Qlistview to show some item, how to get the current selected index when i press up or down arrow ?..

    Now i am getting the value when the cursor is focus on second item i get the index value of first item. how can i get the current selected index

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to get Current index value in QlistView

    You mean current index or selected index? Those are not the same. You can access both via QItemSelectionModel and in addition to that QAbstractItemView::currentIndex() returns the current index.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QListView current row index?
    By noborder in forum Newbie
    Replies: 1
    Last Post: 3rd February 2013, 18:21
  2. How to get current focus index in QML ???
    By duc_bkav in forum Qt Programming
    Replies: 0
    Last Post: 25th November 2011, 04:28
  3. Replies: 3
    Last Post: 11th August 2010, 13:47
  4. Connect button and pass QListView current index
    By been_1990 in forum Qt Programming
    Replies: 3
    Last Post: 30th November 2009, 16:20
  5. How to get current row(column) index in the QTextTable?
    By denny.t in forum Qt Programming
    Replies: 3
    Last Post: 5th April 2006, 07:53

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.