#pragma once

#include <QObject>
#include "IxWidgetFactory.h"

class WidgetFactory : public QObject
{
	Q_OBJECT
public:
	WidgetFactory(QObject *parent);
	~WidgetFactory();

	IxWidgetFactory_ptr getFactory(const QString &type);

	IxWidgetFactory_ptr getFactory(qx::IxDataMember *dataMember);

	QString getFactoryType(qx::IxDataMember *dataMember);

	WidgetFactory& operator << (IxWidgetFactory_ptr widgetFactory);

private:
	void init();

private:
	QList<IxWidgetFactory_ptr> factorys;
};
