Results 1 to 2 of 2

Thread: a question regarding models

  1. #1
    Join Date
    Jul 2010
    Posts
    63
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default a question regarding models

    i made a tree model (reimplementing QAbsractItemModel),

    i need to insert already-made-items into it, so i made a different method instead of reimplementing insertRows/removeRows.
    i saw in the documentation an alarming sentence referring to these methods:
    "If you want selections to be handled properly, you must ensure that you call these functions"
    should i rethink my ways?
    Last edited by jajdoo; 29th September 2011 at 21:27.

  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: a question regarding models

    Your methods should call beginInsertRows() and endInsertRows() before and after you modify the internal structures of the 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.


Similar Threads

  1. Questions about models
    By xtal256 in forum Qt Programming
    Replies: 15
    Last Post: 16th August 2011, 02:37
  2. Editable Models
    By MTK358 in forum Newbie
    Replies: 1
    Last Post: 9th September 2010, 19:58
  3. sql models
    By damiano19902 in forum Newbie
    Replies: 1
    Last Post: 4th June 2009, 07:18
  4. Proxy models and slection models
    By amunitz in forum The Model-View Framework
    Replies: 1
    Last Post: 23rd September 2008, 14:35

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.