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