Results 1 to 4 of 4

Thread: QListView - adding items

  1. #1
    Join Date
    Jul 2010
    Posts
    10
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QListView - adding items

    Hey

    i have a qlistview that supports drops. Every time a drop is entered in the list i need to update some local vars. I have created a slot for that but I can´t figure where to connect it.

    Is there any signal emmited whenever a drop is done?

    or

    Is there any signal emmited whenever a QListView size changes?

    Thanks in advance

  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: QListView - adding items

    Your view don't change, it's your model, so use QAbstractItemView::model() ->QAbstractItemModel::rowsInserted().

  3. The following user says thank you to Lykurg for this useful post:

    creep33 (9th September 2010)

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

    Default Re: QListView - adding items

    Or reimplement QAbstractItemModel::dropMimeData() for your model.
    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.


  5. #4
    Join Date
    Jul 2010
    Posts
    10
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QListView - adding items

    Quote Originally Posted by Lykurg View Post
    Your view don't change, it's your model, so use QAbstractItemView::model() ->QAbstractItemModel::rowsInserted().
    That worked just fine. Thank you.

Similar Threads

  1. Adding QPixmaps to QListView
    By ada10 in forum Newbie
    Replies: 3
    Last Post: 16th August 2010, 13:15
  2. Adding validation to a QListView's edit mode
    By MattT in forum Qt Programming
    Replies: 10
    Last Post: 1st August 2010, 02:53
  3. Modifying QListView items
    By Daniel Salcedo in forum Qt Programming
    Replies: 0
    Last Post: 14th September 2009, 16:59
  4. Removing all items QListView
    By vcp in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2009, 19:55
  5. Adding elements to a QListView
    By Arreis in forum Newbie
    Replies: 4
    Last Post: 30th June 2009, 07:56

Tags for this Thread

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.