Results 1 to 6 of 6

Thread: Model/View Performance

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2015
    Posts
    3
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Model/View Performance

    Thank you wysota for your reply!
    If I started with this project I read a lot about MVC and the Qt models. I thought that it would be very complex to implement my own model based on QAbtractItemModel.
    And I wasn't sure if this will be really necessary. So for the first step I decided to use QStandardItemModel and expand it with my needed functionality. And everything works fine except the above written performance problem.
    Do you think I can fix the problem by deriving from QAbstractItemModel?
    Is there a good tutorial on how to do this? (I've found a link to a tutorial on this forum but I get an 404 Error...: http://doc.qt.io/qt-5/itemviews-simpletreemodel.html)
    On which point do I have to ensure that I will not run to same trouble as I get with QStandardItemModel?
    Is it only a problem of the model or also the view?
    Is there no other QStandardItemModel based solution?

    Thank you for your help!!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Model/View Performance

    Quote Originally Posted by Stevildo View Post
    Do you think I can fix the problem by deriving from QAbstractItemModel?
    I cannot guarantee that but there is a good chance you will get decent performance boost if you implement the model properly.

    Is there a good tutorial on how to do this? (I've found a link to a tutorial on this forum but I get an 404 Error...: http://doc.qt.io/qt-5/itemviews-simpletreemodel.html)
    Following a tutorial will not do you much good. A good model has to be tailored to the data it holds. If you follow a tutorial your model will be suited for data presented in the tutorial. You have to first understand what you are doing.

    Is it only a problem of the model or also the view?
    You rarely have to touch the view. I'd focus on the model.

    Is there no other QStandardItemModel based solution?
    Without knowing the details of the behaviour of your data I cannot answer that question. Item based models are usually much slower compared to models which directly operate on real data structures and signal changes to the model in a smart way.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 24
    Last Post: 18th September 2013, 06:35
  2. Replies: 4
    Last Post: 18th April 2012, 18:11
  3. Replies: 0
    Last Post: 21st April 2010, 12:23
  4. Replies: 1
    Last Post: 1st February 2010, 18:42
  5. QSql Model-View: How to keep view in sync with model
    By schall_l in forum Qt Programming
    Replies: 1
    Last Post: 22nd December 2008, 23:31

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