GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QFitItem.cpp
Go to the documentation of this file.
1 // $Id: QFitItem.cpp 3107 2021-03-29 17:47:15Z 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 "QFitItem.h"
15 
16 #include "TGo4FitPanel.h"
17 
18 #include <QtCore/QString>
19 
20 
21 QFitItem::QFitItem(TGo4FitPanel* panel, QTreeWidgetItem* parent, TObject* iObj, int iObjectType, int iWidgetType, int iPopupMenuType, int iGraphType, int iTag ) :
22  QTreeWidgetItem()
23 {
24  setText(0, QString());
25  setText(1, QString());
26 
27  fxPanel = panel;
28  fxObj = iObj;
29  fiObjectType = iObjectType;
30  fiWidgetType = iWidgetType;
31  fiPopupMenuType = iPopupMenuType;
32  fiGraphType = iGraphType;
33  fiTag = iTag;
34 
35  parent->addChild(this);
36 
37  if (fxPanel) fxPanel->UpdateItem(this, false);
38 }
39 
41 {
42  if (fxPanel) fxPanel->FitItemDeleted(this);
43 }
44 
46 {
47  QFitItem* item = this;
48 
49  while (item!=0) {
50  if (item->WidgetType()!=-1) return item;
51  item = item->Parent();
52  }
53  return 0;
54 }
55 
57 {
58  QFitItem* item = this;
59 
60  while (item!=0) {
61  if (item->GraphType()!=-1) return item;
62  item = item->Parent();
63  }
64  return 0;
65 }
66 
68 {
69  QFitItem* i = this;
70  i = i->Parent();
71 
72  while (i!=0) {
73  if (i==item) return true;
74  i = i->Parent();
75  }
76 
77  return false;
78 }
int fiObjectType
Definition: QFitItem.h:43
bool FindInParents(QFitItem *item)
Definition: QFitItem.cpp:67
virtual ~QFitItem()
Definition: QFitItem.cpp:40
int GraphType() const
Definition: QFitItem.h:32
int WidgetType() const
Definition: QFitItem.h:30
QFitItem * DefineWidgetItem()
Definition: QFitItem.cpp:45
int fiGraphType
Definition: QFitItem.h:46
QFitItem(TGo4FitPanel *panel, QTreeWidgetItem *parent, TObject *iObj, int iObjectType, int iWidgetType=-1, int iPopupMenuType=-1, int iGraphType=-1, int iTag=0)
Definition: QFitItem.cpp:21
int fiPopupMenuType
Definition: QFitItem.h:45
int fiWidgetType
Definition: QFitItem.h:44
QFitItem * Parent() const
Definition: QFitItem.h:35
virtual void UpdateItem(QFitItem *item, bool trace)
QFitItem * DefineGraphItem()
Definition: QFitItem.cpp:56
TObject * fxObj
Definition: QFitItem.h:42
virtual void FitItemDeleted(QFitItem *item)
TGo4FitPanel * fxPanel
Definition: QFitItem.h:41
int fiTag
Definition: QFitItem.h:47