Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Slow Scroll on QTableView after inserting 800 Rows and 27 Column.
QtWS25 Last Chance

Slow Scroll on QTableView after inserting 800 Rows and 27 Column.

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TobbY
    wrote on 23 Jan 2018, 11:05 last edited by
    #1

    i Have added one time 800 rows and 27 columns. But scrolling through table is slow. please help.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 23 Jan 2018, 11:08 last edited by
      #2

      This smells a lot like a problem in either the model or the delegate. What are you using?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      T 1 Reply Last reply 23 Jan 2018, 11:10
      1
      • V VRonin
        23 Jan 2018, 11:08

        This smells a lot like a problem in either the model or the delegate. What are you using?

        T Offline
        T Offline
        TobbY
        wrote on 23 Jan 2018, 11:10 last edited by
        #3

        @VRonin I am not using any delegate. only Displaying data using custom model. but i have already added data to model.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          VRonin
          wrote on 23 Jan 2018, 13:44 last edited by VRonin
          #4

          Can you post the code for your custom model?

          Also, can you try with:

          QAbstractItemModel* model = new QStandardItemModel(this);
          model->insertColumns(0,27);
          model->insertRows(0,800);
          for(int i=0;i<800;++i){
          for(int j=0;j<27;++j)
          model->setData(model->index(i,j),QString::number(i) + ','+ QString::number(j));
          }
          

          and see if that's fast enough for you?

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          T 1 Reply Last reply 25 Jan 2018, 10:17
          1
          • V VRonin
            23 Jan 2018, 13:44

            Can you post the code for your custom model?

            Also, can you try with:

            QAbstractItemModel* model = new QStandardItemModel(this);
            model->insertColumns(0,27);
            model->insertRows(0,800);
            for(int i=0;i<800;++i){
            for(int j=0;j<27;++j)
            model->setData(model->index(i,j),QString::number(i) + ','+ QString::number(j));
            }
            

            and see if that's fast enough for you?

            T Offline
            T Offline
            TobbY
            wrote on 25 Jan 2018, 10:17 last edited by
            #5

            @VRonin Now it is solved . problem is in data(const QModelIndex &index, int role = Qt::DisplayRole) function. Thanks for helping.

            1 Reply Last reply
            0

            3/5

            23 Jan 2018, 11:10

            • Login

            • Login or register to search.
            3 out of 5
            • First post
              3/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved