QTableWidget vs QTableView

cmannett85’s recommendation is a good one. Read the docs about a dozen times. Then, if performance and memory issues are your primary concern and you think you can out-perform the QTableWidget implementation, then a QTableView interface on top of a QAbstractTableModel or QStandardItemModel is what you’re looking for. Since you’re new to Qt’s model-view architecture, … Read more

How to delete all rows from QTableWidget

Just set the row count to 0 with: mTestTable->setRowCount(0); it will delete the QTableWidgetItems automatically, by calling removeRows as you can see in QTableWidget internal model code: void QTableModel::setRowCount(int rows) { int rc = verticalHeaderItems.count(); if (rows < 0 || rc == rows) return; if (rc < rows) insertRows(qMax(rc, 0), rows – rc); else removeRows(qMax(rows, … Read more

How to make a column in QTableWidget read only?

Insert into the QTableWidget following kind of items: QTableWidgetItem *item = new QTableWidgetItem(); item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); Works fine! EDIT: QTableWidgetItem *item = new QTableWidgetItem(); item->setFlags(item->flags() ^ Qt::ItemIsEditable); This is a better solution. Thanks to @priomsrb.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)