1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0029018: Documentation - Provide user guide for Qt browser

Documentation is added in a new "Inspector" page of "User Guides".
Inspector plugins has some improvements by the documentation needs.
New DRAW scripts are implemented for 'tinspector' command.
This commit is contained in:
nds
2017-08-28 12:29:29 +03:00
committed by bugmaster
parent 434098193a
commit d2c909178e
117 changed files with 3166 additions and 463 deletions

View File

@@ -41,3 +41,37 @@ void DFBrowserPane_TDataStdTreeNodeModel::SetAttribute (const Handle(TDF_Attribu
aRootItem->SetAttribute (theAttribute);
EmitLayoutChanged();
}
// =======================================================================
// function : FindIndex
// purpose :
// =======================================================================
QModelIndex DFBrowserPane_TDataStdTreeNodeModel::FindIndex (const Handle(TDF_Attribute)& theAttribute,
const QModelIndex theParentIndex)
{
QModelIndex aParentIndex = theParentIndex;
if (!aParentIndex.isValid())
aParentIndex = index (0, 0);
DFBrowserPane_TDataStdTreeNodeItemPtr aParentItem = itemDynamicCast<DFBrowserPane_TDataStdTreeNodeItem>
(TreeModel_ModelBase::GetItemByIndex (aParentIndex));
if (aParentItem->GetAttribute() == theAttribute)
return aParentIndex;
for (int aChildId = 0, aCount = aParentItem->rowCount(); aChildId < aCount; aChildId++)
{
QModelIndex anIndex = index (aChildId, 0, aParentIndex);
TreeModel_ItemBasePtr anItemBase = TreeModel_ModelBase::GetItemByIndex (anIndex);
DFBrowserPane_TDataStdTreeNodeItemPtr anItem = itemDynamicCast<DFBrowserPane_TDataStdTreeNodeItem>(anItemBase);
if (anItem->GetAttribute() == theAttribute)
return anIndex;
QModelIndex aSubIndex = FindIndex (theAttribute, anIndex);
if (aSubIndex.isValid())
return aSubIndex;
}
return QModelIndex();
}