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

QTableWidget - context menu only for specific cells/columns

I am using a QTableWidget for displaying data. I know that I can use the addAction method to add a context menu. How can I limit the context menu to only specific cells or columns? addAction exists for QActionGroup QGraphicsWidget QMenu QMenuBar…
matthias
  • 247
  • 6
  • 17
3
votes
3 answers

How to Copy and Paste multiple Cells in QTableWidget in PyQt5?

I have a Qtablewidget shown below. I want to copy multiple cells from the table and paste in other row in the same table. So far, I can do the same on single cell, but is there a way i can do multiple cells at the same time?? Also, if possible, to…
Vi_py123
  • 73
  • 1
  • 9
3
votes
2 answers

Create a QTableWidgetItem with flags()

I dont understand the Qt5 Documentation in the TableWidgetItem-Chapter. I cant get the right parameters to set my freshly created TableCell as editable. I've got this piece of code for i, item in enumerate(event_desc, start=0): …
Heini
  • 295
  • 2
  • 10
3
votes
1 answer

How to apply a validator on column of QTablewidget column?

I have created a table in Qt designer. In the column 2 of the table, I want input from user which should be capital letters only. How to do the same? Here I an not able to understand which utility of QTableWidget or QTableWidgetItem can be used…
VaP
  • 31
  • 2
3
votes
2 answers

How to PageUp/PageDown table with QTableWidget?

I am using QTableWidget i have set 100 rows and 2 columns, now i need to table scrolling with pageup and pagedown buttons. i'm trying to browse the table with PageUp/PageDown buttons, but the buttons go to the home or go to end the table. I wonder…
Roger
  • 67
  • 7
3
votes
1 answer

How to load a local saved GeoJSON into a Qt Dialog with QTableWidget or QTableTree by using a QToolButton or QPushButton?

I created a QGIS Plugin (dialog) with Qt Creator. The dialog contains several tabs and additonal content and widgets on each tab. On one of these tabs I created a QLineEdit, a QPushButton and a QTableWidget. I would like to load locally saved…
Zcibrag
  • 33
  • 3
3
votes
1 answer

Set selection background of disabled checkbox in pyqt5

I have a checkbox that is disabled (the user should not be able to toggle it) but I'm having trouble changing it's background when selected. I'm sure it has to do with the fact that box is disabled, but I'm not sure how to fix it. If there's an easy…
3
votes
1 answer

How to link two comboboxes in a table of multiple comboboxes?

I am trying to link the value of combobox in column 1 with the box in column 3. On change of value in column 1 the values in the dropdown combo box need to change to a new set. On click of the button, a new row is to be added with similar combobox…
Kevin_ALA
  • 233
  • 2
  • 11
3
votes
1 answer

How to make sure all of the data on a Qt table cell is visible?

I am currently working with python 2.7 using PyQt4. However, a solution in C++ might help. I am using the QTableWidget to create a table. The table has limited space on my app, and it is not editable. Some of the cells in the table contain lots of…
Mika Li
  • 107
  • 1
  • 8
3
votes
1 answer

retrieve value from QlineEdit inside QtableWidget in Pyqt4 Python

I am having trouble in Retrieving the Entered in QWidgetlineEdit box. Got C++ Implementation of the Same but unable to retrieve using Python, self.line = QtGui.QLineEdit() i =0 while(i
3
votes
0 answers

Place Image in PyQt QTableWidget Header

I am trying to create a QTableWidget that has a thumbnail image in it's vertical header (and eventually some text under it). My current attempt is to subclass the QTableWidgetItem... class ShotHeader(qt.QTableWidgetItem): imagePath =…
3
votes
8 answers

Disable selecting row or column by clicking the header in QTableWidget

I have a QTableWidget and I want to disable the behavior that a row or column is selected when you click on a row or column header. Does anyone know how to disable this behavior? Edit: The headers need to remain clickable, because the…
Oli
  • 1,221
  • 2
  • 12
  • 18
3
votes
1 answer

Pyqt QTablewidget wordwrap lines

How can I set the width of a QTableWidgetcolumn and make the text in each cell start at a new line if its width is bigger then the set width ( kind of like in excel that the text is allowed to have a/be wordwraped). Right now my hole text per cell…
Mady
  • 443
  • 7
  • 19
3
votes
1 answer

Python QTableWidget not displaying full width

I am an experienced (if rather rusty) Windows programmer. I am trying to create a partial logic simulation of a computer (Ferranti Argus 400) I designed in 1963 (yes I am that old! I am however new to Python programming and am having a formatting…
steelej
  • 33
  • 4
3
votes
1 answer

how to get the selected combobox value from QTableWidget?

I have created a QTableWidget in which for a column I am setting a combobox QComboBox using setCellWidget function. It works fine . This is how i set up the qtablewidget cb = QComboBox() cb.addItems(["Java", "C#",…
Abhijit Gujar
  • 433
  • 6
  • 15