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

How to get selected header label from QTableWidget item?

I have a QTableWidget item. I fill this item with pandas DataFrame data. I must print selected column values as a report. I can easily print data from DataFrame. However, I need to know verticalHeader (QTableWidget) labels to get data from…
Ugurcan
  • 366
  • 1
  • 4
  • 17
4
votes
1 answer

what is horizontalHeaderItem

I was following some examples to build QTableWidget with buttons inside cells and there was a suggestion to use QTableWidget.horizontalHeaderItem. Now, this works great but with it I am unable to get item back from specific row/column (as…
tmdag
  • 531
  • 6
  • 17
4
votes
1 answer

getting values of table view headers

I'm not able to access to the values of the headers of a table widget. I'm able to set them like: self.table_widget.setHorizontalHeaderLabels(words) I've tried all the methods of header view object without any positive result. Printing the header…
Manuel Zompetta
  • 394
  • 4
  • 17
4
votes
1 answer

How to move from a QTableWidget to the next widget using the tab-key

I want to know how to move from a table-widget to the next widget when I press the tab key in PyQt. The current widget sequence is composed of line-edit > combo-box > table-widget > push-button. In the line-edit, when you press the tab key in the…
정병철
  • 51
  • 1
  • 2
4
votes
2 answers

PyQt: remove blank space in QTableWidget

I would like to remove the blank space that there is in the table I put in my layout: I would like to have something like this: This is my code: import sys from PyQt4 import QtGui from PyQt4.QtGui import * from PyQt4.QtSql import * from…
BossShell
  • 379
  • 3
  • 14
4
votes
1 answer

Select QTableWidget rows only by clicking row header

I have a QTableWidget. I have set its selection behaviour with myTableWidget.setSelectionBehaviour(QTableWidget.SelectRows) Now I can select rows by clicking the cells of the table. But I want to be able to select rows only by clicking the vertical…
okorkut
  • 491
  • 2
  • 12
4
votes
1 answer

How can I get the selected row's value of a qtablewidget in PyQt?

I am working on a small library application. I am getting data from an excel sheet. And then sent to qtablewidget. A B C 1 a1 b1 c1 2 a2 b2 c2 3 a3 b3 c3 I want to get the selected row values as a list. row1 = [a1.value, a2.value,…
aoyilmaz
  • 139
  • 1
  • 10
4
votes
2 answers

QHeaderView has no horizontal lines in Windows 10

QTableWidget headers have no horizontal lines in Windows 10. How can I fix it?
Ufx
  • 2,595
  • 12
  • 44
  • 83
4
votes
1 answer

QTableWidgetItem set hidden data

Given a QTableWidget, is there a way to set an "hidden" value for a cell (QTableWidgetItem), different from the displayed value? For example, my cell should show "Item 1" text, but double clicking on it the editing should be only on the value 1,…
ABCplus
  • 3,981
  • 3
  • 27
  • 43
4
votes
1 answer

How to update QTableWidget?

My objective is to update the QTableQidget when new contacts are added. I have no problem adding the contacts or them showing up in the QTableWidget. My problem is that I have to exit out the program and then start it up again in order to see the…
irunintotrees
  • 45
  • 1
  • 1
  • 3
4
votes
1 answer

QTableWidget and QHeaderView CSS

I cant find a way to theme the top left side of a QHeaderView. Maybe its part of QTableWidget, I cant tell... Example: https://i.stack.imgur.com/h2hq2.png History { background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0…
user1441947
  • 63
  • 1
  • 7
4
votes
2 answers

QTableWidget. Emit cellChanged signal

There is QTableWidget. I need to send cellChanged signal with row column and text. How can I do this? -- I have already connected signal with slot. I need to send signal.
Ufx
  • 2,595
  • 12
  • 44
  • 83
4
votes
1 answer

Change table columns width on resizing window or splitter

Consider there is a QTablWidget and a QTextEdit. Both of them are in a horisontal QSplitte. Let the QTable widget has 2 columns. The problem is to resize the table columns' width as you do resize operation by moving the splitter with mouse. Are…
Narek
  • 38,779
  • 79
  • 233
  • 389
4
votes
2 answers

QTableWidget headers not displaying

I use the UI editor to create a QTableWidget. MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); populateFilesTable(); connect(ui->browseButton, SIGNAL(clicked()), this,…
sark9012
  • 5,485
  • 18
  • 61
  • 99
4
votes
3 answers

How to detect the row and column number of cellwidget user clicked on QTableWidget in PyQt4?

My objective is to set multiple QPushButton as cellwidget in a QTableWidget and whenever the user click on any of those buttons, it will print out the Row and Column number of table it is in. So, for 1 QPushButton, import sys from PyQt4 import…
Chris Aung
  • 9,152
  • 33
  • 82
  • 127