--- a/src/hierarchyelement.cpp Tue Feb 16 16:28:44 2016 +0200 +++ b/src/hierarchyelement.cpp Tue Feb 16 19:59:43 2016 +0200 @@ -23,7 +23,6 @@ #include "guiutilities.h" - HierarchyElement::HierarchyElement (QObject* parent) : m_window (nullptr) { @@ -37,9 +36,10 @@ if (m_window == nullptr) { + // Drat! It doesn't seem to have the MainWindow as a parent! We'll need to force it to be in one. + // This shouldn't have any side effects but also shouldn't happen regardless. m_window = g_win; - print ("WARNING: Hierarchy element instance %1 should be in the hierarchy of a " - "MainWindow but isn't.\n", this); + print("Hierarchy element instance %1 should be in the hierarchy of a MainWindow, but isn't.\n", this); } m_documents = m_window->documents(); @@ -47,29 +47,31 @@ } - GuiUtilities* HierarchyElement::guiUtilities() const { return m_window->guiUtilities(); } - LDDocument* HierarchyElement::currentDocument() { return m_window->currentDocument(); } - const LDObjectList& HierarchyElement::selectedObjects() { return m_window->selectedObjects(); } - PrimitiveManager* HierarchyElement::primitives() { return m_window->primitives(); } + + +Grid* HierarchyElement::grid() const +{ + return m_window->grid(); +}