Problem with QTableWidget
In an RVIZ plugin i use a QTableWidget to display a max of 100 waypoints. Everytime a waypoint is changed, added oder removed i trigger an updated function which fills the QTableWidget with the current waypoints. The problem which accours is that the QTableWidget is only repainted every second change.
void WaypointPanel::updateTable() {
//fill the table with the new content
WaypointList->setRowCount(waypointArray->getArraySize());
for(int i=0; i<waypointlist->rowCount();i++){
//insert content into new row
WaypointList->setItem(i,0,new QTableWidgetItem(tmpLocale->toString(waypointArray->getWaypoint(i).x ) ,0));
WaypointList->setItem(i,1,new QTableWidgetItem(tmpLocale->toString(waypointArray->getWaypoint(i).y ) ,0));
WaypointList->setItem(i,2,new QTableWidgetItem(tmpLocale->toString(waypointArray->getWaypoint(i).z ) ,0));
WaypointList->setItem(i,3,new QTableWidgetItem(tmpLocale->toString(waypointArray->getWaypoint(i).radius ) , 0));
}
}
If i add a loop which prints out the content of the QTableWidget i can see that the content is there but it isn’t displayed.
This sounds more like a QT problem than a ROS problem. Most ROS users don't have a lot of QT experience, so you may get a better answer if you ask elsewhere.