how to select QTableWidget index in QT?
-
tableWidget->selectionModel()->select(tableWidget->model()->index(4,5),QItemSelectionModel::ClearAndSelect); -
-
constructure:: ...() { connect(this->twidget, SIGNAL(clicked(const QModelIndex &)), this, SLOT(onTableCellClicked(const QModelIndex &))); }; void window::onTableCellClicked(const QModelIndex &index) { qDebug() << index; }But onClick iit will not forwarded to the SLOT section
-
constructure:: ...() { connect(this->twidget, SIGNAL(clicked(const QModelIndex &)), this, SLOT(onTableCellClicked(const QModelIndex &))); }; void window::onTableCellClicked(const QModelIndex &index) { qDebug() << index; }But onClick iit will not forwarded to the SLOT section
Hi
Are you sure you have NEW'ed the instance ?
constructure:: ...()
{
connect(this->twidget <<< did you NEW this ?also check the return of connect to see if it says TRUE