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
3
votes
2 answers

How to enable edit-mode on a specific cell in a QTableWidget?

I can go to a specific cell: ui->tableWidget->setCurrentCell(ui->tableWidget->rowCount() - 1, 0); But how do I put the cell into editor mode, so the user does not have to double click the cell to begin editing the contents?
gornvix
  • 3,154
  • 6
  • 35
  • 74
3
votes
1 answer

Retrieve value of QTableWidget cells which are QLineEdit widgets

I create a QLineEdit,set a validator and put it on the table with this code: ui->moneyTableWidget->setCellWidget(rowsNum, 1, newQLineEdit); Then I've got another class for manipulating the table's data doing the sum of every value of a column.…
Segolas
  • 575
  • 2
  • 10
  • 26
3
votes
2 answers

QT Inherit from QTableWidgetItem to Widget and overide '<' operator

I want a QTableWidget with certain cells as customized QProgressBars, and I want it to be possible to sort the columns containing these. My customized QProgressBar is inheriting from both QProgressBar and QTableWidgetItem, and I am overiding the '<'…
remi
  • 937
  • 3
  • 18
  • 45
3
votes
1 answer

Centering Text in QTableWidgetItem during cell Edit

The following PyQt4 example demonstrates my problem. The text in the QTableWidget cells is centered nicely, until you edit the cells. When you edit a cell the text is left justified. I would like to maintain center alignment during edit of each…
panofish
  • 7,578
  • 13
  • 55
  • 96
3
votes
2 answers

PyQt QTableWidget setItem loop

I've been able to use QTableWidget and QTableWidgetItem to populate info from our database into a QTableWidget based on the text returned in the search bar. While I'm able to get the searched item to populate all the info into a tablewidget, I am…
Notmeomg
  • 31
  • 1
  • 1
  • 2
3
votes
2 answers

How should I connect CheckBox clicked signals in Table Widgets in PyQt5?

I would like to add various widgets to various cells in a Table Widget, and I would like to trigger commands when those widgets' values are changed. I can get the widgets into the table as desired, but I'm having problems connecting signals so that…
ToddP
  • 652
  • 13
  • 18
3
votes
1 answer

QListWidget drag and drop with a custom widget set via setItemWidget

I'm using a QListWidget to display custom widgets by setting them with setItemWidget. Something like this: QListWidget* listWidget = new…
Anon
  • 33
  • 4
3
votes
3 answers

Qt table widget, button to delete row

I have a QTableWidget and for all rows I set a setCellWidget at one column to a button. I would like to connect this button to a function that delets this row. I tried this code, which does not work, because if I simply click my button I do not…
user7431005
  • 3,899
  • 4
  • 22
  • 49
3
votes
2 answers

How to create a SIGNAL for QTableWidget from keyboard?

I have a table and move around inside with left, right, up, down buttons. Now I need to create a SIGNAL when I stay in a certain cell and press SPACE button. This SIGNAL should bring also the coordinate of that cell. I tried with standard signals of…
trangan
  • 341
  • 8
  • 22
3
votes
1 answer

How to determine the new order of rows in QTableWidget after sectionMoved event

I am creating an application in PyQt5 and have a QTableWidgetItem for which I allow the user to change the order of rows: tableWidget.verticalHeader().setSectionsMovable(True) I have connected a onSectionMoved slot to the sectionMoved signal. If I…
user2683038
  • 667
  • 6
  • 17
3
votes
1 answer

Qt/C++ QTableWidget: Doing something when a header is doubleclicked

I have a QTableWidget in my form and I want to do something when a user doubleclicks on the header of a row or column. I am using the following connect…
Joseph
  • 12,678
  • 19
  • 76
  • 115
3
votes
0 answers

align each column differently in QTableWidget

I need to create a table like this how can I align first column left, 2nd and 3rd columns center, and last column right sothat when someone put data in, it is automatically aligned as I want ? My first…
trangan
  • 341
  • 8
  • 22
3
votes
3 answers

How can I retrieve data from a QTableWidget to Dataframe?

I have a QTableWidget in editable mode in which user puts in integer input , how can I generate a list of data entered in this table so as to perform operations on it , here is my manual code for that: def…
Rishabh Gupta
  • 73
  • 4
  • 13
3
votes
1 answer

How validate a cell in QTableWidget?

I work eith pyqt4 in python3.4 I want to validate if the text in the cell is a float number when it is introduced. How I do that?
Reinier Hernández
  • 428
  • 1
  • 6
  • 22
3
votes
3 answers

How to get current row of QTableWidget if I clicked on its child?

I have created a QTableWidget in which I've used setCellWidget(QWidget*). I've set QLineEdit in the cell widget. I've also created a delete button and clicking that button sends a signal to the function deleteRow. I've also used a function…
njporwal
  • 111
  • 2
  • 4
  • 9