Tree view that allows drag & drop of document objects. More...
#include <Tree.h>
Classes | |
struct SelInfo | |
Static Public Member Functions | |
static void checkTopParent (App::DocumentObject *&obj, std::string &subname) | |
static std::vector< SelInfo > getSelection (App::Document *doc=0) | |
static TreeWidget * instance () | |
static bool isObjectShowable (App::DocumentObject *obj) | |
static void scrollItemToTop () | |
static Gui::Document * selectedDocument () | |
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.
Constructor & Destructor Documentation
◆ TreeWidget()
TreeWidget::TreeWidget | ( | const char * | name, |
QWidget * | parent = 0 |
||
) |
References Gui::BitmapFactory(), Gui::Application::Instance, onAllowPartialRecompute(), onCloseDoc(), onCreateGroup(), onFinishEditing(), onHideInTree(), onMarkRecompute(), onPreSelectTimer(), onRecomputeObject(), onRelabelObject(), onReloadDoc(), onSearchObjects(), onSelectTimer(), onShowHidden(), onSkipRecompute(), Gui::Application::signalActiveDocument, Gui::Application::signalChangedObject, Gui::Application::signalDeleteDocument, Gui::Application::signalNewDocument, Gui::Application::signalRelabelDocument, Gui::Application::signalRenameDocument, and Gui::Application::signalShowHidden.
◆ ~TreeWidget()
TreeWidget::~TreeWidget | ( | ) |
Member Function Documentation
◆ checkTopParent()
|
static |
References Gui::Application::Instance.
Referenced by Gui::SelectionSingleton::checkSelection().
◆ contextMenuEvent()
|
overrideprotected |
References App::Document::AllowPartialRecompute, Gui::Workbench::createLinkMenu(), Gui::DocumentItem::document(), DocumentType, App::Application::getActiveDocument(), App::GetApplication(), Base::Persistence::getClassTypeId(), App::DocumentObject::getDocument(), Gui::Document::getDocument(), App::Application::getDocuments(), Gui::MenuManager::getInstance(), Gui::ViewProviderDocumentObject::getObject(), Gui::Application::Instance, Base::BaseClass::isDerivedFrom(), Gui::ViewProvider::isEditing(), Gui::DocumentObjectItem::object(), ObjectType, onActivateDocument(), onStartEditing(), App::Document::PartialDoc, App::Application::setActiveDocument(), Gui::MenuManager::setupContextMenu(), Gui::Application::setupContextMenu(), Gui::ViewProvider::setupContextMenu(), Gui::DocumentItem::showHidden(), Gui::ViewProviderDocumentObject::showInTree(), and App::Document::SkipRecompute.
◆ dragEnterEvent()
|
overrideprotected |
◆ dragLeaveEvent()
|
overrideprotected |
◆ dragMoveEvent()
|
overrideprotected |
References Gui::ViewProvider::canDragAndDropObject(), Gui::ViewProviderDocumentObject::canDropObjectEx(), Gui::ViewProvider::canDropObjects(), DocumentType, Gui::ViewProviderDocumentObject::getObject(), Gui::DocumentObjectItem::getParentItem(), leaveEvent(), Gui::DocumentObjectItem::object(), and ObjectType.
◆ drawRow()
|
overrideprotected |
◆ dropEvent()
|
overrideprotected |
References Gui::SelectionSingleton::addSelection(), Gui::MacroManager::App, Gui::Command::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(), App::DocumentObject::getDocument(), Gui::Application::getDocument(), Gui::Document::getDocument(), App::ExtensionContainer::getExtensionByType(), App::GeoFeatureGroupExtension::getGroupOfObject(), Gui::getMainWindow(), App::Document::getName(), App::DocumentObject::getNameInDocument(), Gui::ViewProviderDocumentObject::getObject(), App::Document::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()
|
overrideprotected |
◆ emitSearchObjects
|
signal |
Referenced by onSearchObjects().
◆ event()
◆ eventFilter()
◆ expandSelectedItems()
void TreeWidget::expandSelectedItems | ( | TreeItemMode | mode | ) |
References Gui::CollapseItem, Gui::ExpandItem, Gui::ExpandPath, Gui::SelectionObserver::isConnectionAttached(), and Gui::ToggleItem.
Referenced by StdCmdTreeCollapse::activated(), and StdCmdTreeExpand::activated().
◆ getDocumentItem()
DocumentItem * TreeWidget::getDocumentItem | ( | const Gui::Document * | doc | ) | const |
Referenced by Gui::DocumentObjectItem::getParentDocument(), itemSearch(), and selectLinkedObject().
◆ getSelection()
|
static |
◆ getTreeName()
const char * TreeWidget::getTreeName | ( | ) | const |
Referenced by Gui::DocumentItem::DocumentItem().
◆ hideEvent()
|
overrideprotected |
References Gui::SelectionObserver::detachSelection().
◆ instance()
|
static |
Referenced by getSelection(), Gui::Document::RestoreDocFile(), and Gui::Document::SaveDocFile().
◆ isObjectShowable()
|
static |
References Gui::Application::getDocument(), and Gui::Application::Instance.
Referenced by Gui::ViewProviderDocumentObject::show().
◆ itemSearch()
void TreeWidget::itemSearch | ( | const QString & | text, |
bool | select | ||
) |
◆ keyPressEvent()
|
overrideprotected |
References onSearchObjects().
◆ leaveEvent()
|
overrideprotected |
References Gui::TreeParams::Instance(), Gui::SelectionSingleton::rmvPreselect(), and Gui::Selection().
Referenced by dragMoveEvent().
◆ markItem()
void Gui::TreeWidget::markItem | ( | const App::DocumentObject * | Obj, |
bool | mark | ||
) |
◆ mimeData()
|
overrideprotected |
◆ mouseDoubleClickEvent()
|
overrideprotected |
References Gui::DocumentItem::document(), DocumentType, Gui::ViewProvider::doubleClicked(), Gui::Application::editDocument(), Base::BaseClass::getClassTypeId(), Gui::ViewProviderDocumentObject::getObject(), Gui::Command::getObjectCmd(), Gui::DocumentObjectItem::getOwnerDocument(), Gui::MacroManager::Gui, Gui::Application::Instance, Gui::Application::macroManager(), Gui::DocumentObjectItem::object(), ObjectType, onReloadDoc(), App::Document::PartialDoc, Gui::Document::setActiveView(), and App::AutoTransaction::setEnable().
◆ onActivateDocument
|
protectedslot |
References Base::BaseClass::getClassTypeId(), Gui::Application::getDocument(), and Gui::Application::Instance.
Referenced by contextMenuEvent().
◆ onAllowPartialRecompute
|
protectedslot |
References App::Document::AllowPartialRecompute, Gui::DocumentItem::document(), DocumentType, and Gui::Document::getDocument().
Referenced by TreeWidget().
◆ onCloseDoc
|
protectedslot |
References Gui::Command::Doc, Gui::DocumentItem::document(), DocumentType, and Gui::Document::getDocument().
Referenced by TreeWidget().
◆ onCreateGroup
|
protectedslot |
◆ onFinishEditing
|
protectedslot |
References Gui::Application::getDocument(), Gui::ViewProviderDocumentObject::getObject(), Gui::Application::Instance, Gui::DocumentObjectItem::object(), and ObjectType.
Referenced by TreeWidget().
◆ onHideInTree
|
protectedslot |
References ObjectType.
Referenced by TreeWidget().
◆ onMarkRecompute
|
protectedslot |
◆ onPreSelectTimer
|
protectedslot |
References App::DocumentObject::getDocument(), App::Document::getName(), App::DocumentObject::getNameInDocument(), Gui::DocumentObjectItem::getSubName(), Gui::TreeParams::Instance(), Gui::DocumentObjectItem::object(), ObjectType, Gui::Selection(), and Gui::SelectionSingleton::setPreselect().
Referenced by TreeWidget().
◆ onRecomputeObject
|
protectedslot |
References Gui::ViewProviderDocumentObject::getObject(), Gui::DocumentObjectItem::object(), and ObjectType.
Referenced by TreeWidget().
◆ onRelabelObject
|
protectedslot |
Referenced by TreeWidget().
◆ onReloadDoc
|
protectedslot |
◆ onSearchObjects
|
protectedslot |
References emitSearchObjects().
Referenced by keyPressEvent(), and TreeWidget().
◆ onSelectionChanged()
|
overrideprotectedvirtual |
Observer message from the Selection.
Implements Gui::SelectionObserver.
References Gui::SelectionChanges::AddSelection, Gui::SelectionChanges::ClrSelection, Gui::TreeParams::Instance(), Gui::SelectionChanges::RmvSelection, and Gui::SelectionChanges::SetSelection.
◆ onSelectTimer
|
protectedslot |
References Gui::SelectionObserver::blockConnection(), Gui::DocumentItem::clearSelection(), Gui::TreeParams::Instance(), Gui::Selection(), Gui::DocumentItem::selectItems(), Gui::DocumentItem::SR_EXPAND, and Gui::DocumentItem::SR_SELECT.
Referenced by getSelection(), selectAllInstances(), selectAllLinks(), selectLinkedObject(), and TreeWidget().
◆ onShowHidden
|
protectedslot |
References DocumentType, Gui::DocumentObjectItem::getOwnerDocument(), ObjectType, and Gui::DocumentItem::setShowHidden().
Referenced by TreeWidget().
◆ onSkipRecompute
|
protectedslot |
References Gui::DocumentItem::document(), DocumentType, Gui::Document::getDocument(), and App::Document::SkipRecompute.
Referenced by TreeWidget().
◆ onStartEditing
|
protectedslot |
◆ resetItemSearch()
void TreeWidget::resetItemSearch | ( | ) |
Referenced by itemSearch(), and startItemSearch().
◆ scrollItemToTop()
|
static |
◆ selectAll()
|
overridevirtual |
◆ selectAllInstances()
void TreeWidget::selectAllInstances | ( | const ViewProviderDocumentObject & | vpd | ) |
References Gui::SelectionObserver::isConnectionAttached(), and onSelectTimer().
◆ selectAllLinks()
void TreeWidget::selectAllLinks | ( | App::DocumentObject * | obj | ) |
◆ selectedDocument()
|
static |
References DocumentType.
Referenced by Gui::PropertyView::onTimer().
◆ selectLinkedObject()
void TreeWidget::selectLinkedObject | ( | App::DocumentObject * | linked | ) |
◆ showEvent()
|
overrideprotected |
References Gui::SelectionObserver::attachSelection(), and Gui::TreeParams::Instance().
◆ startDrag()
|
overrideprotected |
Referenced by startDragging().
◆ startDragging()
void TreeWidget::startDragging | ( | ) |
References startDrag().
◆ startItemSearch()
void TreeWidget::startItemSearch | ( | QLineEdit * | edit | ) |
◆ supportedDropActions()
|
overrideprotected |
◆ syncView()
void TreeWidget::syncView | ( | ViewProviderDocumentObject * | vp | ) |
References Gui::DocumentItem::document(), Gui::TreeParams::Instance(), and Gui::Document::setActiveView().
Referenced by Gui::DocumentItem::selectItems(), and Gui::DocumentItem::updateItemSelection().
◆ updateStatus()
|
static |
Referenced by Gui::Document::slotRecomputed().
Friends And Related Function Documentation
◆ DocumentItem
|
friend |
◆ DocumentObjectItem
|
friend |
Member Data Documentation
◆ DocumentType
|
static |
◆ ObjectType
|
static |
Referenced by contextMenuEvent(), Gui::TreeWidgetEditDelegate::createEditor(), dragMoveEvent(), dropEvent(), Gui::DocumentItem::findItem(), Gui::DocumentItem::findRootIndex(), Gui::DocumentObjectItem::getParentItem(), getSelection(), mimeData(), mouseDoubleClickEvent(), onCreateGroup(), onFinishEditing(), onHideInTree(), onMarkRecompute(), onPreSelectTimer(), onRecomputeObject(), onShowHidden(), onStartEditing(), Gui::DocumentItem::populateItem(), Gui::DocumentItem::showItem(), startItemSearch(), Gui::DocumentItem::updateItemsVisibility(), and Gui::DocumentItem::updateSelection().
The documentation for this class was generated from the following files:
- src/Gui/Tree.h
- src/Gui/Tree.cpp