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

more efficient solution for QTableWidget write

I am reading a PyTable, with 1320000rows x 16cols The idea is to read the table and to write its content into a QTableWidget. The way I am doing it makes the GUI collapse. I would like a clue about how to do it in an efficient way. Here it is my…
codeKiller
  • 5,493
  • 17
  • 60
  • 115
0
votes
1 answer

How do I make my QTableWidget class (any class) update/refresh itself?

I am making a gui using pyqt4. When I insert data from sqlite into my qtablewidget table, it will only update itself once I have closed the program and reopened it. How can I have the program update itself automatically (refresh the class) after…
Jurisdiction
  • 47
  • 4
  • 12
0
votes
1 answer

Displaying rows from sqlite databse using QTableWidget in PyQt4

with sqlite3.connect('database.db') as db: cursor=db.cursor() cursor.execute('select* from Item Order BY Name ASC') title = [cn[0] for cn in cursor.description] rows = [cn[0] for cn in cursor.description] …
Jurisdiction
  • 47
  • 4
  • 12
0
votes
1 answer

Access to a tableWidget inside tabWidget error

How do I access a tableWidget, which is inside the tab1 of a tabWidget?? This is what I have done so far... table = self.ui.tabWidget.widget(0) table.setRowCount(5) And the Error returned: Traceback (most recent call last): …
codeKiller
  • 5,493
  • 17
  • 60
  • 115
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 to insert my database into my QTableWidget table?

class Table(QtGui.QDialog): def __init__(self, parent=None): super(Table, self).__init__(parent) layout = QtGui.QGridLayout() self.table = QtGui.QTableWidget() self.table.setRowCount(20) self.table.setColumnCount(3) …
Jurisdiction
  • 47
  • 4
  • 12
0
votes
1 answer

Python - PyQt - QTable Widget - Add Value, Not Key

This post contained nearly the solution I was looking for, but not quite. I have data that I retrieve from MySQL, which resides in what I think is a tuple, though it also looks like a dictionary: {'client_contact': 'John Doe', 'client_state': 'CA',…
0
votes
1 answer

Qt design issue with QTableWidget

At the moment, I am programming a little map editor for my 2D-RPG game. All functions are successfully implemented, but my problem is, that the textures for each cell in my QTableWidget aren't stretched to the full size of 32x32. I have already…
user3149497
  • 67
  • 1
  • 8
0
votes
1 answer

changing size of image and cell in QtableView depending on area available in fullscreen

How do I utilize the area of the screen available for a fullscreen opening QTableView so that thumbnail size can get bigger if the areas available , i.e. the number of rows will go down proportionally, right now I am doing like this class…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
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 know which QPushButton in a QTableWidget

I'm sorry, I know the question has already been asked before, however, I really can't have a solution for me. My situation is very basic : I have a tableview and in each row I have some QPushButtons. The difficulty for me is to know which button has…
etrimaille
  • 230
  • 1
  • 4
  • 13
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

Calculating subtotal in Qtablewidget

i have Qtablewidget i have implemented a delegate for that table like so : Num(default) | item(Qcombobox) | -qty-(QdoubleSpinBox)| Price(QdoubleSpinBox)|subtotal (QdoubleSpinBox) i want to calculate subtotal( qty * price ) for each row using…
advseo32
  • 401
  • 1
  • 5
  • 15
0
votes
1 answer

QTableWidget and generate English number as number row

I have the following QTableWidget: My program is Perisan language in (Persian,Iran) locale,But Qt itself generate a set of number for each row in English language. My question is, How i change the above numbers to my locale?(۰,۱,۲,۳,۴,۵,۶,۷,۸,۹)
PersianGulf
  • 2,845
  • 6
  • 47
  • 67
0
votes
0 answers

Qt: Nesting functions of QTableWidget

I have some code that should insert some text into a QTableWidget at the index position the user selected. Actually, my code is already working, but I have a question to the nesting of the ui-functions. QTableWidgetItem *item = new…
Endauriel
  • 402
  • 5
  • 17