Esempio n. 1
0
QVariant AnalysisForm::requestInfo(const Term &term, VariableInfo::InfoType info) const
{
	try {

		if (info == VariableInfo::VariableType)
		{
			return _dataSet->column(term.asString()).columnType();
		}
		else if (info == VariableInfo::Labels)
		{
			QStringList values;
			Labels &labels = _dataSet->column(term.asString()).labels();
			for (Labels::const_iterator label_it = labels.begin(); label_it != labels.end(); ++label_it)
				values.append(tq(label_it->text()));

			return values;
		}
	}
	catch(columnNotFound e) {} //just return an empty QVariant right?
	catch(std::exception e)
	{
#ifdef JASP_DEBUG
		std::cout << "AnalysisForm::requestInfo had an exception! " << e.what() << std::flush;
#endif
		throw e;
	}
	return QVariant();

}
Esempio n. 2
0
QVariant AnalysisForm::requestInfo(const Term &term, VariableInfo::InfoType info) const
{
	if (info == VariableInfo::VariableType)
	{
		return _dataSet->column(term.asString()).columnType();
	}
	else if (info == VariableInfo::Labels)
	{
		QStringList values;
		Labels &labels = _dataSet->column(term.asString()).labels();
		for (uint i = 0; i < labels.size(); i++)
			values.append(tq(labels.at(i).text()));

		return values;
	}
	else
	{
		return QVariant();
	}
}