Results 1 to 16 of 16

Thread: Scrolling tableview and updating via QThread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: Scrolling tableview and updating via QThread

    Yes, it is wrong, especially because the signal is emitted 1000 times/second ( this means 1000 events posted each second in the GUI event handler ).

    I really don't know how to see if an item is visible, but you should take a look at the implementation of QTableView::scrollTo(). This should give you an idea.

    Once you solve this, you solve your problem.


    BTW: you shouldn't modify the model in the worker thread. Instead emit a signal with a structure with the data that need to be inserted.

  2. #2
    Join Date
    May 2007
    Posts
    301
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    46
    Thanked 3 Times in 3 Posts

    Default Re: Scrolling tableview and updating via QThread

    Thanks again,

    It is the scrollto function which seems to take ages, but I know of no other way of making sure the last item inserted is visible...

    I put all this stuff into a timer and it works fine, I guess for what I am trying to do, the timer event is the better option.

    Thanks for all your help

    Steve

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.