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

Addeed into QTableWidget is wrong

I have the fololloiwng code anf my query work fine: ###initilize Objects self.dbObj = DbAbsLayer() self.tableObj = MaterialsTable(dict()) ####making queries, one for count row, another for result row query =…
PersianGulf
  • 2,845
  • 6
  • 47
  • 67
0
votes
1 answer

Logical error in filling QTableWidget and filling all of nodes

i have the following code (PyQt): searchFrameObject.tableWidget.setRowCount(rowCounter) searchFrameObject.tableWidget.setColumnCount(5) for row in range(rowCounter): for column in range(5): for result in query: item =…
PersianGulf
  • 2,845
  • 6
  • 47
  • 67
0
votes
1 answer

loading csv in qtablewidget (Why my code is not working?)

I am self-learner and new to qt(I just want to learn to write program). Trying to load the csv file to qtablewidget but it overriding all columns and row with same data. I tried to follow How to import a CSV file to a QTableWidget but i did not get…
user2715275
  • 35
  • 1
  • 8
0
votes
1 answer

How to prevent QTableWidget from occupying the whole window in a QHBoxLayout?

In my Qt program, I programmatically generate a modal QDialog. I want to show two widgets in this dialog window: A custom widget showing a camera output and a QTableWidget, showing the pixel coordinates of the corners found in the camera image. I…
Ufuk Can Bicici
  • 3,589
  • 4
  • 28
  • 57
0
votes
1 answer

expanding widgets inside a Qtabwidget

Why does the widgets inside a QTabWidget don't resize? All my widgets resize except for the ones inside the tabs, even the tabs resize, but not the items inside it. Is this because of the type of layout as I show in the figure? I can's assign a…
SamuelNLP
  • 4,038
  • 9
  • 59
  • 102
0
votes
0 answers

Qt QCombobox currentIndexChanged signal

How get ItemIndex from one ComboBox and send to another ComboBox? Both Comb's created in QTableWidget QComboBox *comboA = static_cast(ui->tableWidget->cellWidget(0,0)); QComboBox *comboB =…
jenkye
  • 1
  • 1
  • 1
0
votes
1 answer

can't view the data correctly when adding the data of sqlite database to qtablewidget

i have a big problem , i need to display a data from sqlite3 db in a qtablewidget, but when i store a new information the table show column1 column2 column3 column4 .... row1 empty empty empty empty row2 data empty empty …
0
votes
1 answer

Unexpected behaviour when setSortingEnabled(1) is called

I have a QTableWidget with first column populated with checkable items, so I needed to overload those items to be able to sort them. Sorting works as expected when I click on header of that column (rows are sorted - first there are checked rows and…
Aleksandar
  • 3,541
  • 4
  • 34
  • 57
0
votes
1 answer

Perform Input Validation in QAbstractItemDelegate / Custom QLineEdit

I would like to perform input validation on a customized QTableWidget that has its setItemDelegate to a subclass of QStyledItemDelegate. The input validation works and my error message pops up correctly, but the focus moves on to the next cell…
David Yee
  • 3,515
  • 25
  • 45
0
votes
1 answer

Using setCellWidget to insert a QTextEdit into a QTableWidget loses keyboard and mouse events

I am trying to insert pretty, HTML text into QTableWidget cells using setCellWidget and QTextEdit objects. This works great, but now my table doesn't get mouse clicks (for selection, etc.) or keypresses (for selection, navigation, etc.). Here is…
Slogger
  • 1
  • 1
0
votes
1 answer

C++ Qt Table Rows Clearing When New Row Added

I am using the following code to create an object and then add a row to a qt table and populate it. However after adding the first new row, the next time the button is clicked and a new row is added all but the first column of the row above are…
Talon06
  • 1,756
  • 3
  • 27
  • 51
0
votes
1 answer

QTableWidget - QMenu Context Menu - AddAction slots not calling functions

I'm trying to call a function via a context menu embedded inside of a QTablewidget. It does not call the function in the slot. Could I be missing something ? The context menus do appear but clicking does nothing. QMenu *contextMenu = new QMenu; …
rreeves
  • 2,408
  • 6
  • 39
  • 53
0
votes
1 answer

QProgressBar with QTableWidget stretched

I'm trying to stretch QProgressBar to fill with QTableWidgetItem, I have not found any solution about this, do anyone know how? Thanks! ... ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); ... QProgressBar *bar = new…
user2399415
  • 207
  • 2
  • 3
  • 8
0
votes
1 answer

pyqt4: QTableWidget cell coloring causes drag-and-drop

I create a table and a button with: self.table =…
Martin
  • 1,236
  • 3
  • 9
  • 9
0
votes
1 answer

qtablewidget example for entering data into the table

I need to create a tablewidget with 3 columns and multiple rows… I was able to create the columns and headers but Iam unable to enter data into the table… So please help me as soon as possible… Thankyou