#include "CustomParameterModel.h"
#include "EditorDescripttionSetup.h"
#include <QProcess>
#include <QCoreApplication>
#include <QDebug>

namespace FastCAEDesigner
{
	CustomParameterModel::CustomParameterModel(QString nameEng, QString nameChn, QString iconName, int type, QObject *parent)
		: ModelBase(nameEng, nameChn, iconName, type, parent)
	{
	}

	CustomParameterModel::~CustomParameterModel()
	{
	}

	int CustomParameterModel::ShowEditor(QTreeWidgetItem *treeItem, QWidget *parent)
	{
		// 		QString designer = qApp->applicationDirPath()+"/../bin/designer.exe";
		// 		QProcess *process = new QProcess(parent);
		// 		process->start(designer);
		// 		if (!process->waitForStarted())
		// 			return -1;
		// 		process->waitForFinished();
		//
		// 		qDebug() << process->readAll();
		// 		qDebug() << process->exitCode();//退出码
		// 		qDebug() << process->exitStatus();//退出状态

		FastCAEDesigner::EditorDescripttionSetup dlg(treeItem, this, parent);
		return dlg.exec();
	}

}