00001 // $Id: QFitModelFormulaWidget.cpp 1134 2014-01-22 14:53:40Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #include "QFitModelFormulaWidget.h" 00015 00016 #include "TGo4FitModelFormula.h" 00017 #include "TGo4FitGuiTypes.h" 00018 00019 QFitModelFormulaWidget::QFitModelFormulaWidget(QWidget *parent, const char* name) 00020 : QFitModelWidget(parent, name) 00021 { 00022 setupUi(this); 00023 } 00024 00025 TGo4FitModelFormula * QFitModelFormulaWidget::GetFormula() 00026 { 00027 return dynamic_cast<TGo4FitModelFormula*> (GetObject()); 00028 } 00029 00030 void QFitModelFormulaWidget::FillSpecificData() 00031 { 00032 QFitNamedWidget::FillSpecificData(); 00033 if (GetFormula()) { 00034 NumParSpin->setValue(GetFormula()->GetNumberOfExprPar()); 00035 ExprEdt->setText(GetFormula()->GetExpression()); 00036 } 00037 } 00038 00039 void QFitModelFormulaWidget::ExprEdt_textChanged( const QString & str) 00040 { 00041 if(!fbFillWidget && GetFormula()) 00042 GetFormula()->SetExpression(str.toLatin1().constData()); 00043 } 00044 00045 void QFitModelFormulaWidget::NumParSpin_valueChanged( int num) 00046 { 00047 if(!fbFillWidget && GetFormula()) 00048 if(GetFormula()->SetNumberOfExprPar(num)) 00049 UpdateItemsOfType(FitGui::ot_parslist, false); 00050 }