Results 1 to 6 of 6

Thread: Count indexes in QListView

  1. #1
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Count indexes in QListView

    The title explains it all. I can't find any function to count my QListView's indexes. Not even for my QFileSystemModel's files amount.How can I do that, am I missing something?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Count indexes in QListView

    Quote Originally Posted by been_1990 View Post
    am I missing something?
    Obviously yes Have a look at QFileSystemModel::rowCount().

  3. #3
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Count indexes in QListView

    Quote Originally Posted by Lykurg View Post
    Obviously yes Have a look at QFileSystemModel::rowCount().
    I did, but it returns 0 even when I have several rows showing on my QListView.

  4. #4
    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: Count indexes in QListView

    How are you calling rowCount ? can we see the code ?
    and what view and model are you using ?

  5. #5
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Count indexes in QListView

    Qt Code:
    1. // ui->QListView
    2. QFileSystemModel alarmDirModel;
    3. alarmDirModel.rowCount()
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Count indexes in QListView

    double post- my bad Internet connections fault
    Last edited by been_1990; 17th December 2009 at 23:57.

Similar Threads

  1. Program running error in qtopia 2.2.0
    By halloworld in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 15th February 2009, 09:23
  2. QListView: How to move the cursor to a specific row
    By muellerp in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2008, 07:29
  3. QListView word wrap
    By serega in forum Qt Programming
    Replies: 17
    Last Post: 30th August 2007, 03:13
  4. QDialog / QListView problem
    By harakiri in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2007, 18:31
  5. Subclass QListView to show two colums in one
    By Mookie in forum Qt Programming
    Replies: 2
    Last Post: 23rd June 2007, 02:12

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.