Results 1 to 7 of 7

Thread: Models in cascade

  1. #1
    Join Date
    Jan 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Models in cascade

    This is my first post, so hi to everyone!

    I'm italian, then i first ask to forgive me for my very bad english!

    Now, my problem:

    I'm using Qt model/view paradigm and yesterday I found an error I cannot understand. I have two tree view and a tree model. I use a QSortFilterProxy to re-define the sort criteria for my rows. This criteria are the same for each view. In addiction, I must filter some rows for one of the two views.

    So, I've got this:

    - create a standard tree view
    - create a derived model to store my data -> the Model
    - create a derived sort filter proxy to show my data sorted as i want -> the SortProxy
    - create a derived sort filter proxy to filter some rows for one of my two views -> the FilterProxy

    then, i set my model as source model for my SortProxy, and my SortProxy as source model for my FilterProxy.

    Then, i start my program and populate my model. In the view associated with the FilterProxy, i'm catching a contest menu' request, to show a context menu' with some actions. When I click the right button of my mouse on a child node of this view, the application crash. The call stack shows that the problem was generating from a layoutChanged signal from the Model, I've something like this:

    -->MyModel::layoutChanged
    -->MyFilterProxy::reset
    -->MyFilterProxy::clear
    (...fails in "proxy_to_source"...)

    After two hours of panic, I discovered that the problem derived form proxies in cascade: if a use two different sort filter proxy, one for each view, the problem disappear

    Then, someone knows why I can't use proxies in cascade?

    Thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Models in cascade

    I suggest that you report this to Trolltech's task tracker as it seems to be a rather subtle bug. You can find the task tracker here: http://www.trolltech.com/developer/task-tracker .

    BTW, your English is just fine :-)

  3. #3
    Join Date
    Jan 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Models in cascade

    Quote Originally Posted by e8johan View Post
    I suggest that you report this to Trolltech's task tracker as it seems to be a rather subtle bug. You can find the task tracker here: http://www.trolltech.com/developer/task-tracker .
    Ok, I'll do it as soon as I can

    Quote Originally Posted by e8johan View Post
    BTW, your English is just fine :-)
    Thanks, I hope I'm improving my english writing in forum like this, it's a good exercise, for both my language and my programming skills

  4. #4
    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: Models in cascade

    Is the model a standard model or a custom one?

  5. #5
    Join Date
    Jan 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Models in cascade

    Yes it is: I created my derived model following the example provided with Qt documentation.

    Are you thinking i forgot something when I derived that model?

  6. #6
    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: Models in cascade

    Quote Originally Posted by thrantir View Post
    Yes it is: I created my derived model following the example provided with Qt documentation.

    Are you thinking i forgot something when I derived that model?
    Yes, I think you messed up something with indexes. Could you please post a detailed back trace (call stack)?

  7. #7
    Join Date
    Jan 2007
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Models in cascade

    i've changed mi program to not use proxies in cascade... if i have the time, i'll re-do what i did and post you the backtrace when the error occurs

Similar Threads

  1. Open Cascade + Qt 4.2.2 ???
    By Shuchi Agrawal in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2007, 04:00
  2. integrating Qt files in open cascade?
    By Shuchi Agrawal in forum Qt Tools
    Replies: 5
    Last Post: 9th January 2007, 05:27
  3. Replies: 6
    Last Post: 19th March 2006, 18:41
  4. Replies: 2
    Last Post: 10th March 2006, 20:46
  5. (qt4.1.1 & xp) cascade all problem
    By incapacitant in forum Qt Tools
    Replies: 1
    Last Post: 5th March 2006, 11:24

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.