fixed toggle section
This commit is contained in:
		| @@ -267,7 +267,7 @@ void XQMainWindow::onTreeViewItemClicked( const XQItem& item ) | ||||
|  | ||||
| void XQMainWindow::onTreeViewItemChanged(const XQItem& item ) | ||||
| { | ||||
|   //qDebug() << " --- TREE VIEW itemChanged:" << item.text() << " : " << item.parent()->text(); | ||||
|   qDebug() << " --- TREE VIEW itemChanged:" << item.text() << " : " << item.parent()->text()  << " : " << (void*)&_mainModel << " : " << (void*) sender(); | ||||
|   // hier müssen wir erst das projekt aktivieren | ||||
|   XQItem* xqItem = static_cast<XQItem*>(item.parent()); | ||||
|   onTreeViewItemClicked( *xqItem ); | ||||
| @@ -312,23 +312,14 @@ void XQMainWindow::onSectionCreated( const XQModelSection& section ) | ||||
| void XQMainWindow::onSectionToggled( const XQModelSection& section ) | ||||
| { | ||||
|   qDebug() << " --- XXX section toggled: " << section.contentType() << ":" << section.sheetRootNode()->to_string(); | ||||
|   if( _currentProjectItem ) | ||||
|   { | ||||
|  | ||||
|     qDebug() << " --- XXX section toggled 2: " << _currentProjectItem->text(); | ||||
|     for (int row = 0; row < _currentProjectItem->rowCount(); ++row) | ||||
|     { | ||||
|       QStandardItem* child = _currentProjectItem->child(row); | ||||
|       qDebug() << " --- XXX section toggled 3: " << child->text(); | ||||
|       if (child->text() == section.contentType() ) | ||||
|       { | ||||
|         // rekursion vermeiden | ||||
|         _currentProjectItem->model()->blockSignals( true ); | ||||
|         bool checked = (child->checkState() == Qt::Checked); | ||||
|         qDebug() << " --- XXX section toggled 4: " << child->text() << " ->" << checked; | ||||
|         child->setCheckState( checked ?  Qt::Unchecked :Qt::Checked ); | ||||
|         _currentProjectItem->model()->blockSignals( false ); | ||||
|         _mainTreeView->repaint(); | ||||
|         break; | ||||
|       } | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user