Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGQFieldContainerView_qt.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef _OSGQFIELDCONTAINERVIEW_H_
00040 #define _OSGQFIELDCONTAINERVIEW_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #include "OSGWindowQTDef.h"
00046 
00047 #include <OSGFieldContainer.h>
00048 
00049 #include <qwidget.h>
00050 #include <qtable.h>
00051 
00052 class QColorGroup;
00053 class QRect;
00054 class QSize;
00055 class QResizeEvent;
00056 
00057 OSG_BEGIN_NAMESPACE
00058 
00059 class OSG_WINDOWQTLIB_DLLMAPPING QFieldContainerView : public QWidget
00060 {
00061     Q_OBJECT
00062 
00063 public:
00064     enum ColumnNames {
00065         NameColumn  = 0,
00066         ValueColumn = 1,
00067         TypeColumn  = 2
00068     };
00069 
00070     QFieldContainerView(      QWidget           *parent, 
00071                         const char              *name   = NULL);
00072     QFieldContainerView(      FieldContainerPtr  pFC,
00073                               UInt32             uiAspect,
00074                               QWidget           *parent, 
00075                         const char              *name   = NULL);
00076 
00077     virtual ~QFieldContainerView(void);
00078 
00079           FieldContainerPtr &getFieldContainer(void                    );
00080     const FieldContainerPtr &getFieldContainer(void                    ) const;
00081 
00082           UInt32             getAspect        (void                    ) const;
00083 
00084           bool               getShowTypeColumn(void                    ) const;
00085 
00086 public slots:
00087           void               setFieldContainer(FieldContainerPtr pFC         );
00088           void               setAspect        (UInt32            uiAspect    );
00089           void               setShowTypeColumn(bool              bShowTypeCol);
00090 
00091           void               beginEdit        (UInt32            uiFieldId, 
00092                                                UInt32            uiIndex     );
00093 
00094           void               endEdit          (void                          );
00095           void               endEdit          (UInt32            uiFieldId   );
00096 
00097 signals:
00098     void clicked          (FieldContainerPtr pFC,     UInt32       uiFieldId,
00099                            UInt32            uiIndex, ButtonState  button    );
00100     void doubleClicked    (FieldContainerPtr pFC,     UInt32       uiFieldId,
00101                            UInt32            uiIndex, ButtonState  button    );
00102  
00103 protected:
00104     void resizeEvent      (QResizeEvent     *pEvent);
00105 
00106 protected slots:
00107     void onClicked        (FieldContainerPtr pFC,     UInt32 uiFieldId, 
00108                            UInt32            uiIndex, ButtonState button);
00109     void onDoubleClicked  (FieldContainerPtr pFC,     UInt32 uiFieldId,
00110                            UInt32            uiIndex, ButtonState button);
00111 
00112 private:
00113     typedef QWidget Inherited;
00114 
00115     class QWidgetTableItem : public QTableItem
00116     {
00117     public:
00118         QWidgetTableItem(QTable *pTable);
00119 
00120         virtual ~QWidgetTableItem(void);
00121 
00122         virtual void  paint   (      QPainter    *pPainter, 
00123                                const QColorGroup &cg,
00124                                const QRect       &cr,       
00125                                      bool         selected );
00126         virtual QSize sizeHint(void                        ) const;
00127 
00128     private:
00129         typedef QTableItem Inherited;
00130     };
00131 
00132     void clearTable(void                                         );
00133     void fillTable (const FieldContainerPtr &pFC, UInt32 uiAspect);
00134 
00135     QTable            *_pTable;
00136     FieldContainerPtr  _pFC;
00137     UInt32             _uiAspect;
00138  
00139     bool               _bShowTypeColumn;
00140 };
00141 
00142 OSG_END_NAMESPACE
00143 
00144 #define OSGQFIELDCONTAINERVIEW_HEADER_CVSID "@(#)$Id: OSGQFieldContainerView_qt.h,v 1.2 2003/05/16 13:54:29 neumannc Exp $"
00145 
00146 #include "OSGQFieldContainerView_qt.inl"
00147 
00148 #endif /* _OSGQFIELDCONTAINERVIEW_H_ */

Generated on Thu Aug 25 04:08:59 2005 for OpenSG by  doxygen 1.4.3