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

one item for 5 positions

I have a table. And an item. How can I use only one Item to fill part of the table? If I set item to one position and then take item, I lose text at that position. And use lots of items is not comfortable. QTableWidgetItem *Type = new…
user3360601
  • 327
  • 3
  • 17
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
1 answer

How to init tableWidget?

I've just started with Qt. I saw some articles, but don't understand one thing. Here it is. At this link filesTable comes from nowhere. I don't understand where it was inited? Another example. void MainWindow::on_pushButton_clicked() { …
user3360601
  • 327
  • 3
  • 17
0
votes
1 answer

How make items in combobox appear in one selection instead of selecting them only one by one?

How do you get items that are added to qcomboBox with click of push button to appear as example: '10, 23, 56, 14, 57, ... ' instead of only having them all appear in the drop down menu and only selecting them one by one? Here is my code: def…
Viv91
  • 45
  • 2
  • 8
0
votes
1 answer

How to pass input data from a tablewidget to a combo box by clicking pushbutton?

I want to input data in my table and then have it appear in my combo box after pressing 'ok' pushbutton in pyqt. May I know how to go about doing that? Whenever I run my code it just says there is an error at self.comboBox.addItem(item). I don't…
Viv91
  • 45
  • 2
  • 8
0
votes
1 answer

What is the proper way to create subtable in a QTableWidget?

I have already implemented a subtable functionality in a QTableWidget. That is, if you click a row that contain a Left Arrow icon, a new row will be added and in there another instance of QTableWidget will be attached using setCellWidget. All is…
swdev
  • 4,997
  • 8
  • 64
  • 106
0
votes
1 answer

Qt: Showing a list of Users/Clients and when clicked, showing profile

in my Qt project, I have a list of Clients. I have to show their name and workplace. Proposed ui looks something like this: Facts: Number of client is variable, so the number of dotted rectangular box in the image is not fixed stylesheet of Name…
Shakib Ahmed
  • 781
  • 2
  • 10
  • 24
0
votes
1 answer

check if the name already exists in QTableWidget

I have a problem. I have 2 QTextEdit fields : value & name. When I push the button i create QTableWidgetItems with the value from "value" and "name". But now I will check if the name alredy exists. But I don't know, with " findItems " ? with…
thelittlePanda
  • 101
  • 2
  • 10
0
votes
1 answer

How to track an new/edited item in QTablewidget?

I have a QTableWidget with x rows and 2 columns. Sorting is enabled. I want to add a new Item: def addlabel(self): rows = self.cui.tableWidget.rowCount() self.cui.tableWidget.insertRow(rows) …
Hubschr
  • 1,285
  • 6
  • 18
  • 35
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
0 answers

QTableWidget - refresh cell when application is running

I have got app which check date (linux) and put this 'date' into the cell 'a1'. How to refresh cell 'a1' after one minute when application is running ? In the future I will refresh all cells listed below but in the beginning is good to know how to…
s_z_p
  • 98
  • 1
  • 8
0
votes
1 answer

PyQt/PySide tableWidget.setItem behaving wierdly

I've this piece of code that is behaving wierdly. data = { "test1":100, "test2":200, "test3":300 } self.tableWidget.setColumnCount(len(list(data.viewitems())[0])) self.tableWidget.setRowCount(len(data)) for i, name in enumerate(data): …
f.rodrigues
  • 3,499
  • 6
  • 26
  • 62
0
votes
2 answers

QTableWidget: Only numbers via delegate

I'm currently trying to let my QTableWidget only display numbers. I read that I'd need a QAbstractItemDelegate to do so, so I read through the documentation and found the createEditor void. Here's my code I'm currently using: #include…
KrauseDroid
  • 63
  • 2
  • 9
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

How can rowcount update itself when data is added?

self.table.setRowCount(5) self.table.setColumnCount(8) self.table.setHorizontalHeaderLabels(title) for i,row in enumerate(cur): for j,val in enumerate(row): self.table.setItem(i, j,…
Jurisdiction
  • 47
  • 4
  • 12