Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8417923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:10:38+00:00 2026-06-10T02:10:38+00:00

I need to display data using the PyQt class QTableWidget . But there could

  • 0

I need to display data using the PyQt class QTableWidget. But there could be dozens of thousand lines. Displaying the whole sheet makes the appli to hang…

So I found a solution consisting on loading data (meaning that the sheet is created) but hidding most of the rows and, when moving the scroll bar, show new rows and hidding previous ones.

In the bellow code, I setted self.rowsShown = 50 and at the init the lines from 1 to 50 are shown. And I previously did self.verticalScrollBar().actionTriggered.connect(self.refreshDisplay).

So the code is:

def refreshDisplay(self):
    """
    This is to refresh the display when the scrollbar is moved
    """

    # Minimum is reached and a previous row exists
    if self.verticalScrollBar().value() <= self.verticalScrollBar().minimum() and self.isRowHidden(self.firstRowShown-1):# Minimum is reached and a previous row exists
        for row in xrange(self.lastRowShown-1, self.lastRowShown):
            self.hideRow(row)
            self.lastRowShown -= 1
        for row in xrange(self.firstRowShown-1, self.firstRowShown):
            self.showRow(row)
            self.firstRowShown -= 1
    # Maximum is reached and a next row exists
    if self.verticalScrollBar().value() >= self.verticalScrollBar().maximum() and self.isRowHidden(self.lastRowShown+1):
        for row in xrange(self.firstRowShown, self.firstRowShown+1):
            self.hideRow(row)
            self.firstRowShown += 1
        for row in xrange(self.lastRowShown, self.lastRowShown+1):
            self.showRow(row)
            self.lastRowShown += 1

This is working very well when I use the roll of the mouse or click on buttons of the scrollbar. But when I grab the slider or use the keypad to move the case selected, I’m blocked in the area shown.

Moreover, the size of the scrolling area correspond to the rows shown only. I would like to redifine it to set my own bar (for example with a size based on the real number of lines), so that I can move fastly to another part of the sheet. But the size of the scroll bar is always updated with the number of lines shown.

So, what I expect from you is to help me to resolve this two issues, OR give me another idea for displaying such huge sheet. Maybe I missed a module or class that already bear this functionnality of loading/showing lines whilemoving the cursor.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:10:40+00:00Added an answer on June 10, 2026 at 2:10 am

    I have written a tool that displays 10^6+ lines in an Excel-like table without resource problems. The solution is to use QTableView and QAbstractTableModel. You have to derive from QAbstractTableModel and implement the necessary functions it requires you to implement (I remember headerData and data, but I think there are more). You then plug the model into your view by doing view.setModel(model). More information how this is done can be found here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to display some data points using google graphs, but unfortunately there is
I have 1000 rows of data but need to only display 100 rows at
For some reason I need to display tabular data in my web application but
how do i display xml data using jquery? i don't need to parse it
I'm using Fusion Charts . I need to display the data in Y as
We have a situation where we need to display data from a database in
I need to be able to display data that I have in 15 minute
I need to display a real time data from MS SQL 2005. I saw
I need to display a large amount of data (around 50-60K rows). I was
I need to display short description like label and near it data associated with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.