Results 1 to 2 of 2

Thread: QUndoCommand with QFileSystemModel

  1. #1
    Join Date
    Dec 2014
    Posts
    49
    Thanks
    6
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5 PyQt3 PyQt4
    Platforms
    Windows

    Default QUndoCommand with QFileSystemModel

    I am currently using a QTreeView with a QFileSystemModel, and also a QListView with a second QFileSystemModel. QListView handles QTreeView selectionChanged signal, and updates the QListView appropriately. I want to extend this using a QUndoCommand, so that i can undo/redo selection. I currently have it working, but if i change to a child directory in the QTreeView, when i redo selection in the QListView, it crashes.

    Is there any examples of this working ?

    if not, i can post code if someone can help.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QUndoCommand with QFileSystemModel

    Since you haven't posted any code my guess is that changing the child directory in the tree view changes the base directory of the list view and your might have forgotten to clear the undo stack, so redo executes a selection change that was for a different model content.

    Cheers,
    _

Similar Threads

  1. QFileSystemModel and QML
    By enrico5th in forum Qt Quick
    Replies: 5
    Last Post: 18th June 2014, 15:23
  2. QUndoCommand and QGraphicsTextItem
    By airglide in forum Qt Programming
    Replies: 2
    Last Post: 17th December 2012, 20:23
  3. Replies: 4
    Last Post: 8th March 2012, 04:19
  4. Replies: 0
    Last Post: 3rd August 2010, 11:47
  5. Help with QFileSystemModel
    By TheShow in forum Qt Programming
    Replies: 4
    Last Post: 5th January 2010, 20:11

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.