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.
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.8k 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 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
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on 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
      1
      • VRoninV VRonin

        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 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
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on 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
          1
          • VRoninV VRonin

            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 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

            • Login

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