Results 1 to 10 of 10

Thread: QTableView - scroll performance changed from 4.0 to 4.1 and 4.2

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2006
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView - scroll performance changed from 4.0 to 4.1 and 4.2

    Yes, you are surely right. Actualy i'm using 20x10 widgets, just to fill screen. Then i'm reusing them somehow. Simply i needed to have all widgets ready for edit and they are more complicated in real. Imagine some stock monitoring application with progress bars and custom designed widgets to edit and monitor courses. Probably "not focuesd ones" i should just paint. But anyway i have to solve my transfer to 4.2 from 4.0. And in 4.0 scroll was not a problem at all. So what changed here in the meantime? Is there another way out than change in design? Of course, to stay with 4.0 is not the answer.
    Thanks again!
    B.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: QTableView - scroll performance changed from 4.0 to 4.1 and 4.2

    Probably something was optimised or fixed, but as you are using the framework in a very... emmm... uncommon way the probably that optimisation turned out to be a slowdown for you or you might have been benefiting from a bug and when the bug was fixed the benefit vanished.

    Maybe you should use a QScrollArea filled with widgets instead of a table view?

  3. #3
    Join Date
    Nov 2006
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView - scroll performance changed from 4.0 to 4.1 and 4.2

    Please, tell me how one can easily paint widget which contains 3-4 other widgets to item in TableView. Simply i need these features of TableView as resizing columns, hiding columns. That's why i'm using table.

    Attached is the picture of what i've got and need. How this can be done more optimized way?
    Thanks a lot!
    B.
    Attached Images Attached Images

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: QTableView - scroll performance changed from 4.0 to 4.1 and 4.2

    Quote Originally Posted by budul View Post
    Please, tell me how one can easily paint widget which contains 3-4 other widgets to item in TableView.
    Create a custom widget with the other widgets inside it (in a layout) and then use QAbstractItemView::setIndexWidget() to set the widget. If you need the widget to be able to edit the data inside the model then set it as an editor instead.

  5. #5
    Join Date
    Nov 2006
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView - scroll performance changed from 4.0 to 4.1 and 4.2

    That's exactly what i'm doing, but via delegate. But my problem is that even if i set 20x10 widgets to the table i've got very poor performance. How can i create table with 20x10 custom widgets and will have good response from the GUI in 4.2?

    I really can't have just text in the cells. :-(

    Thanks again.
    B.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: QTableView - scroll performance changed from 4.0 to 4.1 and 4.2

    Each subsequent permanent editor takes longer to add to the view, so you might want to avoid those. Using index widgets should be faster as they are not updated by the view.

    In your case maybe it would be best to get rid of the view and just emulate the columns by using a QHeaderView and a custom layout (you would probably need to implement an own grid layout, but it shouldn't be too hard).

  7. #7
    Join Date
    Nov 2006
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableView - scroll performance changed from 4.0 to 4.1 and 4.2

    Solution which works much better with 4.2 is to leave QTableWidget as Wysota advised. So QHeaderView + QGridLayout in QScrollArea works fine for horizonatl scrolling now. It is different with resizing columns (as table does) and hiding columns. It's not so fast as before and as one can see with use of QSplitter, but it's not big deal for me. Thanks anyway.

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.