GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
QFitSlotWidget.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 "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) : QFitNamedWidget(parent, name)
22 {
23  setupUi(this);
24  QObject::connect(RequirementChk, &QCheckBox::toggled, this, &QFitSlotWidget::RequirementChk_toggled);
25  QObject::connect(SaveCmb, QOverload<int>::of(&QComboBox::activated), this, &QFitSlotWidget::SaveCmb_activated);
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) {
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 
74 {
75  if(!fbFillWidget && GetSlot())
76  GetSlot()->SetSaveFlag(typ);
77 }
void SetNeeded(Bool_t iNeeded)
Definition: TGo4FitSlot.h:177
Bool_t GetNeeded() const
Definition: TGo4FitSlot.h:172
virtual void RequirementChk_toggled(bool req)
virtual QString Wiz_GetSlotSourceInfo(TGo4FitSlot *slot)
void SetSaveFlag(Int_t iSaveFlag)
Definition: TGo4FitSlot.h:75
bool fbFillWidget
Definition: QFitWidget.h:63
virtual void SaveCmb_activated(int typ)
const char * GetObjectName() const
TClass * GetClass() const
Definition: TGo4FitSlot.h:61
QGo4LineEdit * NameEdt
void FillSpecificData() override
virtual TObject * GetObject()
Definition: QFitWidget.cpp:50
TNamed * GetOwner()
Definition: TGo4FitNamed.h:63
virtual TGo4FitSlot * GetSlot()
QFitSlotWidget(QWidget *parent=nullptr, const char *name=nullptr)
TObject * GetObject() const
Bool_t GetOwned() const
Definition: TGo4FitSlot.h:160
Int_t GetSaveFlag() const
Definition: TGo4FitSlot.h:80
void FillSpecificData() override
TGo4FitPanel * fxPanel
Definition: QFitWidget.h:61