Tree view that allows drag & drop of document objects. More...

#include <Tree.h>

Classes

struct  SelInfo
 

Public Member Functions

bool eventFilter (QObject *, QEvent *ev) override
 
void expandSelectedItems (TreeItemMode mode)
 
DocumentItemgetDocumentItem (const Gui::Document *) const
 
const char * getTreeName () const
 
void itemSearch (const QString &text, bool select)
 
void markItem (const App::DocumentObject *Obj, bool mark)
 
void resetItemSearch ()
 
virtual void selectAll () override
 
void selectAllInstances (const ViewProviderDocumentObject &vpd)
 
void selectAllLinks (App::DocumentObject *obj)
 
void selectLinkedObject (App::DocumentObject *linked)
 
void startDragging ()
 
void startItemSearch (QLineEdit *)
 
void synchronizeSelectionCheckBoxes ()
 
void syncView (ViewProviderDocumentObject *vp)
 
 TreeWidget (const char *name, QWidget *parent=0)
 
 ~TreeWidget ()
 
- Public Member Functions inherited from Gui::SelectionObserver
void attachSelection ()
 Attaches to the selection. More...
 
bool blockConnection (bool block)
 
void detachSelection ()
 Detaches from the selection. More...
 
bool isConnectionAttached () const
 
bool isConnectionBlocked () const
 
 SelectionObserver (bool attach=true, int resolve=1)
 Constructor. More...
 
 SelectionObserver (const Gui::ViewProviderDocumentObject *vp, bool attach=true, int resolve=1)
 Constructor. More...
 
virtual ~SelectionObserver ()
 

Static Public Member Functions

static void checkTopParent (App::DocumentObject *&obj, std::string &subname)
 
static std::vector< SelInfogetSelection (App::Document *doc=0)
 
static TreeWidgetinstance ()
 
static bool isObjectShowable (App::DocumentObject *obj)
 
static void scrollItemToTop ()
 
static Gui::DocumentselectedDocument ()
 
static void updateStatus (bool delay=true)
 

Static Public Attributes

static const int DocumentType = 1000
 
static const int ObjectType = 1001
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *e) override
 
void drawRow (QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override
 
void onSelectionChanged (const SelectionChanges &msg) override
 Observer message from the Selection. More...
 

Drag and drop

class DocumentItem
 
class DocumentObjectItem
 
void startDrag (Qt::DropActions supportedActions) override
 
bool dropMimeData (QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action) override
 
Qt::DropActions supportedDropActions () const override
 
QMimeData * mimeData (const QList< QTreeWidgetItem * > items) const override
 
void dragEnterEvent (QDragEnterEvent *event) override
 
void dragLeaveEvent (QDragLeaveEvent *event) override
 
void dragMoveEvent (QDragMoveEvent *event) override
 
void dropEvent (QDropEvent *event) override
 
bool event (QEvent *e) override
 
void keyPressEvent (QKeyEvent *event) override
 
void mouseDoubleClickEvent (QMouseEvent *event) override
 
void showEvent (QShowEvent *) override
 
void hideEvent (QHideEvent *) override
 
void leaveEvent (QEvent *) override
 
void onCreateGroup ()
 
void onRelabelObject ()
 
void onActivateDocument (QAction *)
 
void onStartEditing ()
 
void onFinishEditing ()
 
void onSkipRecompute (bool on)
 
void onAllowPartialRecompute (bool on)
 
void onReloadDoc ()
 
void onCloseDoc ()
 
void onMarkRecompute ()
 
void onRecomputeObject ()
 
void onPreSelectTimer ()
 
void onSelectTimer ()
 
void onShowHidden ()
 
void onHideInTree ()
 
void onSearchObjects ()
 
void emitSearchObjects ()
 

Detailed Description

Tree view that allows drag & drop of document objects.

Author
Werner Mayer

Constructor & Destructor Documentation

◆ TreeWidget()

◆ ~TreeWidget()

TreeWidget::~TreeWidget ( )

Member Function Documentation

◆ checkTopParent()

void TreeWidget::checkTopParent ( App::DocumentObject *&  obj,
std::string &  subname 
)
static

◆ contextMenuEvent()

◆ dragEnterEvent()

void TreeWidget::dragEnterEvent ( QDragEnterEvent *  event)
overrideprotected

◆ dragLeaveEvent()

void TreeWidget::dragLeaveEvent ( QDragLeaveEvent *  event)
overrideprotected

◆ dragMoveEvent()

◆ drawRow()

void TreeWidget::drawRow ( QPainter *  painter,
const QStyleOptionViewItem &  options,
const QModelIndex &  index 
) const
overrideprotected

◆ dropEvent()

void TreeWidget::dropEvent ( QDropEvent *  event)
overrideprotected

References Gui::SelectionSingleton::addSelection(), Gui::Command::App, Gui::MacroManager::App, Gui::ViewProvider::canDragAndDropObject(), Gui::ViewProviderDocumentObject::canDropObjectEx(), Gui::ViewProvider::canDropObjects(), Gui::SelectionSingleton::clearCompleteSelection(), App::AutoTransaction::close(), App::Document::copyObject(), Gui::DocumentItem::document(), DocumentType, Gui::ViewProvider::dragObject(), Gui::ViewProvider::dropObjectEx(), App::GetApplication(), App::Application::getDocument(), Gui::Application::getDocument(), App::DocumentObject::getDocument(), Gui::Document::getDocument(), App::ExtensionContainer::getExtensionByType(), App::GeoFeatureGroupExtension::getGroupOfObject(), App::DocumentObject::getInListEx(), Gui::getMainWindow(), App::Document::getName(), App::DocumentObject::getNameInDocument(), App::Document::getObject(), Gui::ViewProviderDocumentObject::getObject(), Gui::Command::getObjectCmd(), Gui::DocumentObjectItem::getOwnerDocument(), Gui::DocumentObjectItem::getParentItem(), Gui::DocumentObjectItem::getSubName(), App::Document::getUniqueObjectName(), App::PropertyPlacement::getValue(), Gui::Application::getViewProvider(), Gui::MacroManager::Gui, Gui::Application::Instance, Gui::TreeParams::Instance(), Base::Placement::inverse(), Base::Matrix4D::inverseGauss(), Gui::DocumentObjectItem::isGroup(), Gui::Application::macroManager(), App::Document::moveObject(), Gui::DocumentObjectItem::object(), ObjectType, App::Document::recompute(), Gui::Selection(), Gui::SelectionSingleton::selStackPush(), Gui::Document::setActiveView(), Gui::SelectionSingleton::setSelection(), App::PropertyPlacement::setValueIfChanged(), and Base::Placement::toMatrix().

◆ dropMimeData()

bool TreeWidget::dropMimeData ( QTreeWidgetItem parent,
int  index,
const QMimeData *  data,
Qt::DropAction  action 
)
overrideprotected

◆ emitSearchObjects

void Gui::TreeWidget::emitSearchObjects ( )
signal

Referenced by onSearchObjects().

◆ event()

bool TreeWidget::event ( QEvent e)
overrideprotected

◆ eventFilter()

bool TreeWidget::eventFilter ( QObject ,
QEvent ev 
)
override

◆ expandSelectedItems()

◆ getDocumentItem()

DocumentItem * TreeWidget::getDocumentItem ( const Gui::Document doc) const

◆ getSelection()

◆ getTreeName()

const char * TreeWidget::getTreeName ( ) const

◆ hideEvent()

void TreeWidget::hideEvent ( QHideEvent *  ev)
overrideprotected

◆ instance()

TreeWidget * TreeWidget::instance ( void  )
static

◆ isObjectShowable()

bool TreeWidget::isObjectShowable ( App::DocumentObject obj)
static

◆ itemSearch()

◆ keyPressEvent()

void TreeWidget::keyPressEvent ( QKeyEvent *  event)
overrideprotected

References onSearchObjects().

◆ leaveEvent()

void TreeWidget::leaveEvent ( QEvent )
overrideprotected

◆ markItem()

void Gui::TreeWidget::markItem ( const App::DocumentObject Obj,
bool  mark 
)

◆ mimeData()

QMimeData * TreeWidget::mimeData ( const QList< QTreeWidgetItem * >  items) const
overrideprotected

◆ mouseDoubleClickEvent()

◆ onActivateDocument

void TreeWidget::onActivateDocument ( QAction *  active)
protectedslot

◆ onAllowPartialRecompute

void TreeWidget::onAllowPartialRecompute ( bool  on)
protectedslot

◆ onCloseDoc

void TreeWidget::onCloseDoc ( )
protectedslot

◆ onCreateGroup

◆ onFinishEditing

◆ onHideInTree

void TreeWidget::onHideInTree ( )
protectedslot

References ObjectType.

Referenced by TreeWidget().

◆ onMarkRecompute

◆ onPreSelectTimer

◆ onRecomputeObject

void TreeWidget::onRecomputeObject ( )
protectedslot

◆ onRelabelObject

void TreeWidget::onRelabelObject ( )
protectedslot

Referenced by TreeWidget().

◆ onReloadDoc

◆ onSearchObjects

void TreeWidget::onSearchObjects ( )
protectedslot

References emitSearchObjects().

Referenced by keyPressEvent(), and TreeWidget().

◆ onSelectionChanged()

void TreeWidget::onSelectionChanged ( const SelectionChanges msg)
overrideprotectedvirtual

◆ onSelectTimer

◆ onShowHidden

void TreeWidget::onShowHidden ( )
protectedslot

◆ onSkipRecompute

void TreeWidget::onSkipRecompute ( bool  on)
protectedslot

◆ onStartEditing

◆ resetItemSearch()

void TreeWidget::resetItemSearch ( )

Referenced by itemSearch(), and startItemSearch().

◆ scrollItemToTop()

◆ selectAll()

◆ selectAllInstances()

void TreeWidget::selectAllInstances ( const ViewProviderDocumentObject vpd)

◆ selectAllLinks()

◆ selectedDocument()

Gui::Document * TreeWidget::selectedDocument ( )
static

References DocumentType.

Referenced by Gui::PropertyView::onTimer().

◆ selectLinkedObject()

◆ showEvent()

void TreeWidget::showEvent ( QShowEvent *  ev)
overrideprotected

◆ startDrag()

void TreeWidget::startDrag ( Qt::DropActions  supportedActions)
overrideprotected

Referenced by startDragging().

◆ startDragging()

void TreeWidget::startDragging ( )

References startDrag().

◆ startItemSearch()

◆ supportedDropActions()

Qt::DropActions TreeWidget::supportedDropActions ( ) const
overrideprotected

◆ synchronizeSelectionCheckBoxes()

void TreeWidget::synchronizeSelectionCheckBoxes ( )

◆ syncView()

◆ updateStatus()

void TreeWidget::updateStatus ( bool  delay = true)
static

Friends And Related Function Documentation

◆ DocumentItem

friend class DocumentItem
friend

◆ DocumentObjectItem

friend class DocumentObjectItem
friend

Member Data Documentation

◆ DocumentType

◆ ObjectType


The documentation for this class was generated from the following files:
  • Sources/FreeCAD/src/Gui/Tree.h
  • Sources/FreeCAD/src/Gui/Tree.cpp