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=nullptr) |
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 | onSelectDependents () |
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 () |
Tree view that allows drag & drop of document objects.
TreeWidget::TreeWidget | ( | const char * | name, |
QWidget * | parent = nullptr |
||
) |
References draftgeoutils.faces::bind(), Gui::BitmapFactory(), draftgeoutils.intersections::connect(), Gui::Application::Instance, Gui::TreeParams::Instance(), Gui::NoResolve, onAllowPartialRecompute(), onCloseDoc(), onCreateGroup(), onFinishEditing(), onHideInTree(), onMarkRecompute(), onPreSelectTimer(), onRecomputeObject(), onRelabelObject(), onReloadDoc(), onSearchObjects(), onSelectDependents(), 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 | ( | ) |
|
static |
References Gui::Application::Instance.
Referenced by Gui::SelectionSingleton::checkSelection().
QList< QTreeWidgetItem * > TreeWidget::childrenOfItem | ( | const QTreeWidgetItem & | item | ) | const |
References femsolver.elmer.sifio::isValid().
Referenced by keyPressEvent().
|
overrideprotected |
References App::Document::AllowPartialRecompute, draftgeoutils.intersections::connect(), Gui::Workbench::createLinkMenu(), Gui::DocumentItem::document(), DocumentType, App::Application::getActiveDocument(), App::GetApplication(), Base::Persistence::getClassTypeId(), Gui::SelectionSingleton::getCompleteSelection(), 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, Gui::Selection(), App::Application::setActiveDocument(), Gui::Application::setupContextMenu(), Gui::MenuManager::setupContextMenu(), Gui::ViewProvider::setupContextMenu(), Gui::DocumentItem::showHidden(), Gui::ViewProviderDocumentObject::showInTree(), and App::Document::SkipRecompute.
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
References Gui::ViewProvider::canDragAndDropObject(), Gui::ViewProviderDocumentObject::canDropObjectEx(), Gui::ViewProvider::canDropObjects(), DocumentType, Gui::ViewProviderDocumentObject::getObject(), Gui::DocumentObjectItem::getParentItem(), leaveEvent(), Gui::DocumentObjectItem::object(), and ObjectType.
|
overrideprotected |
|
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().
|
overrideprotected |
|
signal |
Referenced by onSearchObjects().
void TreeWidget::expandSelectedItems | ( | TreeItemMode | mode | ) |
References Gui::CollapseItem, Gui::ExpandItem, Gui::ExpandPath, Gui::SelectionObserver::isSelectionAttached(), and Gui::ToggleItem.
Referenced by StdCmdTreeCollapse::activated(), and StdCmdTreeExpand::activated().
DocumentItem * TreeWidget::getDocumentItem | ( | const Gui::Document * | doc | ) | const |
Referenced by Gui::DocumentObjectItem::getParentDocument(), itemSearch(), and selectLinkedObject().
|
static |
const char * TreeWidget::getTreeName | ( | ) | const |
Referenced by Gui::DocumentItem::DocumentItem().
|
overrideprotected |
References Gui::SelectionObserver::detachSelection().
|
static |
Referenced by getSelection(), Gui::Document::RestoreDocFile(), and Gui::Document::SaveDocFile().
|
static |
References Gui::Application::getDocument(), and Gui::Application::Instance.
Referenced by Gui::ViewProviderDocumentObject::show().
void TreeWidget::itemSearch | ( | const QString & | text, |
bool | select | ||
) |
References Gui::SelectionSingleton::addSelection(), Gui::SelectionSingleton::clearSelection(), getDocumentItem(), Gui::Application::Instance, App::ObjectIdentifier::parse(), resetItemSearch(), draftutils.gui_utils::select(), Gui::Selection(), Gui::SelectionSingleton::selStackPush(), Gui::SelectionSingleton::setPreselect(), and Gui::SelectionChanges::TreeView.
|
overrideprotected |
References childrenOfItem(), and onSearchObjects().
|
overrideprotected |
References Gui::TreeParams::Instance(), Gui::SelectionSingleton::rmvPreselect(), and Gui::Selection().
Referenced by dragMoveEvent().
void Gui::TreeWidget::markItem | ( | const App::DocumentObject * | Obj, |
bool | mark | ||
) |
|
overrideprotected |
|
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::ViewProviderDocumentObject::getTransactionText(), Gui::MacroManager::Gui, Gui::Application::Instance, Gui::Application::macroManager(), Gui::DocumentObjectItem::object(), ObjectType, onReloadDoc(), App::Document::PartialDoc, Gui::Document::setActiveView(), and App::AutoTransaction::setEnable().
|
protectedslot |
References Base::BaseClass::getClassTypeId(), Gui::Application::getDocument(), and Gui::Application::Instance.
Referenced by contextMenuEvent().
|
protectedslot |
References App::Document::AllowPartialRecompute, Gui::DocumentItem::document(), DocumentType, and Gui::Document::getDocument().
Referenced by TreeWidget().
|
protectedslot |
References Gui::Command::Doc, Gui::DocumentItem::document(), DocumentType, and Draft::gui.
Referenced by TreeWidget().
|
protectedslot |
|
protectedslot |
References Gui::Application::getDocument(), Gui::ViewProviderDocumentObject::getObject(), Gui::Application::Instance, Gui::DocumentObjectItem::object(), and ObjectType.
Referenced by TreeWidget().
|
protectedslot |
References ObjectType.
Referenced by TreeWidget().
|
protectedslot |
|
protectedslot |
References App::DocumentObject::getDocument(), App::Document::getName(), App::DocumentObject::getNameInDocument(), Gui::DocumentObjectItem::getSubName(), Gui::TreeParams::Instance(), Gui::DocumentObjectItem::object(), ObjectType, Gui::Selection(), Gui::SelectionSingleton::setPreselect(), and Gui::SelectionChanges::TreeView.
Referenced by TreeWidget().
|
protectedslot |
References Gui::ViewProviderDocumentObject::getObject(), Gui::DocumentObjectItem::object(), and ObjectType.
Referenced by TreeWidget().
|
protectedslot |
Referenced by TreeWidget().
|
protectedslot |
|
protectedslot |
References emitSearchObjects().
Referenced by keyPressEvent(), and TreeWidget().
|
protectedslot |
References Gui::SelectionSingleton::addSelection(), Gui::DocumentItem::document(), DocumentType, App::DocumentObject::getDocument(), Gui::Document::getDocument(), Gui::ViewProviderDocumentObject::getObject(), Gui::DocumentObjectItem::object(), ObjectType, and Gui::Selection().
Referenced by TreeWidget().
|
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.
|
protectedslot |
References Gui::SelectionObserver::blockSelection(), 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().
|
protectedslot |
References DocumentType, Gui::DocumentObjectItem::getOwnerDocument(), ObjectType, and Gui::DocumentItem::setShowHidden().
Referenced by TreeWidget().
|
protectedslot |
References Gui::DocumentItem::document(), DocumentType, Gui::Document::getDocument(), and App::Document::SkipRecompute.
Referenced by TreeWidget().
|
protectedslot |
void TreeWidget::resetItemSearch | ( | ) |
Referenced by itemSearch(), and startItemSearch().
|
static |
|
overridevirtual |
void TreeWidget::selectAllInstances | ( | const ViewProviderDocumentObject & | vpd | ) |
References Gui::SelectionObserver::isSelectionAttached(), and onSelectTimer().
void TreeWidget::selectAllLinks | ( | App::DocumentObject * | obj | ) |
|
static |
References DocumentType.
Referenced by Gui::PropertyView::onTimer().
void TreeWidget::selectLinkedObject | ( | App::DocumentObject * | linked | ) |
|
overrideprotected |
References Gui::SelectionObserver::attachSelection(), and Gui::TreeParams::Instance().
|
overrideprotected |
Referenced by startDragging().
void TreeWidget::startDragging | ( | ) |
References startDrag().
void TreeWidget::startItemSearch | ( | QLineEdit * | edit | ) |
|
overrideprotected |
void TreeWidget::synchronizeSelectionCheckBoxes | ( | ) |
References Gui::DocumentObjectItem::setData().
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().
|
static |
|
friend |
|
friend |
|
static |
|
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(), onSelectDependents(), onShowHidden(), onStartEditing(), Gui::DocumentItem::populateItem(), Gui::DocumentItem::showItem(), startItemSearch(), Gui::DocumentItem::updateItemsVisibility(), and Gui::DocumentItem::updateSelection().