Qt開發(fā)時(shí)Qtablewidget如何依據(jù)item中的內(nèi)容獲取item的行數(shù)?
發(fā)表于2019-05-10
回復(fù):0
查看:7355 |
<pre class='brush: cpp'>QString offlineName = QString(QLatin1String(pack->name));
QList<QTableWidgetItem*> itemVec = ui->tw_useronline->findItems(offlineName,Qt::MatchExactly);
int row = itemVec.at(0)->row();//程序到此奔潰
ui->tw_useronline->removeRow(row);</pre>
如何解決?
登錄 慧都網(wǎng)發(fā)表評(píng)論