// this method is connected to a signal which indicates that an opengl item
// has been changed
void Container_Widget::openglitem_changed(void* item)
{
if( !isVisible() ) {
return;
}
// if no opengl painter, do nothing
if(!_painter) return;
// cast void ptr to an opengl item
mesh3D::OpenGL_ListItem* opengl_item =
static_cast<mesh3D::OpenGL_ListItem*>(item);
// get a list which contains all treewidget items which are associated
// to the opengl item, the list is the value of a qhash, key is the
const QList<Container_TreeWidgetItem*>* list =
Container_TreeWidgetItem::items(opengl_item->element());
if(list == 0) return;
treeWidget->blockSignals(true);
// treeWidget->setUpdatesEnabled(false);
for(int i=0; i<list->count(); i++) {
// printf("[%d/%d] check treewidgetitem ... \n", i, list.count());
if(treeWidget->isItemSelected((*list)[i]) != opengl_item->selected()) {
// printf("[%d] change treewidgetitem ... \n", i);
// treeWidget->setItemSelected((*list)[i], opengl_item->selected());
}
}
// treeWidget->setUpdatesEnabled(true);
treeWidget->blockSignals(false);
#ifdef DEBUG_mesh3D_gui_Container_Widget
printf("</Container_Widget::openglitem_changed()>\n");
fflush(stdout);
#endif
}
// this method is connected to a signal which indicates that an opengl item
// has been changed
void Container_Widget::openglitem_changed(void* item)
{
if( !isVisible() ) {
return;
}
// if no opengl painter, do nothing
if(!_painter) return;
// cast void ptr to an opengl item
mesh3D::OpenGL_ListItem* opengl_item =
static_cast<mesh3D::OpenGL_ListItem*>(item);
// get a list which contains all treewidget items which are associated
// to the opengl item, the list is the value of a qhash, key is the
const QList<Container_TreeWidgetItem*>* list =
Container_TreeWidgetItem::items(opengl_item->element());
if(list == 0) return;
treeWidget->blockSignals(true);
// treeWidget->setUpdatesEnabled(false);
for(int i=0; i<list->count(); i++) {
// printf("[%d/%d] check treewidgetitem ... \n", i, list.count());
if(treeWidget->isItemSelected((*list)[i]) != opengl_item->selected()) {
// printf("[%d] change treewidgetitem ... \n", i);
// treeWidget->setItemSelected((*list)[i], opengl_item->selected());
}
}
// treeWidget->setUpdatesEnabled(true);
treeWidget->blockSignals(false);
#ifdef DEBUG_mesh3D_gui_Container_Widget
printf("</Container_Widget::openglitem_changed()>\n");
fflush(stdout);
#endif
}
To copy to clipboard, switch view to plain text mode
Bookmarks