Results 1 to 5 of 5

Thread: QTableView: scrollTo() not work

  1. #1
    Join Date
    Jul 2014
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QTableView: scrollTo() not work

    Hi,
    I used the QSortFilterProxyModel as its model, and found in my TableView, the scrollTo() can't work.
    I checked the QT document, it said we can call scrollTo() two times to force scrolling, but it doesn't work.
    Do you have any idea, thanks.

  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: QTableView: scrollTo() not work

    You have to pass the index from QSortFilterProxyModel to scrollTo() and not from your base model.
    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.


  3. #3
    Join Date
    Jul 2014
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTableView: scrollTo() not work

    Hi,

    Yes, I did use the index of QSortFilterProxyModel(), but can't work.

  4. #4
    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: QTableView: scrollTo() not work

    How does "can't work" manifest itself?
    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.


  5. #5
    Join Date
    Jul 2014
    Posts
    23
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTableView: scrollTo() not work

    Hi,

    I know the root cause. It is because I set the cell hidden, so scrollTo() failed.
    Thanks.

Similar Threads

  1. Replies: 0
    Last Post: 12th July 2011, 08:20
  2. Replies: 3
    Last Post: 29th August 2010, 15:18
  3. Replies: 2
    Last Post: 13th December 2009, 20:27
  4. SQLITE QTableView scrollTo problem
    By vogeljh in forum Newbie
    Replies: 7
    Last Post: 16th April 2008, 19:45
  5. make QTableView work as a multi-column list view
    By wesley in forum Qt Programming
    Replies: 1
    Last Post: 11th March 2008, 14:43

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.