src/hierarchyelement.cpp

Mon, 31 Aug 2015 22:40:49 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Mon, 31 Aug 2015 22:40:49 +0300
changeset 973
c1b60c7d5135
parent 972
a34b73114823
child 974
b2fa5f89798a
permissions
-rw-r--r--

Change color config types into actual colors now that I can do that

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

HierarchyElement::HierarchyElement (QObject* parent) :
	m_window (nullptr),
	m_config (nullptr)
{
	if (parent)
	{
		while (parent->parent() != nullptr)
			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();
}

mercurial