Questions tagged [qtablewidget]

QTableWidget is a Qt class providing an item-based table view with a default model.

Table widgets provide standard table display facilities for applications. The items in a QTableWidget are provided by QTableWidgetItem.

If you need to use your own data model, then QTableView is preferrable.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

1192 questions
4
votes
2 answers

Qt widget for displaying large amount of data rows

I am trying to display a large amount of columnar records in a scrollable view using Qt (5.1). The number of rows I would like to be able to browse can vary from 100 million to 1 Billion, say. The QTableWidget with a custom model works a few…
Spacen Jasset
  • 938
  • 2
  • 11
  • 21
4
votes
4 answers

How do I add a header with data to a QTableWidget in Qt?

I'm still learning Qt and I am indebted to the SO community for providing me with great, very timely answers to my Qt questions. Thank you. I'm quite confused on the idea of adding a header to a QTableWidget. What I'd like to do is have a table that…
San Jacinto
  • 8,774
  • 5
  • 43
  • 58
4
votes
2 answers

how to connect rowCountChanged to a slot

here is what i tend to design: when the tablewidget changes(say its rowcount), the label will show the rowcount.But when i tried it, Qtcreator says: Object::connect: No such signal QTableWidget::rowCountChanged(int,int) in…
Fay100
  • 175
  • 1
  • 9
4
votes
1 answer

Display a huge sheet with QTableWidget

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…
VGO
  • 2,161
  • 2
  • 17
  • 14
4
votes
1 answer

Inserting data from sqlite database to QTableWidget using PyQt in Python

I want to insert my data which is stored in a sqlite table, to a QTableWidget. I use two for loop to find the data and index. after each iteration I print the data in console and it is OK but when it displays the table widget there is only the first…
Amir
  • 486
  • 3
  • 10
  • 17
4
votes
2 answers

QTableWidget : personal widget as header?

What is the easiest way (without subclassing QTableWidget if possible) to put a personnal Widget (which is a group of QPixmap + QLabel + QComboBox in my case) as headers in a QTableWidget ? It is relatively easy to do it for the array content as we…
Vincent
  • 57,703
  • 61
  • 205
  • 388
3
votes
1 answer

QTableWidget with stylesheet don’t scroll items

In the following code there are two stylesheets: problemStylesheet and okStylesheet. Everything works fine when I’m using okStylesheet for QTableWidget. Labels are scrolling. Problem is that labels are not scrolling if I use problemStylesheet. What…
teapot_of_wine
  • 516
  • 3
  • 18
3
votes
2 answers

How to implement Excel-like filter mechanism on QTableWidget?

Can anybody give me some idea to create a filter mechanism (as available in Microsoft Excel) on QTableWidget? Whenever I click on a column name, I want the header filter mechanism to automatically activate for that table. I'm building on…
lekhraj
  • 111
  • 2
  • 4
  • 7
3
votes
2 answers

How can i set labels of QHeaderView in PyQt?

In Pyqt, I am trying to make the QHeaderView of a QTableWidget respond to right mouse clicks. I have subclassed QHeaderView and i have overloaded the mousePressEvent. Then i can set it as as the header of my custom QTableWidget, the DataTable class.…
Davide
  • 1,415
  • 2
  • 11
  • 13
3
votes
1 answer

QTableWidget Horizontal Header CSS

I'm trying to style a QTableWidget using the latest Qt SDK (4.7.4). From Googling, I've seen that I need to do something like this: QHeaderView::section { background: red; /* ... */ } Inside of Qt Designer, this produces red headers for the…
user_123abc
  • 224
  • 2
  • 10
3
votes
2 answers

How to disable QTableWidget scrolling to selected cell?

Currently, if the user clicks on a cell that is only partially visible, the window automatically scrolls over so that the cell is fully displayed. Is there any way to stop the table doing this? Thanks
cindyln
  • 33
  • 1
  • 3
3
votes
2 answers

How to prevent too aggressive text elide in QTableview?

I have an issue with text elide in Qt being too aggressive in a table, see picture. The cell with the full figure 0.8888.... I've edited since the QTableWidget was shown, the others are are as the were when the QTableWidget was created. It seems…
user2052153
  • 129
  • 10
3
votes
1 answer

How to make a menu bar used in filter in qtablewidget be scrollable in pyqt5?

I am really new to pyqt and this question maybe silly. Any help, I would really appreciate. I have this code I get from this page where it codes in filtering a qtablewidget. This code works perfectly fine to my desired filtering output. However I…
3
votes
1 answer

I want just the first column to be clickable in QTableWidget using pyqt5

I have QTableWidget with 2 columns. I want just the first column clickable or selectable, other column should not be. In below example, I just want Session Column to be clickable, not the Archive Object Column def _populateJobTW(self): …
sls9472
  • 53
  • 2
3
votes
1 answer

Is it possible to show the right side of a string first in an overfilled QTableWidgetItem?

The user is prompted with a file dialog and chooses a full path which is then put inside a QTableWidgetItem cell within a parent QTableWidget. Currently, when there is an overflow of text in the item and what it can display, it will show the left…
Mets_CS11
  • 99
  • 1
  • 9