SHAPER  9.12.0
XGUI_ObjectsBrowser Class Reference

Object browser window object. More...

Inheritance diagram for XGUI_ObjectsBrowser:
Inheritance graph

Public Slots

void onEditItem ()
 Called on Edit command request. More...
 

Signals

void selectionChanged ()
 Emited when selection is changed. More...
 
void contextMenuRequested (QContextMenuEvent *theEvent)
 Emited on context menu request. More...
 
void headerMouseDblClicked (const QModelIndex &)
 Segnal is emitted when user cliks by mouse in header label of object browser. More...
 
void sizeChanged ()
 An signal emitted on resize of the Object Browser. More...
 

Public Member Functions

 XGUI_ObjectsBrowser (QWidget *theParent, XGUI_Workshop *theWorkshop)
 Constructor. More...
 
XGUI_DataModeldataModel () const
 Returns Model which provides access to data objects. More...
 
QObjectPtrList selectedObjects (QModelIndexList *theIndexes=0) const
 Returns list of currently selected objects. More...
 
void setObjectsSelected (const QObjectPtrList &theObjects)
 Set selected list of objects. More...
 
void ensureVisible (const ObjectPtr theObject)
 Scroll TreeView to make given object visible. More...
 
QModelIndexList selectedIndexes () const
 Returns currently selected indexes. More...
 
XGUI_DataTreetreeView () const
 Returns TreeView widget. More...
 
QLabelactiveDocLabel () const
 Returns active doc label object. More...
 
void rebuildDataTree ()
 Rebuild data tree. More...
 
void clearContent ()
 Resets the object browser into initial state. More...
 
void initialize (ModuleBase_ITreeNode *theRoot)
 Initialize the Object browser. More...
 
std::list< bool > getStateForDoc (DocumentPtr theDoc) const
 Returns list of folders opened state for the given document. More...
 
void setStateForDoc (DocumentPtr theDoc, const std::list< bool > &theStates)
 Set folders opened state for the given document. More...
 
XGUI_Workshopworkshop () const
 Returns current workshop. More...
 
void onSelectionChanged ()
 
void updateAllIndexes (int theColumn=0, const QModelIndex &theParent=QModelIndex())
 Updates all items of object browser. More...
 
QMap< ObjectPtr, bool > getFoldersState (DocumentPtr theDoc) const
 
void setFoldersState (const QMap< ObjectPtr, bool > &theStates)
 

Protected Member Functions

void resizeEvent (QResizeEvent *theEvent)
 redefinition of a virtual method More...
 

Detailed Description

Object browser window object.

Represents data tree of current data structure

Constructor & Destructor Documentation

◆ XGUI_ObjectsBrowser()

XGUI_ObjectsBrowser::XGUI_ObjectsBrowser ( QWidget theParent,
XGUI_Workshop theWorkshop 
)

Constructor.

Parameters
theParenta parent widget

Member Function Documentation

◆ dataModel()

XGUI_DataModel* XGUI_ObjectsBrowser::dataModel ( ) const
inline

Returns Model which provides access to data objects.

◆ selectedObjects()

QObjectPtrList XGUI_ObjectsBrowser::selectedObjects ( QModelIndexList *  theIndexes = 0) const

Returns list of currently selected objects.

Parameters
theIndexes- output list of corresponded indexes (can be NULL)

◆ setObjectsSelected()

void XGUI_ObjectsBrowser::setObjectsSelected ( const QObjectPtrList &  theObjects)

Set selected list of objects.

Parameters
theObjectslist of objects to select

◆ ensureVisible()

void XGUI_ObjectsBrowser::ensureVisible ( const ObjectPtr  theObject)

Scroll TreeView to make given object visible.

Parameters
theObjectobject to make it visible

◆ selectedIndexes()

QModelIndexList XGUI_ObjectsBrowser::selectedIndexes ( ) const
inline

Returns currently selected indexes.

◆ treeView()

XGUI_DataTree* XGUI_ObjectsBrowser::treeView ( ) const
inline

Returns TreeView widget.

◆ activeDocLabel()

QLabel* XGUI_ObjectsBrowser::activeDocLabel ( ) const
inline

Returns active doc label object.

◆ rebuildDataTree()

void XGUI_ObjectsBrowser::rebuildDataTree ( )

Rebuild data tree.

◆ clearContent()

void XGUI_ObjectsBrowser::clearContent ( )

Resets the object browser into initial state.

◆ initialize()

void XGUI_ObjectsBrowser::initialize ( ModuleBase_ITreeNode theRoot)

Initialize the Object browser.

◆ getStateForDoc()

std::list< bool > XGUI_ObjectsBrowser::getStateForDoc ( DocumentPtr  theDoc) const

Returns list of folders opened state for the given document.

Parameters
theDocthe document
Returns
list of booleans with state expanded or not

◆ setStateForDoc()

void XGUI_ObjectsBrowser::setStateForDoc ( DocumentPtr  theDoc,
const std::list< bool > &  theStates 
)

Set folders opened state for the given document.

Parameters
theDocthe document
theStateslist of booleans with state expanded or not

◆ workshop()

XGUI_Workshop* XGUI_ObjectsBrowser::workshop ( ) const
inline

Returns current workshop.

◆ updateAllIndexes()

void XGUI_ObjectsBrowser::updateAllIndexes ( int  theColumn = 0,
const QModelIndex &  theParent = QModelIndex() 
)

Updates all items of object browser.

Parameters
theColumn- column of items
theParent- a parent item (by default from root)

◆ onEditItem

void XGUI_ObjectsBrowser::onEditItem ( )
slot

Called on Edit command request.

◆ selectionChanged

void XGUI_ObjectsBrowser::selectionChanged ( )
signal

Emited when selection is changed.

◆ contextMenuRequested

void XGUI_ObjectsBrowser::contextMenuRequested ( QContextMenuEvent *  theEvent)
signal

Emited on context menu request.

◆ headerMouseDblClicked

void XGUI_ObjectsBrowser::headerMouseDblClicked ( const QModelIndex &  )
signal

Segnal is emitted when user cliks by mouse in header label of object browser.

◆ sizeChanged

void XGUI_ObjectsBrowser::sizeChanged ( )
signal

An signal emitted on resize of the Object Browser.

◆ resizeEvent()

void XGUI_ObjectsBrowser::resizeEvent ( QResizeEvent *  theEvent)
protected

redefinition of a virtual method