bool ChatList::setData(const QModelIndex &index, const QVariant &value, int role) { QMdiSubWindow* chatw = getChatSubWindowByIndex(index); if (chatw == NULL) return false; switch (role) { default: case Qt::DisplayRole: case Qt::EditRole: case Qt::DecorationRole: return false; case Qt::CheckStateRole: { bool visible = chatw->isVisible(); chatw->widget()->setVisible(!visible); chatw->setVisible(!visible); } return true; } }
//TODO: debug, this seems circular, maybe not necessary void CodeArea::selectRevision(Revision *r) { QMdiSubWindow *sub = subWindowMap[r]; //if we closed the window and it is invisible, make it visible if ( sub && !sub->isVisible() ) { sub->show(); sub->widget()->show(); } setActiveSubWindow( sub ); }