Results 1 to 14 of 14

Thread: Help with Model View

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Location
    France
    Posts
    34
    Thanks
    12
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Thumbs up Re: Help with Model View

    Quote Originally Posted by wysota View Post
    You could get rid of those two methods you know... Each model index can contain an internalPointer() or internalId() that you can tie to your datastructure. Then you can just query for that value and access your node directly.
    I really doubted it could work.
    Because, when we use "createIndex" we do it like this:
    Qt Code:
    1. self.createIndex(row, column, id(node))
    To copy to clipboard, switch view to plain text mode 

    Where 'id' is a built in function, that return a unique number of the object (quiet like a pointer in C++). From the python documentation: This is an integer (or long integer) which is guaranteed to be unique and constant for this object during its lifetime

    But in Python, we always use reference on object, and there is (as far as I know) no way to get the object when you have his address in memory (nor his 'id').

    That why I have to create my own methods.

    But I've tested your method, and it work just great
    Thanks to you
    Last edited by weepdoo; 11th October 2007 at 14:00.

Similar Threads

  1. hierarchical model in a flat view
    By gniking in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2009, 20:17
  2. Model, View and Proxy
    By No-Nonsense in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2006, 08:50
  3. Should I develop my own model and view?
    By dandanch in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2006, 06:09
  4. Model - View Programming doubt.
    By munna in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2006, 13:01
  5. Replies: 6
    Last Post: 20th April 2006, 10:23

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.