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

creating Custom Widget using QtDesigner PyQt4

Can anyone please suggest me best practice to create a Custom widget using PyQt4 ? I want to see how to approach adding Qpushbutton or QCheckboxGroup inside the cells of QTable Widgets that will be added on user clicking add new row to QTable at…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
0
votes
1 answer

Qt - Access a checkbox in a table

I have a table and each row in the table has a checkbox in it's first column. I need to make it so I can detect which checkboxes are checked and delete those rows when a button is pressed. QWidget * chkWidget = new QWidget(); QHBoxLayout *center =…
Mitch
  • 519
  • 2
  • 7
  • 16
0
votes
2 answers

sort QTableWidgetItem numerically

i am trying to create a table using python and pyqt4. at the moment it will sort the items like this 100, 10, 1, 2 etc.. it needs to be sorted as such: 1,2,10,100 etc i am currently using self.table.setSortingEnabled(True) but i think this is…
Sam McKay
  • 73
  • 1
  • 1
  • 9
0
votes
1 answer

QTableWidget dynamic row creation

I am trying to create a new row in a QTableWidget on an itemChanged signal. Here is the code: Constructor:: { ui->tblRoles->insertRow(0); QTableWidgetItem *twl = new QTableWidgetItem("New Role"); QFont f =…
Ferenc Deak
  • 34,348
  • 17
  • 99
  • 167
0
votes
1 answer

How can I change QTableWidgetItem notation to standardNotation

I have QTableWidget with 3 columns. I multiply numbers in first and second column and write result in third column. Numbers are double. The problem is: result is in scientific notation like "1.4e+3". How can I change notation to standard notation? I…
ekremk
  • 253
  • 3
  • 8
  • 18
0
votes
1 answer

Qt: How to resize an image in a table?

This code correctly displays an image, and resizes it when the window is resized: QLabel *imageLabel; QTabWidget *imageTabWidget; // new... imageTabWidget->addTab(imageLabel, "Image"); I would like the same behaviour putting the image in a table…
Pietro
  • 12,086
  • 26
  • 100
  • 193
0
votes
0 answers

mousehover an tablewidgetitem

actually I build an Dialog from an .ui file for displaying all shortcuts in my application. I have an QTableWidget with normal items (cells with qString) and an QPushButton in a cell. My SelectionBehavior is QAbstractItemView::SelectRows and i add…
norca
  • 138
  • 1
  • 14
0
votes
1 answer

How to emit a signal when cell/item is edited?

I have a method that imports a table from a DB into a QTableWidget, and I want to edit a cell in the DB through the QTableWidget (when editing a cell by double-clicking it). I have tried to use the QTableWidget::cellChanged() signal, but the problem…
Skogen
  • 721
  • 1
  • 11
  • 30
0
votes
1 answer

How to move function to QThread?

I have a function called refreshLogDisplay() in my MainWindow class which does a lot of UI work. The code in it is like this: ui->tablewidget->setRowCount(100); // ... So the function deals with a lot of protected properties of MainWindow…
Al2O3
  • 3,103
  • 4
  • 26
  • 52
0
votes
1 answer

QSvgWidget behaviour in QTableWidget cell

I have QTableWidget and I have populated one column with .svg files with QSvgWidget to show them : for... svgWidget = QSvgWidget("C:\mySVG.svg") self.ui.tableWidget.setCellWidget(i, j, svgWidget) ... Other columns are populated with some…
Aleksandar
  • 3,541
  • 4
  • 34
  • 57
0
votes
1 answer

Inserting QSvgWidget in QTableWidget cell

What I want to do is to load .svg file and show (render) it in qtableWidget cell. First part I've done like this: svgWidget = QSvgWidget("C:\mySVG.svg") svgWidget.setMaximumSize(100,100) next line renders svg like what I…
Aleksandar
  • 3,541
  • 4
  • 34
  • 57
0
votes
1 answer

Fill a dictionary with all cell values of given row

User sets values manually in all cells in a QTableWidget. The values of the first row of the table represent the values we want to store in a dictionary FirstRowDict. Second row values will be put in SecondRowDict and so on. So from a table like…
CosmoSurreal
  • 259
  • 6
  • 16
0
votes
1 answer

Troubleshooting Performance Using Qt Debugger

Hi I am student programmer using Qt to build some editing applications for work and I'm hitting an issue in my debugging practices that I am not sure how to approach. I have QTableWidget that takes at least 10 secs to fill when 100+ rows are brought…
Wylie Coyote SG.
  • 1,009
  • 6
  • 22
  • 37
0
votes
1 answer

Qt - Display several, selectable lines

Im writing a tool that simulates Turing machines. Here, Ive got a transition table of a such a machine When a cell is double-clicked, a little dialog pops up (which is a custom widget, derived from QFrame) and should allow editing the contens of a…
TeaOverflow
  • 2,468
  • 3
  • 28
  • 40
0
votes
2 answers

Writing mouse location to QTableWidget

How can I write append mouse click coordinates to a QTableWidget with each click? I already have the QMouseEvent to display the coordinates in a QLabelItem, but I would like to add a row with the coordinates of each click. Is this possible? I…
Victoria Price
  • 637
  • 3
  • 13
  • 26