Results 1 to 3 of 3

Thread: removing model Items

  1. #1
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question removing model Items

    Hi people...
    I gotta a little mistake somwhere when removing a model items...but wasnt able to figure out where...Im trying to remove selected rows from my model when they are selected...
    But cant manage to do so ...Maybe Im just doing simple mistake or something but have spent so much time on this that I dont know any more ...
    Im attaching some codes...Model and Widget...problem is with the removeRows and removing of selected rows...When I sleect them and push the button to remove not all of them get removed...PLS help
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: removing model Items

    You should remove the rows in reverse order. Imagine that you remove rows 0 and 1. Now, if you start by removing row 0, the next row to be removed is no more at index 1 but at index 0.
    J-P Nurmi

  3. #3
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: removing model Items

    Problem solved
    Last edited by gyre; 25th November 2007 at 20:38. Reason: problem solved

Similar Threads

  1. How to update scene after removing items
    By nileshsince1980 in forum Qt Programming
    Replies: 4
    Last Post: 20th September 2007, 09:56
  2. Moving items within a model
    By iswm in forum Qt Programming
    Replies: 1
    Last Post: 11th April 2007, 08:29
  3. Removing items from QPtrList efficiency issues
    By kalos80 in forum Qt Programming
    Replies: 1
    Last Post: 5th April 2007, 12:04
  4. Removing items properly from qtreewidget item
    By Djony in forum Qt Programming
    Replies: 6
    Last Post: 21st November 2006, 12:20
  5. Limitation when adding more than 256 items to a model
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 25th May 2006, 15:26

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.