Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
QAction* action;
if ( ! fixed )
{
action = new QAction("Fix", this);
connect(action, SIGNAL(triggered()), this, SLOT(fixItem()));
}
else
{
action = new QAction("Remove Fix", this);
connect(action, SIGNAL(triggered()), this, SLOT(unFixItem()));
}
menu->addAction(action);
// Show the menu
menu->popup(QCursor::pos());
}
void ConvFit::fixItem()
{
QtBrowserItem* item = m_cfTree->currentItem();
// Determine what the property is.
QtProperty* prop = item->property();
QtProperty* fixedProp = m_stringManager->addProperty( prop->propertyName() );
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
QtProperty* fprlbl = m_stringManager->addProperty("Fixed");
fixedProp->addSubProperty(fprlbl);
m_stringManager->setValue(fixedProp, prop->valueText());
item->parent()->property()->addSubProperty(fixedProp);
m_fixedProps[fixedProp] = prop;
item->parent()->property()->removeSubProperty(prop);
}
void ConvFit::unFixItem()
{
QtBrowserItem* item = m_cfTree->currentItem();
QtProperty* prop = item->property();
if ( prop->subProperties().empty() )
{
item = item->parent();
prop = item->property();
}
item->parent()->property()->addSubProperty(m_fixedProps[prop]);
item->parent()->property()->removeSubProperty(prop);
m_fixedProps.remove(prop);
QtProperty* proplbl = prop->subProperties()[0];
delete proplbl;
delete prop;
}
void ConvFit::showTieCheckbox(QString fitType)
{
uiForm().confit_ckTieCentres->setVisible( fitType == "Two Lorentzians" );
}
} // namespace IDA
} // namespace CustomInterfaces
} // namespace MantidQt