本文整理汇总了C++中QExplicitlySharedDataPointer::parameterName方法的典型用法代码示例。如果您正苦于以下问题:C++ QExplicitlySharedDataPointer::parameterName方法的具体用法?C++ QExplicitlySharedDataPointer::parameterName怎么用?C++ QExplicitlySharedDataPointer::parameterName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QExplicitlySharedDataPointer
的用法示例。
在下文中一共展示了QExplicitlySharedDataPointer::parameterName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fitChanged
void KstViewFitsDialog::fitChanged(const QString& strFit) {
KstCPluginList fits;
KstCPluginPtr plugin;
double* params = 0L;
double* covars = 0L;
double chi2Nu = 0.0;
int numParams = 0;
int numCovars = 0;
int i;
fits = kstObjectSubList<KstDataObject,KstCPlugin>(KST::dataObjectList);
plugin = *(fits.findTag(strFit));
if (plugin) {
KstScalarPtr scalarChi2Nu;
KstVectorPtr vectorParam;
plugin->readLock();
const KstScalarMap& scalars = plugin->outputScalars();
scalarChi2Nu = scalars["chi^2/nu"];
if (scalarChi2Nu) {
scalarChi2Nu->readLock();
chi2Nu = scalarChi2Nu->value();
scalarChi2Nu->unlock();
}
const KstVectorMap& vectors = plugin->outputVectors();
vectorParam = vectors["Parameters"];
if (vectorParam) {
KstVectorPtr vectorCovar;
vectorParam->readLock();
vectorCovar = vectors["Covariance"];
if (vectorCovar) {
vectorCovar->readLock();
numParams = vectorParam->length();
numCovars = vectorCovar->length();
if (numParams > 0 && numCovars > 0) {
params = new double[numParams];
covars = new double[numCovars];
for (i = 0; i < numParams; i++) {
params[i] = vectorParam->value(i);
}
for (i = 0; i < numCovars; i++) {
covars[i] = vectorCovar->value(i);
}
}
vectorCovar->unlock();
}
vectorParam->unlock();
}
plugin->unlock();
}
_tableFits->setParameters(params, numParams, covars, numCovars, chi2Nu);
if (numParams > 0) {
_tableFits->horizontalHeaderItem(0)->setText(QObject::tr("Value"));
_tableFits->horizontalHeaderItem(1)->setText(QObject::tr("Covariance:"));
_tableFits->verticalHeaderItem(numParams+0)->setText("---");
_tableFits->verticalHeaderItem(numParams+1)->setText(QObject::tr("Chi^2/Nu"));
if (plugin) {
QExplicitlySharedDataPointer<Plugin> pluginBase;
plugin->readLock();
pluginBase = plugin->plugin();
if (pluginBase) {
textLabelFit->setText(pluginBase->data()._readableName);
for (i = 0; i < numParams; i++) {
QString parameterName = pluginBase->parameterName(i);
_tableFits->horizontalHeaderItem(i+2)->setText(parameterName);
_tableFits->verticalHeaderItem(i)->setText(parameterName);
}
}
plugin->unlock();
}
}
_tableFits->update();
}