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

problem settinfg column span (setSpan) in QTableWidget with Python

I have my header information in HeaderCol objects (below) that hold the text, the actual row the text is to appear on (it is one of the first two rows) the start column, and the span (number of columns) I have the following code: import sys from…
jordanthompson
  • 888
  • 1
  • 12
  • 29
-1
votes
1 answer

Print Selected data from qtable pyqt5 python

I HAVE TRIED MANY BUILT FUNCTION LIKE : currentItem() selectedItems() TO PRINT SELECTED DATA IN QTABLE OF PYQT5 IN PYTHON WHEN EVER I USE THESE FUNCTION THEY ONLY PRINT THESE import sys from PyQt5.uic import loadUi from PyQt5 import…
Yūjin-A
  • 1
  • 2
-1
votes
1 answer

How can I sum up entire columns in a QTableWidget?

I'm trying to do a GUI that can calculate multiple vectors operations (sum, rest, multiplication, division). I'm using the "QTableWidget" from "Qt Designer" and doing the code in spyder. But I can't find the way to perform the operations, I'm new…
JohnaMN
  • 1
  • 2
-1
votes
1 answer

PyQt5 Keyboard shortcut for QTableWidget stops working when table is cleared

I have a QTableWidget that I want to attach a shortcut to to advance to the next cell when the Enter/Return key is pressed using the code I found below. I reuse the table a couple of times so I call the clear() method in between populating the table…
BdT141
  • 13
  • 3
-1
votes
1 answer

PYQT6.4 QTableWidget.sortItems function, Pycharm is throwing a syntax issue even though syntax follows documentation

Here is the documentation: QTableWidget.sortItems This is the function: PySide6.QtWidgets.QTableWidget.sortItems(column[, order=Qt.AscendingOrder]) The following is my code: self.notes_current_table_widget.sortItems(column[2,…
-1
votes
1 answer

How create a signal with checkbox in QTableWidget Pyqt6

I begin with python v3.10, I use actually PyQt6 for the design of the windows. I created a QTableWidget in which I put a checkbox with a picture. Now I would like to create a signal to execute a function when I click on it. I tried, connect,…
-1
votes
1 answer

How to add rows with the same specifications as the ones in a tableWidget after a table is already created?

In my app I enter a vlaue and said value sets the number of rows to the table. Within the function I will post here I do all the stuff related to setting up the TableWidget. What I want is to to be able to add new rows later on using the same…
-1
votes
1 answer

Argument must be str not tuple

i need to load only the data from database by todays date. date column in database is in TEXT... ''code to load all the data from database'' def load_database(self): today_date = current_date[0:11] while…
-1
votes
1 answer

How can one design a a custom table or table list in Qt?

I have a certain task to do and I my table widget looks like this: What I want to do is to make my table look like this: So naturally my question is how do I go on about that?
-1
votes
1 answer

Data not being added to table with PyQt5

My code is supposed to add data to a two column table when "add" button is clicked. The problem is that when the "add" button is clicked, only the empty row is being added. Can someone please let me know what is wrong? Below is the part of the code…
-1
votes
1 answer

Setting the Highlight color within a QStyledItemDelegate on a QTableWidget

I am referencing code as written by eyllanesc here: https://stackoverflow.com/a/53357083/3950707 When a cell on my QTableWidget is selected I want the default select colour displayed: However, after setting the initStyleOption, this lighter colour…
-1
votes
1 answer

How to select rows on QTableWidget and return the value to the QLineEdit

I want to make that when i click on particular cell on the QTableWidget it will block the corresponding rows and I want to return the value of each row selected into the QLineEdit. I couldnt seem to find the solution my code only return when i…
-1
votes
1 answer

cellClicked and cellPressed not working for QTableWidget

Whats is wrong with following call. IDBTable is QTableWidget connect(m_GUI->m_UI->IDBTable,SIGNAL(cellPressed(2, 0)), this, SLOT(slotGoToWelcomeScreen()));
user12784615
-1
votes
1 answer

Label Won't Update

Currently, I have some code that creates a QTableWidget. When you click on a QTableWidget cell, a label appears which shows the name of the item you clicked. Then, there is a menu button at the top which, when clicked, takes you back to the…
user14993843
-1
votes
1 answer

How to connect a QRadioButton of a QTableWidget cell with another QTableWidget cell using an arrow?

I have a QListWidget and a QGraphicsView both subclassed to overwrite some of their members. I prepared a minimal verifiable example showing the problem I have here From the QListWidget I can drag and drop specific field (represented by a…
Emanuele
  • 2,194
  • 6
  • 32
  • 71