GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitSlotWidget.cpp
Go to the documentation of this file.
1 // $Id: QFitSlotWidget.cpp 1134 2014-01-22 14:53:40Z 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 für 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 #include "QFitItem.h"
18 #include "QGo4LineEdit.h"
19 #include "TGo4FitSlot.h"
20 #include "TGo4FitPanel.h"
21 
22 QFitSlotWidget::QFitSlotWidget(QWidget *parent, const char* name)
23  : QFitNamedWidget(parent, name)
24 {
25  setupUi(this);
26 }
27 
29 {
30  return dynamic_cast<TGo4FitSlot*> (GetObject());
31 }
32 
34 {
36  TGo4FitSlot* slot = GetSlot();
37  if (slot) {
38  NameEdt->setReadOnly(true);
39  NameEdt->setDisabled(true);
40 
41  InfoLbl->setText(QString("Slot of: ")+slot->GetOwner()->GetName() +
42  ", dedicated for:" + slot->GetClass()->GetName() + " class");
43  InfoLbl->adjustSize();
44 
45  if (slot->GetObject()) {
46  ObjectLbl->setText(QString("Object: ")+slot->GetObjectName() +
47  ", of class: " + slot->GetObject()->ClassName());
48  if(slot->GetOwned()) OwnershipLbl->setText("Object owned by slot");
49  else OwnershipLbl->setText("Object not owned by slot");
50  } else {
51  ObjectLbl->setText("No object in slot");
52  OwnershipLbl->setText("");
53  }
54  ObjectLbl->adjustSize();
55  OwnershipLbl->adjustSize();
56 
57  RequirementChk->setChecked(slot->GetNeeded());
58  SaveCmb->setCurrentIndex(slot->GetSaveFlag());
59 
60  if (fxPanel!=0) {
61  SourceLbl->setText(QString("Source: ") + fxPanel->Wiz_GetSlotSourceInfo(slot));
62  SourceLbl->adjustSize();
63  }
64  }
65 }
66 
68 {
69  if(!fbFillWidget && GetSlot())
70  GetSlot()->SetNeeded(req);
71 }
72 
73 
75 {
76  if(!fbFillWidget && GetSlot())
77  GetSlot()->SetSaveFlag(typ);
78 }
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:64
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:53
TNamed * GetOwner()
Definition: TGo4FitNamed.h:63
virtual void FillSpecificData()
virtual TGo4FitSlot * GetSlot()
virtual void FillSpecificData()
TObject * GetObject() const
TGo4FitPanel * fxPanel
Definition: QFitWidget.h:62