Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

QFitWidget.cpp

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "QFitWidget.h"
00017 
00018 #include "QFitItem.h"
00019 #include "qpopupmenu.h"
00020 #include "TObject.h"
00021 #include "TGo4FitPanel.h"
00022 
00023 QFitWidget::QFitWidget( QWidget* parent, const char* name, WFlags fl )
00024     : QWidget( parent, name, fl )
00025 {
00026     if (name==0) setName( "QFitWidget" );
00027     resize( QSize(533, 405).expandedTo(minimumSizeHint()) );
00028     clearWState( WState_Polished );
00029 
00030     fxPanel = 0;
00031     fxItem = 0;
00032     fbFillWidget = FALSE;
00033 }
00034 
00035 QFitWidget::~QFitWidget()
00036 {
00037 }
00038 
00039 void QFitWidget::closeEvent( QCloseEvent *ce )
00040 {
00041     ce->accept();
00042     delete this;
00043 }
00044 
00045 void QFitWidget::SetItem(TGo4FitPanel* panel, QFitItem * item)
00046 {
00047    fxPanel = panel;
00048    fxItem = item;
00049    FillWidget();
00050 }
00051 
00052 QFitItem* QFitWidget::GetItem()
00053 {
00054   return fxItem;
00055 }
00056 
00057 TObject * QFitWidget::GetObject()
00058 {
00059    if(GetItem()) return GetItem()->Object();
00060             else return 0;
00061 }
00062 
00063 TGo4Fitter* QFitWidget::GetFitter()
00064 {
00065    return fxPanel==0 ? 0 : fxPanel->GetFitter();
00066 }
00067 
00068 void QFitWidget::FillWidget()
00069 {
00070   fbFillWidget = TRUE;
00071   FillSpecificData();
00072   fbFillWidget = FALSE;
00073 }
00074 
00075 void QFitWidget::FillSpecificData()
00076 {
00077 }
00078 
00079 void QFitWidget::contextMenuEvent(QContextMenuEvent* ev)
00080 {
00081   if ((GetItem()==0) || (fxPanel==0)) return;
00082 
00083   QPopupMenu menu(0,"QFitWidgetPopup");
00084 
00085   if (fxPanel->FillPopupForItem(GetItem(),&menu)) {
00086      int id = menu.exec(ev->globalPos());
00087      fxPanel->ExecPopupForItem(GetItem(), id);
00088   }
00089 }
00090 
00091 void QFitWidget::UpdateWidgetItem(bool trace)
00092 {
00093    if (fxPanel!=0)
00094      fxPanel->UpdateItem(GetItem(), trace);
00095 }
00096 
00097 void QFitWidget::SetWidgetItemText(bool trace)
00098 {
00099    if (fxPanel!=0)
00100       fxPanel->SetItemText(GetItem(), trace);
00101 }
00102 
00103 void QFitWidget::UpdateItemsOfType(int typ, bool allitems)
00104 {
00105    if (fxPanel!=0)
00106       fxPanel->UpdateItemsOfType(typ, allitems ? 0 : GetItem());
00107 }
00108 
00109 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:14 2008 for Go4-v3.04-1 by  doxygen 1.4.2