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
0
votes
0 answers

QT SetItem oworks only in 0x0 field. Why?

while(true) { newItem->setText("wwwwww"); ui->tableWidget->setItem(i, i, newItem); ui->tableWidget->update(); i++; } But in table only at 0x0 position I see text. Why?
user3360601
  • 327
  • 3
  • 17
0
votes
0 answers

Making only a part of QTableWidgetItem have background

Is it possible in Qt to make a QTableWidget cell have background in only a part of th cell? I mean, I want to have cell with eg. 60% of the cell being red and 40% being white, so something like the data bars in MS Excel. Is that possible?
burtek
  • 2,576
  • 7
  • 29
  • 37
0
votes
1 answer

Reading all the values from Qtablewidget in PyQt

i have imported a QtableWidget in my Gui. I am a newbie in PyQt and Qt designer. I need to read the values entered in the cells in the QtableWidget. My existing code is given below. from PyQt4 import QtCore, QtGui try: _fromUtf8 =…
0
votes
1 answer

Cannot edit QTableWidgetItems

I want to make items of QTableWidget editable for user. The following code works perfectly when it is compiled within a separate project: QTableWidget *tablewidget = new QTableWidget; // Add…
tmporaries
  • 1,523
  • 8
  • 25
  • 39
0
votes
2 answers

How get currentIndex() property from combobox inside table in Python

I am no so strong in object programing in Python, so I have to ask for a help. I create a combobox inside table this way (it works): self.comboBoxEng = QtGui.QComboBox() self.tableWidget_1.setCellWidget(row,column,self.comboBoxEng) The question…
user2855279
  • 1
  • 1
  • 1
  • 2
0
votes
2 answers

QTableWidgetItem is getting itmes method not working

I am not able to populate this table, I do not knoe what I'm doing wrong, I have been reading some posts, and seems like everything is correct...however, nothing is appearing in my table. Here is my code: The totalProcess list is like that…
codeKiller
  • 5,493
  • 17
  • 60
  • 115
0
votes
1 answer

How to add a paletted qlabel as a qtablewidget item?

I am trying to add a label with color palette, to a QTableWidget. But its not displayed with the color i set to label palette. here is my code, QWidget *colorTableWidget = new QWidget(); QLabel *lbl = new QLabel(); …
Prady
  • 663
  • 3
  • 11
  • 28
0
votes
1 answer

Addeed into QTableWidget is wrong

I have the fololloiwng code anf my query work fine: ###initilize Objects self.dbObj = DbAbsLayer() self.tableObj = MaterialsTable(dict()) ####making queries, one for count row, another for result row query =…
PersianGulf
  • 2,845
  • 6
  • 47
  • 67
0
votes
1 answer

Logical error in filling QTableWidget and filling all of nodes

i have the following code (PyQt): searchFrameObject.tableWidget.setRowCount(rowCounter) searchFrameObject.tableWidget.setColumnCount(5) for row in range(rowCounter): for column in range(5): for result in query: item =…
PersianGulf
  • 2,845
  • 6
  • 47
  • 67
0
votes
1 answer

loading csv in qtablewidget (Why my code is not working?)

I am self-learner and new to qt(I just want to learn to write program). Trying to load the csv file to qtablewidget but it overriding all columns and row with same data. I tried to follow How to import a CSV file to a QTableWidget but i did not get…
user2715275
  • 35
  • 1
  • 8
0
votes
1 answer

QTableWidgetItem performance

I put some text in QTableWidget's cells, like this: tableWidget.setItem(row, col, QtGui.QTableWidgetItem(myText)) and scrolling through table is very slow (1fps or less) over rows which have QTableWidgetItems with myText length over 5000…
Aleksandar
  • 3,541
  • 4
  • 34
  • 57
0
votes
1 answer

QTableViewWidget insertRow with ordered tables adding content to the wrong row

I have a procedure that adds a new row at the end of a QTableViewWidget and fills it with data in this way: #Add new row table.insertRow(table.rowCount()) #Fill the row item = QTableWidgetItem() …
Jorge
  • 2,156
  • 2
  • 22
  • 29
0
votes
1 answer

QTableWidget::row() not behaving as expected

When calling QTableWidget::row( const QTableWidgetItem * item ) with a pointer to a valid vertical header item, the function is returning -1. I wouldn't expect this though, since I explicitly set the vertical header item of the row in the table…
Freedom_Ben
  • 11,247
  • 10
  • 69
  • 89
0
votes
1 answer

C++ Qt QTableWidgetItem causes crash

I have a QTableWidget called tw_topic. It's not empty. In another function I need the text of the items. Code : for(int i = ui->tw_topic->rowCount(); i >= 0; i--) { //should return the first item of the first column const QString itm =…
0
votes
1 answer

Cannot insert an item that is already owned by another QTableWidget

I'm having issues with QTableWidgetTable, after I run the FindTableItems function it resets the rows/number to the appropriate size, but does not put any data into the cells. I can see that the objects are holding the correct data. I recieve no…
rreeves
  • 2,408
  • 6
  • 39
  • 53