Results 1 to 2 of 2

Thread: Removing items from qtreeview

  1. #1
    Join Date
    Feb 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Removing items from qtreeview

    Hi Everyone,

    I was wondering if anyone know what the correct/best way to deselect items inside of a qtreeview is ? I'm using pyqt and am trying to do something like this but it doesn't seem to be doing anything

    selectionModel = self.selectionModel()
    selectionModel.select(itemToDeselect, QtGui.QItemSelectionModel.deselect)

    after doing this the item is still selected in the gui but if I do
    selectionModel.isSelected(itemToDeselect)

    then it returns False.

    Any ideas/suggestions would be greatly appreciated

    thanks
    babak

  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: Removing items from qtreeview

    Could you check if selectionChanged () is emitted from the selection model after you do what you described?

Similar Threads

  1. QTreeView and expandable items
    By SiLiZiUMM in forum Qt Programming
    Replies: 6
    Last Post: 29th April 2008, 13:21
  2. removing model Items
    By gyre in forum Newbie
    Replies: 2
    Last Post: 25th November 2007, 20:10
  3. Edit items on QTreeView + QDirModel
    By junior0007 in forum Qt Programming
    Replies: 4
    Last Post: 23rd November 2007, 07:16
  4. How to update scene after removing items
    By nileshsince1980 in forum Qt Programming
    Replies: 4
    Last Post: 20th September 2007, 09:56
  5. Drag & drop items on the same QTreeView
    By wind in forum Qt Programming
    Replies: 2
    Last Post: 11th October 2006, 14:29

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.