src/hierarchyelement.cpp

Sun, 04 Oct 2015 06:43:02 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 04 Oct 2015 06:43:02 +0300
changeset 1003
31873c3cbdbc
parent 997
1b49f34e533d
child 1006
a6b462051ae0
permissions
-rw-r--r--

Bézier curves are now parsed correctly

#include <stdio.h>
#include <QMetaObject>
#include "hierarchyelement.h"
#include "mainwindow.h"
#include "guiutilities.h"

HierarchyElement::HierarchyElement (QObject* parent) :
	m_window (nullptr),
	m_config (nullptr)
{
	if (parent)
	{
		while (parent->parent())
			parent = parent->parent();

		m_window = qobject_cast<MainWindow*> (parent);
	}

	if (m_window == nullptr)
	{
		m_window = g_win;
		print ("WARNING: Hierarchy element instance %p should be in the hierarchy of a "
			"MainWindow but isn't.\n", this);
	}

	m_config = m_window->configBag();
	m_documents = m_window->documents();
}

GuiUtilities* HierarchyElement::guiUtilities() const
{
	return m_window->guiUtilities();
}

LDDocument* HierarchyElement::currentDocument()
{
	return m_window->currentDocument();
}

const LDObjectList& HierarchyElement::selectedObjects()
{
	return m_window->selectedObjects();
}

mercurial