GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
QFitModelFormulaWidget.cpp
Go to the documentation of this file.
1 // $Id$
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "QFitModelFormulaWidget.h"
15 
16 #include "TGo4FitModelFormula.h"
17 #include "TGo4FitGuiTypes.h"
18 
19 QFitModelFormulaWidget::QFitModelFormulaWidget(QWidget *parent, const char *name)
20  : QFitModelWidget(parent, name)
21 {
22  setupUi(this);
23  QObject::connect(ExprEdt, &QGo4LineEdit::textChanged, this, &QFitModelFormulaWidget::ExprEdt_textChanged);
24  QObject::connect(NumParSpin, QOverload<int>::of(&QSpinBox::valueChanged), this, &QFitModelFormulaWidget::NumParSpin_valueChanged);
25 
26 }
27 
29 {
30  return dynamic_cast<TGo4FitModelFormula*> (GetObject());
31 }
32 
34 {
36  if (GetFormula()) {
37  NumParSpin->setValue(GetFormula()->GetNumberOfExprPar());
38  ExprEdt->setText(GetFormula()->GetExpression());
39  }
40 }
41 
43 {
44  if(!fbFillWidget && GetFormula())
45  GetFormula()->SetExpression(str.toLatin1().constData());
46 }
47 
49 {
50  if(!fbFillWidget && GetFormula())
51  if(GetFormula()->SetNumberOfExprPar(num))
53 }
void SetExpression(const char *expr)
bool fbFillWidget
Definition: QFitWidget.h:63
virtual TGo4FitModelFormula * GetFormula()
void FillSpecificData() override
virtual void UpdateItemsOfType(int typ, bool allitems=false)
Definition: QFitWidget.cpp:98
virtual TObject * GetObject()
Definition: QFitWidget.cpp:50
QFitModelFormulaWidget(QWidget *parent=nullptr, const char *name=nullptr)
virtual void ExprEdt_textChanged(const QString &)
virtual void NumParSpin_valueChanged(int)