Results 1 to 6 of 6

Thread: Access from Delegate to Model

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Access from Delegate to Model

    The index returns a pointer to the model. Your cast is incorrect, should be:
    Qt Code:
    1. SchulungsplanModel* model = qobject_cast<SchulingspanModel*>(index.model());
    To copy to clipboard, switch view to plain text mode 

  2. The following 2 users say thank you to wysota for this useful post:

    bunjee (22nd April 2008), starcontrol (11th April 2008)

Similar Threads

  1. QAbstractItemModel with QUndoStack
    By No-Nonsense in forum Qt Programming
    Replies: 7
    Last Post: 28th October 2012, 17:15
  2. hierarchical model in a flat view
    By gniking in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2009, 20:17
  3. Coin3d + Qt: SIGLNALs and SLOTs
    By vonCZ in forum Newbie
    Replies: 26
    Last Post: 15th May 2009, 07:34
  4. Model View - Delegate - setIndexWidget
    By starcontrol in forum Qt Programming
    Replies: 16
    Last Post: 2nd April 2008, 14:30
  5. Model Choices review/questions
    By ucntcme in forum Qt Programming
    Replies: 1
    Last Post: 16th September 2007, 21:57

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
  •  
Qt is a trademark of The Qt Company.