mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +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:
@@ -32,13 +32,12 @@
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
DFBrowserPane_AttributePane::DFBrowserPane_AttributePane()
|
||||
: DFBrowserPane_AttributePaneAPI(), myMainWidget (0), myTableView (0), myPaneModel (0)
|
||||
: DFBrowserPane_AttributePaneAPI(), myMainWidget (0), myTableView (0)
|
||||
{
|
||||
myPaneModel = new DFBrowserPane_AttributePaneModel();
|
||||
|
||||
QList<QVariant> aHeaderValues;
|
||||
aHeaderValues << "Values";
|
||||
getPaneModel()->SetHeaderValues (aHeaderValues, Qt::Horizontal);
|
||||
getPaneModel()->SetColumnCount (getColumnCount());
|
||||
getPaneModel()->SetHeaderValues (getHeaderValues(Qt::Horizontal), Qt::Horizontal);
|
||||
|
||||
mySelectionModels.push_back (new QItemSelectionModel (myPaneModel));
|
||||
}
|
||||
@@ -66,6 +65,14 @@ QWidget* DFBrowserPane_AttributePane::CreateWidget (QWidget* theParent)
|
||||
myTableView = new DFBrowserPane_TableView (aMainWidget, getTableColumnWidths());
|
||||
myTableView->SetModel (myPaneModel);
|
||||
QTableView* aTableView = myTableView->GetTableView();
|
||||
DFBrowserPane_AttributePaneModel* aPaneModel = dynamic_cast<DFBrowserPane_AttributePaneModel*>(myPaneModel);
|
||||
if (aPaneModel)
|
||||
{
|
||||
if (aPaneModel->GetOrientation() == Qt::Vertical)
|
||||
aTableView->horizontalHeader()->setVisible (!aPaneModel->HeaderValues (Qt::Horizontal).isEmpty());
|
||||
else
|
||||
aTableView->verticalHeader()->setVisible (!aPaneModel->HeaderValues (Qt::Vertical).isEmpty());
|
||||
}
|
||||
aTableView->setSelectionModel (mySelectionModels.front());
|
||||
aTableView->setSelectionBehavior (QAbstractItemView::SelectRows);
|
||||
|
||||
@@ -85,6 +92,9 @@ void DFBrowserPane_AttributePane::Init (const Handle(TDF_Attribute)& theAttribut
|
||||
QList<QVariant> aValues;
|
||||
GetValues (theAttribute, aValues);
|
||||
getPaneModel()->Init (aValues);
|
||||
|
||||
if (myTableView)
|
||||
myTableView->GetTableView()->resizeColumnToContents (0);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
@@ -111,6 +121,19 @@ QVariant DFBrowserPane_AttributePane::GetAttributeInfo (const Handle(TDF_Attribu
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetShortAttributeInfo
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void DFBrowserPane_AttributePane::GetShortAttributeInfo (const Handle(TDF_Attribute)& theAttribute, QList<QVariant>& theValues)
|
||||
{
|
||||
QList<QVariant> aValues;
|
||||
GetValues(theAttribute, aValues);
|
||||
|
||||
for (int aValuesEvenId = 1; aValuesEvenId < aValues.size(); aValuesEvenId = aValuesEvenId + 2)
|
||||
theValues.append (aValues[aValuesEvenId]);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : GetAttributeInfoByType
|
||||
// purpose :
|
||||
|
Reference in New Issue
Block a user