#include <MDIViewPage.h>
Public Slots | |
void | onTimer () |
void | saveDXF (void) |
void | savePDF (void) |
void | saveSVG (void) |
void | sceneSelectionChanged () |
update Tree Selection from QGraphicsScene selection More... | |
void | toggleFrame (void) |
void | toggleKeepUpdated (void) |
void | viewAll () |
Public Slots inherited from Gui::MDIView | |
virtual void | setOverrideCursor (const QCursor &) |
virtual void | restoreOverrideCursor () |
Public Member Functions | |
void | addChildrenToPage (void) |
bool | addView (const App::DocumentObject *obj) |
void | attachTemplate (TechDraw::DrawTemplate *obj) |
void | blockSceneSelection (bool isBlocked) |
void | centerOnPage (void) |
void | clearSceneSelection () |
void | contextMenuEvent (QContextMenuEvent *event) |
void | fixOrphans (bool force=false) |
TechDraw::DrawPage * | getPage () |
PyObject * | getPyObject () |
This method returns the Python wrapper for a C++ object. More... | |
QGSPage * | getQGSPage (void) |
QGVPage * | getQGVPage (void) |
QPointF | getTemplateCenter (TechDraw::DrawTemplate *obj) |
ViewProviderPage * | getViewProviderPage () |
void | matchSceneRectToTemplate (void) |
MDIViewPage (ViewProviderPage *page, Gui::Document *doc, QWidget *parent=nullptr) | |
bool | onHasMsg (const char *pMsg) const |
Message handler test. More... | |
bool | onMsg (const char *pMsg, const char **ppReturn) |
Message handler. More... | |
void | onSelectionChanged (const Gui::SelectionChanges &msg) |
Observer message from the Tree Selection mechanism. More... | |
void | preSelectionChanged (const QPoint &pos) |
void | print () |
Print content of view. More... | |
void | print (QPrinter *printer) |
void | printPdf () |
Print to PDF file. More... | |
void | printPdf (std::string file) |
void | printPreview () |
Show a preview dialog. More... | |
void | redraw1View (TechDraw::DrawView *dv) |
void | redrawAllViews (void) |
void | saveDXF (std::string file) |
void | savePDF (std::string file) |
void | saveSVG (std::string file) |
void | selectQGIView (App::DocumentObject *obj, bool state) |
QGraphicsScene selection routines. More... | |
void | setDocumentName (const std::string &) |
void | setDocumentObject (const std::string &) |
void | setTabText (std::string t) |
void | updateTemplate (bool force=false) |
virtual | ~MDIViewPage () |
Public Member Functions inherited from Gui::MDIView | |
virtual bool | canClose (void) |
overwrite when checking on close state More... | |
virtual void | deleteSelf () |
delete itself More... | |
virtual PyObject * | getPyObject () |
This method returns the Python wrapper for a C++ object. More... | |
MDIView (Gui::Document *pcDocument, QWidget *parent, Qt::WindowFlags wflags=Qt::WindowFlags()) | |
View constructor Attach the view to the given document. More... | |
virtual bool | onHasMsg (const char *pMsg) const |
Message handler test. More... | |
virtual bool | onMsg (const char *pMsg, const char **ppReturn) |
Message handler. More... | |
virtual void | onRelabel (Gui::Document *pDoc) |
get called when the document is updated More... | |
virtual void | viewAll () |
~MDIView () | |
View destructor Detach the view from the document, if attached. More... | |
virtual QStringList | undoActions () const |
virtual QStringList | redoActions () const |
QSize | minimumSizeHint () const |
virtual void | setCurrentViewMode (ViewMode mode) |
If b is set to FullScreen the MDI view is displayed in full screen mode, if b is set to TopLevel then it is displayed as an own top-level window, otherwise (Normal) as tabbed window. More... | |
ViewMode | currentViewMode () const |
template<typename _T > | |
_T | getActiveObject (const char *name, App::DocumentObject **parent=nullptr, std::string *subname=nullptr) const |
access getter for the active object list More... | |
void | setActiveObject (App::DocumentObject *o, const char *n, const char *subname=nullptr) |
bool | hasActiveObject (const char *n) const |
bool | isActiveObject (App::DocumentObject *o, const char *n, const char *subname=nullptr) const |
virtual bool | containsViewProvider (const ViewProvider *) const |
containsViewProvider Checks if the given view provider is part of this view. The default implementation returns false. More... | |
void | savePrinterSettings (QPrinter *printer) |
Save the printer configuration. More... | |
void | restorePrinterSettings (QPrinter *printer) |
Restore the printer configuration. More... | |
Public Member Functions inherited from Gui::BaseView | |
BaseView (Gui::Document *pcDocument=nullptr) | |
View constructor Attach the view to the given document. More... | |
virtual | ~BaseView () |
View destructor Detach the view from the document, if attached! More... | |
void | setDocument (Gui::Document *pcDocument) |
sets the view to another document (called by Application) More... | |
void | onClose (void) |
is sent from the document in order to close the document More... | |
Gui::Document * | getGuiDocument () const |
returns the document the view is attached to More... | |
App::Document * | getAppDocument () const |
returns the document the view is attached to More... | |
bool | isPassive (void) const |
indicates if the view is in passive mode More... | |
virtual void | onUpdate (void) |
get called when the document is updated More... | |
virtual void | onRename (Gui::Document *) |
get called when the document is renamed (change of its internal name) More... | |
virtual const char * | getName (void) const |
returns the name of the view (important for messages) More... | |
Public Member Functions inherited from Base::BaseClass | |
BaseClass () | |
Construction. More... | |
BaseClass (const BaseClass &)=default | |
virtual PyObject * | getPyObject () |
This method returns the Python wrapper for a C++ object. More... | |
virtual Type | getTypeId () const |
bool | isDerivedFrom (const Type type) const |
BaseClass & | operator= (const BaseClass &)=default |
virtual void | setPyObject (PyObject *) |
virtual | ~BaseClass () |
Destruction. More... | |
Public Member Functions inherited from Gui::SelectionObserver | |
void | attachSelection () |
Attaches to the selection. More... | |
bool | blockSelection (bool block) |
void | detachSelection () |
Detaches from the selection. More... | |
bool | isSelectionAttached () const |
bool | isSelectionBlocked () const |
SelectionObserver (bool attach=true, ResolveMode resolve=ResolveMode::OldStyleElement) | |
Constructor. More... | |
SelectionObserver (const Gui::ViewProviderDocumentObject *vp, bool attach=true, ResolveMode resolve=ResolveMode::OldStyleElement) | |
Constructor. More... | |
virtual | ~SelectionObserver () |
Static Public Member Functions | |
static MDIViewPage * | getFromScene (const QGSPage *scene) |
Static Public Member Functions inherited from Base::BaseClass | |
static void * | create () |
static Type | getClassTypeId () |
static void | init () |
Protected Types | |
typedef boost::signals2::connection | Connection |
Protected Member Functions | |
bool | attachView (App::DocumentObject *obj) |
Attaches view of obj to m_scene. Returns true on success, false otherwise. More... | |
void | closeEvent (QCloseEvent *) |
bool | compareSelections (std::vector< Gui::SelectionObject > treeSel, QList< QGraphicsItem * > sceneSel) |
void | findMissingViews (const std::vector< App::DocumentObject * > &list, std::vector< App::DocumentObject * > &missing) |
bool | hasQView (App::DocumentObject *obj) |
Helper function. More... | |
void | onDeleteObject (const App::DocumentObject &obj) |
bool | orphanExists (const char *viewName, const std::vector< App::DocumentObject * > &list) |
Helper function. More... | |
void | sceneSelectionManager (void) |
maintain QGScene selected items in selection order More... | |
void | setBalloonGroups (void) |
void | setDimensionGroups (void) |
void | setLeaderGroups (void) |
void | setTreeToSceneSelect (void) |
void | showStatusMsg (const char *s1, const char *s2, const char *s3) const |
Protected Member Functions inherited from Gui::MDIView | |
void | closeEvent (QCloseEvent *e) |
void | changeEvent (QEvent *e) |
Protected Attributes | |
Connection | connectDeletedObject |
Protected Attributes inherited from Gui::MDIView | |
PyObject * | pythonObject |
Protected Attributes inherited from Gui::BaseView | |
bool | bIsDetached |
bool | bIsPassive |
Additional Inherited Members | |
Public Types inherited from Gui::MDIView | |
enum | ViewMode { Child , TopLevel , FullScreen } |
MDI view mode enum. More... | |
Signals inherited from Gui::MDIView | |
void | message (const QString &, int) |
Protected Slots inherited from Gui::MDIView | |
virtual void | windowStateChanged (MDIView *) |
This method gets called from the main window this view is attached to whenever the window state of the active view changes. More... | |
Static Protected Member Functions inherited from Base::BaseClass | |
static void | initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=nullptr) |
|
protected |
MDIViewPage::MDIViewPage | ( | ViewProviderPage * | page, |
Gui::Document * | doc, | ||
QWidget * | parent = nullptr |
||
) |
|
virtual |
References connectDeletedObject.
void MDIViewPage::addChildrenToPage | ( | void | ) |
References attachTemplate(), attachView(), TechDrawGui::ViewProviderPage::getDrawPage(), App::PropertyLink::getValue(), App::PropertyListsT< T, ListT, ParentT >::getValues(), matchSceneRectToTemplate(), setBalloonGroups(), setDimensionGroups(), setLeaderGroups(), TechDraw::DrawPage::Template, viewAll(), TechDraw::DrawPage::Views, and TechDraw::DrawViewCollection::Views.
bool MDIViewPage::addView | ( | const App::DocumentObject * | obj | ) |
References attachView().
Referenced by TechDrawGui::ViewProviderDrawingView::onGuiRepaint().
void MDIViewPage::attachTemplate | ( | TechDraw::DrawTemplate * | obj | ) |
References TechDrawGui::QGSPage::setPageTemplate().
Referenced by addChildrenToPage(), and TechDrawGui::ViewProviderTemplate::updateData().
|
protected |
Attaches view of obj to m_scene. Returns true on success, false otherwise.
References TechDrawGui::QGSPage::addDrawView(), TechDrawGui::QGSPage::addDrawViewAnnotation(), TechDrawGui::QGSPage::addDrawViewClip(), TechDrawGui::QGSPage::addDrawViewImage(), TechDrawGui::QGSPage::addDrawViewSpreadsheet(), TechDrawGui::QGSPage::addDrawViewSymbol(), TechDrawGui::QGSPage::addProjectionGroup(), TechDrawGui::QGSPage::addRichAnno(), TechDrawGui::QGSPage::addViewBalloon(), TechDrawGui::QGSPage::addViewDimension(), TechDrawGui::QGSPage::addViewLeader(), TechDrawGui::QGSPage::addViewPart(), TechDrawGui::QGSPage::addViewSection(), TechDrawGui::QGSPage::addWeldSymbol(), Base::Console(), Base::Persistence::getClassTypeId(), and Base::ConsoleSingleton::Log().
Referenced by addChildrenToPage(), addView(), and fixOrphans().
void MDIViewPage::blockSceneSelection | ( | bool | isBlocked | ) |
void MDIViewPage::centerOnPage | ( | void | ) |
void MDIViewPage::clearSceneSelection | ( | ) |
|
protected |
|
protected |
References Base::Persistence::getClassTypeId(), and TechDrawGui::QGIView::getViewNameAsString().
Referenced by sceneSelectionChanged().
void MDIViewPage::contextMenuEvent | ( | QContextMenuEvent * | event | ) |
Referenced by TechDrawGui::QGVPage::pseudoContextEvent().
|
protected |
void MDIViewPage::fixOrphans | ( | bool | force = false | ) |
References attachView(), TechDrawGui::QGSPage::findQViewForDocObj(), TechDraw::DrawPage::getAllViews(), Gui::BaseView::getAppDocument(), TechDrawGui::ViewProviderPage::getDrawPage(), App::DocumentObject::getNameInDocument(), TechDrawGui::QGSPage::getViews(), and TechDrawGui::QGSPage::removeQView().
Referenced by onTimer().
|
static |
Referenced by TechDrawGui::QGIView::getMDIViewPage().
TechDraw::DrawPage * TechDrawGui::MDIViewPage::getPage | ( | void | ) |
|
virtual |
This method returns the Python wrapper for a C++ object.
It's in the responsibility of the programmer to do the correct reference counting. Basically there are two ways how to implement that: Either always return a new Python object then reference counting is not a matter or return always the same Python object then the reference counter must be incremented by one. However, it's absolutely forbidden to return always the same Python object without incrementing the reference counter.
The default implementation returns 'None'.
Reimplemented from Gui::MDIView.
References Gui::MDIView::pythonObject.
QGSPage * TechDrawGui::MDIViewPage::getQGSPage | ( | void | ) |
Referenced by TechDrawGui::DrawGuiUtil::findPage(), TechDrawGui::QGIView::getGraphicsScene(), TechDrawGui::ViewProviderTemplate::getQTemplate(), TechDrawGui::ViewProviderDrawingView::getQView(), TechDrawGui::ViewProviderDrawingView::onGuiRepaint(), TechDrawGui::TaskLeaderLine::onTrackerClicked(), TechDrawGui::TaskCosVertex::TaskCosVertex(), TechDrawGui::TaskDetail::TaskDetail(), TechDrawGui::TaskLeaderLine::TaskLeaderLine(), and TechDrawGui::TaskRichAnno::TaskRichAnno().
QGVPage * TechDrawGui::MDIViewPage::getQGVPage | ( | void | ) |
QPointF MDIViewPage::getTemplateCenter | ( | TechDraw::DrawTemplate * | obj | ) |
References TechDrawGui::Rez::guiX().
Referenced by centerOnPage().
ViewProviderPage * TechDrawGui::MDIViewPage::getViewProviderPage | ( | ) |
Referenced by TechDrawGui::ViewProviderTemplate::updateData().
|
protected |
void MDIViewPage::matchSceneRectToTemplate | ( | void | ) |
References TechDrawGui::ViewProviderPage::getDrawPage(), App::PropertyLink::getValue(), TechDrawGui::Rez::guiX(), and TechDraw::DrawPage::Template.
Referenced by addChildrenToPage().
|
protected |
|
virtual |
|
virtual |
Message handler.
receive a message
Reimplemented from Gui::MDIView.
References Gui::BaseView::getGuiDocument(), Gui::Command::updateActive(), and viewAll().
|
virtual |
Observer message from the Tree Selection mechanism.
invoked by selection change made in Tree via father MDIView
Implements Gui::SelectionObserver.
References Gui::SelectionChanges::AddSelection, blockSceneSelection(), clearSceneSelection(), Gui::SelectionChanges::ClrSelection, Base::Console(), Base::Persistence::getClassTypeId(), Gui::SelectionSingleton::getSelection(), Base::ConsoleSingleton::Log(), Gui::Selection(), selectQGIView(), and Gui::SelectionChanges::SetSelection.
|
slot |
References fixOrphans().
|
protected |
Helper function.
References Base::Persistence::getClassTypeId(), App::PropertyListsT< T, ListT, ParentT >::getValues(), orphanExists(), and TechDraw::DrawViewCollection::Views.
Referenced by orphanExists().
void MDIViewPage::preSelectionChanged | ( | const QPoint & | pos | ) |
|
virtual |
Print content of view.
Reimplemented from Gui::MDIView.
References print().
Referenced by print(), printPdf(), and printPreview().
|
virtual |
Reimplemented from Gui::MDIView.
References Gui::SelectionObserver::blockSelection(), Gui::SelectionSingleton::clearSelection(), TechDrawGui::ViewProviderPage::getDrawPage(), TechDrawGui::ViewProviderPage::getFrameState(), App::PropertyLink::getValue(), TechDrawGui::Rez::guiX(), TechDrawGui::QGSPage::refreshViews(), Gui::Selection(), TechDrawGui::ViewProviderPage::setFrameState(), TechDrawGui::ViewProviderPage::setTemplateMarkers(), and TechDraw::DrawPage::Template.
|
virtual |
Print to PDF file.
Reimplemented from Gui::MDIView.
References Gui::getMainWindow(), Gui::FileDialog::getSaveFileName(), and printPdf().
Referenced by printPdf(), and savePDF().
void MDIViewPage::printPdf | ( | std::string | file | ) |
References Base::Console(), print(), and Base::ConsoleSingleton::Warning().
|
virtual |
Show a preview dialog.
Reimplemented from Gui::MDIView.
References draftgeoutils.intersections::connect(), and print().
void MDIViewPage::redraw1View | ( | TechDraw::DrawView * | dv | ) |
References App::DocumentObject::getNameInDocument(), and TechDrawGui::QGSPage::getViews().
void MDIViewPage::redrawAllViews | ( | void | ) |
References TechDrawGui::QGSPage::getViews().
void MDIViewPage::saveDXF | ( | std::string | file | ) |
|
slot |
References Gui::getMainWindow(), Gui::FileDialog::getSaveFileName(), and saveDXF().
Referenced by saveDXF().
void MDIViewPage::savePDF | ( | std::string | file | ) |
References printPdf().
|
slot |
References printPdf().
void MDIViewPage::saveSVG | ( | std::string | file | ) |
References Base::Console(), TechDrawGui::QGSPage::saveSvg(), and Base::ConsoleSingleton::Warning().
|
slot |
|
slot |
update Tree Selection from QGraphicsScene selection
References compareSelections(), Gui::SelectionSingleton::getSelectionEx(), sceneSelectionManager(), Gui::Selection(), and setTreeToSceneSelect().
|
protected |
maintain QGScene selected items in selection order
Referenced by sceneSelectionChanged().
void MDIViewPage::selectQGIView | ( | App::DocumentObject * | obj, |
bool | state | ||
) |
QGraphicsScene selection routines.
Update QGIView's selection state based on Selection made outside Drawing Interface.
References blockSceneSelection(), and TechDrawGui::QGSPage::findQViewForDocObj().
Referenced by onSelectionChanged().
|
protected |
References TechDrawGui::QGSPage::addBalloonToParent(), TechDrawGui::QGSPage::findParent(), and TechDrawGui::QGSPage::getViews().
Referenced by addChildrenToPage().
|
protected |
References TechDrawGui::QGSPage::addDimToParent(), TechDrawGui::QGSPage::findParent(), and TechDrawGui::QGSPage::getViews().
Referenced by addChildrenToPage().
void MDIViewPage::setDocumentName | ( | const std::string & | name | ) |
void MDIViewPage::setDocumentObject | ( | const std::string & | name | ) |
|
protected |
References TechDrawGui::QGSPage::addLeaderToParent(), TechDrawGui::QGSPage::findParent(), and TechDrawGui::QGSPage::getViews().
Referenced by addChildrenToPage().
void MDIViewPage::setTabText | ( | std::string | t | ) |
References Gui::BaseView::isPassive().
|
protected |
References Gui::SelectionSingleton::addSelection(), blockSceneSelection(), Gui::SelectionObserver::blockSelection(), Gui::SelectionSingleton::clearSelection(), App::DocumentObject::getDocument(), App::Document::getName(), App::DocumentObject::getNameInDocument(), TechDrawGui::QGIEdge::getProjIndex(), TechDrawGui::QGIVertex::getProjIndex(), TechDrawGui::QGIView::getViewObject(), App::DocumentObject::isRemoving(), Gui::Selection(), and showStatusMsg().
Referenced by sceneSelectionChanged().
|
protected |
References Gui::getMainWindow(), and Gui::MainWindow::showMessage().
Referenced by setTreeToSceneSelect().
|
slot |
|
slot |
void MDIViewPage::updateTemplate | ( | bool | force = false | ) |
References Base::Console(), Base::Persistence::getClassTypeId(), TechDrawGui::ViewProviderPage::getDrawPage(), App::DocumentObject::getNameInDocument(), TechDrawGui::QGSPage::getTemplate(), App::PropertyLink::getValue(), Base::BaseClass::isDerivedFrom(), App::DocumentObject::isTouched(), App::Property::isTouched(), Base::ConsoleSingleton::Log(), TechDrawGui::QGITemplate::setTemplate(), TechDraw::DrawPage::Template, and TechDrawGui::QGITemplate::updateView().
|
slot |
Referenced by addChildrenToPage(), onMsg(), and TechDrawGui::ViewProviderTemplate::updateData().
|
protected |
Referenced by ~MDIViewPage().