GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitSlotWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitSlotWidget.cpp 3116 2021-03-30 06:51:49Z linev $
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 "QFitSlotWidget.h"
15 
16 #include "TClass.h"
17 
18 #include "TGo4FitSlot.h"
19 #include "TGo4FitPanel.h"
20 
21 QFitSlotWidget::QFitSlotWidget(QWidget *parent, const char* name)
22  : QFitNamedWidget(parent, name)
23 {
24  setupUi(this);
25  QObject::connect(RequirementChk, SIGNAL(toggled(bool)), this, SLOT(RequirementChk_toggled(bool)));
26  QObject::connect(SaveCmb, SIGNAL(activated(int)), this, SLOT(SaveCmb_activated(int)));
27 }
28 
30 {
31  return dynamic_cast<TGo4FitSlot*> (GetObject());
32 }
33 
35 {
37  TGo4FitSlot* slot = GetSlot();
38  if (slot) {
39  NameEdt->setReadOnly(true);
40  NameEdt->setDisabled(true);
41 
42  InfoLbl->setText(QString("Slot of: ")+slot->GetOwner()->GetName() +
43  ", dedicated for:" + slot->GetClass()->GetName() + " class");
44  InfoLbl->adjustSize();
45 
46  if (slot->GetObject()) {
47  ObjectLbl->setText(QString("Object: ")+slot->GetObjectName() +
48  ", of class: " + slot->GetObject()->ClassName());
49  if(slot->GetOwned()) OwnershipLbl->setText("Object owned by slot");
50  else OwnershipLbl->setText("Object not owned by slot");
51  } else {
52  ObjectLbl->setText("No object in slot");
53  OwnershipLbl->setText("");
54  }
55  ObjectLbl->adjustSize();
56  OwnershipLbl->adjustSize();
57 
58  RequirementChk->setChecked(slot->GetNeeded());
59  SaveCmb->setCurrentIndex(slot->GetSaveFlag());
60 
61  if (fxPanel!=0) {
62  SourceLbl->setText(QString("Source: ") + fxPanel->Wiz_GetSlotSourceInfo(slot));
63  SourceLbl->adjustSize();
64  }
65  }
66 }
67 
69 {
70  if(!fbFillWidget && GetSlot())
71  GetSlot()->SetNeeded(req);
72 }
73 
74 
76 {
77  if(!fbFillWidget && GetSlot())
78  GetSlot()->SetSaveFlag(typ);
79 }
const char * GetObjectName() const
void SetNeeded(Bool_t iNeeded)
Definition: TGo4FitSlot.h:178
virtual void RequirementChk_toggled(bool req)
virtual QString Wiz_GetSlotSourceInfo(TGo4FitSlot *slot)
Bool_t GetNeeded()
Definition: TGo4FitSlot.h:173
void SetSaveFlag(Int_t iSaveFlag)
Definition: TGo4FitSlot.h:75
bool fbFillWidget
Definition: QFitWidget.h:63
virtual void SaveCmb_activated(int typ)
Bool_t GetOwned()
Definition: TGo4FitSlot.h:161
QGo4LineEdit * NameEdt
TClass * GetClass()
Definition: TGo4FitSlot.h:61
QFitSlotWidget(QWidget *parent=0, const char *name=0)
Int_t GetSaveFlag()
Definition: TGo4FitSlot.h:80
virtual TObject * GetObject()
Definition: QFitWidget.cpp:51
TNamed * GetOwner()
Definition: TGo4FitNamed.h:63
virtual void FillSpecificData()
virtual TGo4FitSlot * GetSlot()
virtual void FillSpecificData()
TObject * GetObject() const
TGo4FitPanel * fxPanel
Definition: QFitWidget.h:61