Questions tagged [qtablewidgetitem]

QTableWidgetItem is a Qt class providing an item for use with the QTableWidget class.

Table items are used to hold pieces of information for table widgets. Items usually contain text, icons, or checkboxes.

The QTableWidgetItem class is a convenience class that replaces the QTableItem class in Qt 3. It provides an item for use with the QTableWidget class.

Top-level items are constructed without a parent then inserted at the position specified by a pair of row and column numbers:

QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg(pow(row, column+1)));
tableWidget->setItem(row, column, newItem);
212 questions
3
votes
2 answers

How to change the background color of qtooltip of a qtablewidget item?

I have a qtablewidget. There are certain cells (qtablewidgetitem) in this table that need to show error message via qtooltip. I wish to change the background color of tooltip of each cell so as to highlight the tooltip message better. How can it be…
Nishant Kumar
  • 363
  • 4
  • 20
3
votes
1 answer

Qt Problems Adding Table Widget Items

I have an invoice form which i am using to both create invoices and display the results of a stored invoice. I when i am trying to read back data from the database and display it i am getting the error of QTableWidget: cannot insert an item that…
Root0x
  • 472
  • 1
  • 9
  • 28
3
votes
2 answers

Inserting Images from directory in QTableWidget

Well, hi all. I've got a question. I have a QTableWidget where I need put images from directory and retrieve name of image that was in selected cell. How can it automatically generate number of rows and columns depending of number of files in…
Azraith Sherkhan
  • 131
  • 2
  • 11
3
votes
1 answer

QtableWidget does not show data

I have a class that creates random data which I would like to show in a tableview on the main window. I added via Designer a table view to the main window and called it tblData. I suspect the problem is related to this because when I call the…
RogerWilco77
  • 319
  • 1
  • 3
  • 13
3
votes
1 answer

Qt how to insert string inside a cell in QTableWidget

Possible duplicate: Filling some QTableWidgetItems with QString from file How to insert rows at run time in a QTableWidget? How to insert hard coded strings in the cells of this QTableWidget? Here's what I tried before getting stuck... I have…
cappy0704
  • 557
  • 2
  • 9
  • 30
3
votes
2 answers

Qt How to check state checkbox in QtableWidget

Recently I found the way that checkbox places in the middle of QtableWidget item. However, I do not know how to check state whether or not button is clicked. Could you tell me how to check button state? here is what Ive found code: QWidget *pWidget…
Jongju Kim
  • 184
  • 2
  • 13
3
votes
1 answer

PySide/PyQt: 'TypeError: native Qt signal is not callable' when trying to use 'currentItemChanged' with QTableWidget

I have a table with some data that I want to be able to edit through the QTableWidget. Upon trying to connect the currentItemChanged signal: self.QTableWidget.currentItemChanged(QTableWidgetItem,QTableWidgetItem).connect(self.editCell) I get the…
UrbKr
  • 621
  • 2
  • 11
  • 27
3
votes
1 answer

QTableWidget edit only one column and leave the rest non-editable

In QT 4.7, I am trying to make one QTableWidgetItem in a QTableWidget Editable and the rest all columns should be read only for me. I am having problems here. I have checked a number of samples through google and stackoverflow but failed to achieve…
Muthu
  • 2,675
  • 4
  • 28
  • 34
2
votes
2 answers

Add a String as an Item to a tableWidget in QT/Python

I have an array with strings and I want to add each string in a different row and the same column of a tableWidget. I'm using the function setItem to change the desired field, but I get the error QTableWidget.setItem(int, int, QTableWidgetItem):…
DeeRose
  • 21
  • 1
  • 2
2
votes
1 answer

QTableWidget Drag/Drop rows does not change their location when accessing by index

I have a QTableWidget, that allows moving of rows by dragging and dropping. The initial table looks as follows: If clicking on the button, it prints all the values as they are in the table. Now after dragging row 2 to the the position of row 4,…
2
votes
1 answer

How to get the cursor position in a cell of QTableWidget

I have a QTableWidget and I need to know the position of the cursor in a cell. For QLineEdit there exists a function QLineEdit::cursorPosition( ). Is there something similar for a cell in a QTableWidget or for a QTableWidgetItem? Or any other method…
Quizard
  • 71
  • 1
  • 5
2
votes
1 answer

Deprecation warning in Python, does it make sense here?

I'm writing a Python (using 3.8.2 version) app for my project. In the app I use PySide2 to create QTableWidget object called items_tableWidget. Here's the fragment of my code, which creates QTableWidgetItem objects, fills them with my data, makes…
kunek
  • 91
  • 5
2
votes
1 answer

QTableWidget omits some itmes, items are created but ignored

I have two different projects where I use QTableWidget object and I have the same issue in the both. I try to fill the QTableWidget object with new QTableWidgetItem but some of items are missed, they are not represented in the table. The problem…
Mikhail Z
  • 31
  • 6
2
votes
3 answers

Is there a way to check which check boxes have been checked in a PyQt5 table

I'm attempting to make a room booking system, using a table. In the table I have check boxes, I would like it so that when the user clicks the book button, the program would see which check boxes have been checked, so that it can remove those check…
Taf
  • 71
  • 1
  • 8
2
votes
1 answer

Centering a QIcon in a QTableWidgetItem in PyQt5

I have a QTableWidget in which some of the QTableWidgetItem's contain a single QIcon (not a button, not clickable, just an image). Can anybody advise me on how to center the icon? I am providing below some sample code which correctly displays the…
bavistr
  • 352
  • 1
  • 10
1 2
3
14 15