Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4FitGUI/QFitWidget.ui.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE 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 /****************************************************************************
00017 ** ui.h extension file, included from the uic-generated form implementation.
00018 **
00019 ** If you wish to add, delete or rename slots use Qt Designer which will
00020 ** update this file, preserving your code. Create an init() slot in place of
00021 ** a constructor, and a destroy() slot in place of a destructor.
00022 *****************************************************************************/
00023 
00024 #include <iostream.h>
00025 
00026 void QFitWidget::init() {
00027   fxRegistry = TGo4GUIRegistry::Instance();
00028   fxSlots = GetSlots();
00029   fxItem = 0;
00030   fbFillWidget = FALSE;
00031 }
00032 
00033 void QFitWidget::destroy() {
00034 //   cout << "deleting widget " << caption() << endl;
00035 }
00036 
00037 void QFitWidget::closeEvent( QCloseEvent *ce )
00038 {
00039     ce->accept();
00040     delete this;
00041 }
00042 
00043 TGo4FitPanelSlots* QFitWidget::GetSlots() {
00044   return dynamic_cast<TGo4FitPanelSlots*> (fxRegistry->GetSlotClass("TGo4FitPanelSlots"));
00045 }
00046 
00047 void QFitWidget::SetItem( QFitItem * iItem) {
00048    fxItem = iItem;
00049    FillWidget();
00050 }
00051 
00052 QFitItem* QFitWidget::GetItem() {
00053   return fxItem;
00054 }
00055 
00056 TObject * QFitWidget::GetObject() {
00057    if(GetItem()) return GetItem()->Object();
00058             else return 0;
00059 }
00060 
00061 void QFitWidget::FillWidget() {
00062   fbFillWidget = TRUE;
00063   FillSpecificData();
00064   fbFillWidget = FALSE;
00065 }
00066 
00067 void QFitWidget::FillSpecificData() {
00068   return;
00069 }
00070 
00071 void QFitWidget::mouseReleaseEvent( QMouseEvent * ev) {
00072   if ((GetItem()==0) || (ev->button()!=Qt::RightButton)) return;
00073 
00074   QPopupMenu menu(0,"QFitWidgetPopup");
00075 
00076   if (fxSlots->FillPopupForItem(GetItem(),&menu)) {
00077     int id = menu.exec(ev->globalPos());
00078     fxSlots->ExecPopupForItem(GetItem(), id /*, menu.text(id) */);
00079   }
00080 }
00081 
00082 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:58 2005 for Go4-v2.10-5 by doxygen1.2.15