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

osg::QSFieldView Class Reference

The QT Widget to display an OpenSG SField.

#include <OSGQFieldView_qt.h>

Inheritance diagram for osg::QSFieldView:

osg::QFieldViewBase List of all members.

Public Slots

virtual void beginEdit (UInt32 uiIndex)
virtual void endEdit (void)

Signals

void clicked (FieldContainerPtr pFC, UInt32 uiFieldId, UInt32 uiIndex, ButtonState button)
void doubleClicked (FieldContainerPtr pFC, UInt32 uiFieldId, UInt32 uiIndex, ButtonState button)

Public Member Functions

 QSFieldView (FieldContainerPtr pFC, UInt32 uiFieldId, UInt32 uiAspect, QWidget *parent, const char *name=NULL)
virtual ~QSFieldView (void)
virtual void setAll (FieldContainerPtr pFC, UInt32 uiFieldId, UInt32 uiAspect)
virtual void setFieldContainer (FieldContainerPtr pFC)
virtual void setFieldId (UInt32 uiFieldId)
virtual void setAspect (UInt32 uiAspect)
virtual QSize sizeHint (void) const
virtual QSize minimumSizeHint (void) const
virtual QSizePolicy sizePolicy (void) const
FieldContainerPtrgetFieldContainer (void)
const FieldContainerPtrgetFieldContainer (void) const
UInt32 getFieldId (void) const
UInt32 getAspect (void) const
FieldgetFieldPtr (void)
const FieldgetFieldPtr (void) const

Protected Slots

virtual void onEditorDone (void)
virtual void onFieldUpdated (UInt32 uiIndex)

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *pEvent)
virtual void mouseDoubleClickEvent (QMouseEvent *pEvent)
virtual void paintEvent (QPaintEvent *pEvent)
virtual void resizeEvent (QResizeEvent *pEvent)

Private Types

typedef QFieldViewBase Inherited

Private Member Functions

void initSelf (void)

Private Attributes

QFieldValueLabelBase_pLabel
QFieldEditorBase_pEditor

Detailed Description

Definition at line 127 of file OSGQFieldView_qt.h.


Member Typedef Documentation

typedef QFieldViewBase osg::QSFieldView::Inherited [private]
 

Reimplemented from osg::QFieldViewBase.

Definition at line 165 of file OSGQFieldView_qt.h.


Constructor & Destructor Documentation

QSFieldView::QSFieldView FieldContainerPtr  pFC,
UInt32  uiFieldId,
UInt32  uiAspect,
QWidget *  parent,
const char *  name = NULL
 

Definition at line 117 of file OSGQFieldView_qt.cpp.

References initSelf().

00121     : Inherited(pFC, uiFieldId, uiAspect, parent, name),
00122       _pLabel  (NULL                                  ),
00123       _pEditor (NULL                                  )
00124 {
00125     setBackgroundMode(NoBackground);
00126 
00127     initSelf();
00128 }

QSFieldView::~QSFieldView void   )  [virtual]
 

Definition at line 130 of file OSGQFieldView_qt.cpp.

References _pEditor, _pLabel, and endEdit().

00131 {
00132     endEdit();
00133 
00134     delete _pLabel;
00135     delete _pEditor;
00136 }


Member Function Documentation

void QSFieldView::setAll FieldContainerPtr  pFC,
UInt32  uiFieldId,
UInt32  uiAspect
[virtual]
 

Reimplemented from osg::QFieldViewBase.

Definition at line 139 of file OSGQFieldView_qt.cpp.

References _pEditor, _pLabel, endEdit(), initSelf(), and osg::QFieldViewBase::setAll().

00140 {
00141     endEdit();
00142 
00143     delete _pLabel;
00144     delete _pEditor;
00145 
00146     Inherited::setAll(pFC, uiFieldId, uiAspect);
00147 
00148     initSelf();
00149 }

void QSFieldView::setFieldContainer FieldContainerPtr  pFC  )  [virtual]
 

Reimplemented from osg::QFieldViewBase.

Definition at line 152 of file OSGQFieldView_qt.cpp.

References _pEditor, _pLabel, endEdit(), osg::QFieldViewBase::getFieldContainer(), initSelf(), and osg::QFieldViewBase::setFieldContainer().

00153 {
00154     if(pFC == getFieldContainer())
00155         return;
00156 
00157     endEdit();
00158 
00159     delete _pLabel;
00160     delete _pEditor;
00161 
00162     Inherited::setFieldContainer(pFC);
00163 
00164     initSelf();
00165 }

void QSFieldView::setFieldId UInt32  uiFieldId  )  [virtual]
 

Reimplemented from osg::QFieldViewBase.

Definition at line 168 of file OSGQFieldView_qt.cpp.

References _pEditor, _pLabel, endEdit(), osg::QFieldViewBase::getFieldId(), initSelf(), and osg::QFieldViewBase::setFieldId().

00169 {
00170     if(uiFieldId == getFieldId())
00171         return;
00172 
00173     endEdit();
00174 
00175     delete _pLabel;
00176     delete _pEditor;
00177 
00178     Inherited::setFieldId(uiFieldId);
00179 
00180     initSelf();
00181 }

void QSFieldView::setAspect UInt32  uiAspect  )  [virtual]
 

Reimplemented from osg::QFieldViewBase.

Definition at line 184 of file OSGQFieldView_qt.cpp.

References _pEditor, _pLabel, endEdit(), osg::QFieldViewBase::getAspect(), initSelf(), and osg::QFieldViewBase::setAspect().

00185 {
00186     if(uiAspect == getAspect())
00187         return;
00188 
00189     endEdit();
00190 
00191     delete _pLabel;
00192     delete _pEditor;
00193 
00194     Inherited::setAspect(uiAspect);
00195 
00196     initSelf();
00197 }

QSize QSFieldView::sizeHint void   )  const [virtual]
 

Implements osg::QFieldViewBase.

Definition at line 200 of file OSGQFieldView_qt.cpp.

References _pLabel, and osg::QFieldValueLabelBase::sizeHint().

00201 {
00202     return _pLabel->sizeHint();
00203 }

QSize QSFieldView::minimumSizeHint void   )  const [virtual]
 

Implements osg::QFieldViewBase.

Definition at line 206 of file OSGQFieldView_qt.cpp.

References _pLabel, and osg::QFieldValueLabelBase::minimumSizeHint().

00207 {
00208     return _pLabel->minimumSizeHint();
00209 }

QSizePolicy QSFieldView::sizePolicy void   )  const [virtual]
 

Implements osg::QFieldViewBase.

Definition at line 212 of file OSGQFieldView_qt.cpp.

00213 {
00214     return QSizePolicy(QSizePolicy::MinimumExpanding, 
00215                        QSizePolicy::Fixed            );
00216 }

void QSFieldView::beginEdit UInt32  uiIndex  )  [virtual, slot]
 

Implements osg::QFieldViewBase.

Definition at line 219 of file OSGQFieldView_qt.cpp.

References _pEditor, osg::QFieldEditorBase::activate(), endEdit(), and osg::QFieldEditorBase::setIndex().

00220 {
00221     if(uiIndex != 0)
00222         return;
00223 
00224     endEdit();
00225 
00226     _pEditor->setIndex(uiIndex);
00227     _pEditor->activate(       );
00228 
00229     update();
00230 }

void QSFieldView::endEdit void   )  [virtual, slot]
 

Implements osg::QFieldViewBase.

Definition at line 233 of file OSGQFieldView_qt.cpp.

References _pEditor, osg::QFieldEditorBase::deactivate(), and osg::QFieldEditorBase::getActive().

Referenced by beginEdit(), onEditorDone(), setAll(), setAspect(), setFieldContainer(), setFieldId(), and ~QSFieldView().

00234 {
00235     if(_pEditor && _pEditor->getActive())
00236         _pEditor->deactivate();
00237 
00238     update();
00239 }

void QSFieldView::mousePressEvent QMouseEvent *  pEvent  )  [protected, virtual]
 

Definition at line 242 of file OSGQFieldView_qt.cpp.

References osg::QFieldViewBase::clicked(), osg::QFieldViewBase::getFieldContainer(), and osg::QFieldViewBase::getFieldId().

00243 {
00244     emit clicked(getFieldContainer(), getFieldId(), 0, pEvent->button());
00245 }

void QSFieldView::mouseDoubleClickEvent QMouseEvent *  pEvent  )  [protected, virtual]
 

Definition at line 248 of file OSGQFieldView_qt.cpp.

References osg::QFieldViewBase::doubleClicked(), osg::QFieldViewBase::getFieldContainer(), and osg::QFieldViewBase::getFieldId().

00249 {
00250     emit doubleClicked(getFieldContainer(), getFieldId(), 0, pEvent->button());
00251 }

void QSFieldView::paintEvent QPaintEvent *  pEvent  )  [protected, virtual]
 

Implements osg::QFieldViewBase.

Definition at line 266 of file OSGQFieldView_qt.cpp.

References _pEditor, _pLabel, osg::QFieldEditorBase::getActive(), and osg::QFieldValueLabelBase::paint().

00267 {
00268     if(_pEditor && _pEditor->getActive())
00269         return;
00270 
00271     QPainter painter;
00272     QRect    rectSelf = rect();
00273 
00274     painter.begin(this);
00275 
00276     painter.setClipRect(rectSelf.intersect(pEvent->rect()));
00277 
00278     _pLabel->paint(&painter, palette().active(), rectSelf);
00279 
00280     painter.end();
00281 }

void QSFieldView::resizeEvent QResizeEvent *  pEvent  )  [protected, virtual]
 

Definition at line 284 of file OSGQFieldView_qt.cpp.

References _pEditor.

00285 {
00286     if(_pEditor)
00287         _pEditor->resize(pEvent->size());
00288 }

void QSFieldView::onEditorDone void   )  [protected, virtual, slot]
 

Implements osg::QFieldViewBase.

Definition at line 254 of file OSGQFieldView_qt.cpp.

References endEdit().

Referenced by initSelf().

00255 {
00256     endEdit();
00257 }

void QSFieldView::onFieldUpdated UInt32  uiIndex  )  [protected, virtual, slot]
 

Implements osg::QFieldViewBase.

Definition at line 260 of file OSGQFieldView_qt.cpp.

References _pLabel, and osg::QFieldValueLabelBase::valueChanged().

Referenced by initSelf().

00261 {
00262     _pLabel->valueChanged();
00263 }

void QSFieldView::initSelf void   )  [private]
 

Definition at line 291 of file OSGQFieldView_qt.cpp.

References _pEditor, _pLabel, osg::QFieldEditorFactory::createEditor(), osg::QFieldLabelFactory::createLabel(), onEditorDone(), onFieldUpdated(), osg::QFieldEditorFactory::the(), and osg::QFieldLabelFactory::the().

Referenced by QSFieldView(), setAll(), setAspect(), setFieldContainer(), and setFieldId().

00292 {
00293     _pLabel  = QFieldLabelFactory::the().createLabel  (this, 0);
00294     _pEditor = QFieldEditorFactory::the().createEditor(
00295         0, this, "QSFieldView::_pEditor");
00296 
00297     connect(_pEditor, SIGNAL(editorDone    (void  )),
00298             this,     SLOT  (onEditorDone  (void  )));
00299 
00300     connect(_pEditor, SIGNAL(fieldUpdated  (UInt32)),
00301             this,     SLOT  (onFieldUpdated(UInt32)));
00302 }

FieldContainerPtr & osg::QFieldViewBase::getFieldContainer void   )  [inline, inherited]
 

Definition at line 44 of file OSGQFieldView_qt.inl.

References osg::QFieldViewBase::_pFieldCon.

Referenced by osg::QFieldValueLabelBase::getFieldContainer(), osg::QFieldEditorBase::getFieldPtr(), osg::QMFieldView::mouseDoubleClickEvent(), mouseDoubleClickEvent(), osg::QMFieldView::mousePressEvent(), mousePressEvent(), osg::QMFieldView::setFieldContainer(), and setFieldContainer().

00045 {
00046     return _pFieldCon;
00047 }

const FieldContainerPtr & osg::QFieldViewBase::getFieldContainer void   )  const [inline, inherited]
 

Definition at line 50 of file OSGQFieldView_qt.inl.

References osg::QFieldViewBase::_pFieldCon.

00051 {
00052     return _pFieldCon;
00053 }

UInt32 osg::QFieldViewBase::getFieldId void   )  const [inline, inherited]
 

Definition at line 56 of file OSGQFieldView_qt.inl.

References osg::QFieldViewBase::_uiFieldId.

Referenced by osg::QFieldValueLabelBase::getFieldId(), osg::QMFieldView::mouseDoubleClickEvent(), mouseDoubleClickEvent(), osg::QMFieldView::mousePressEvent(), mousePressEvent(), osg::QMFieldView::setFieldId(), and setFieldId().

00057 {
00058     return _uiFieldId;
00059 }

UInt32 osg::QFieldViewBase::getAspect void   )  const [inline, inherited]
 

Definition at line 62 of file OSGQFieldView_qt.inl.

References osg::QFieldViewBase::_uiAspect.

Referenced by osg::QFieldValueLabelBase::getAspect(), osg::QMFieldView::setAspect(), and setAspect().

00063 {
00064     return _uiAspect;
00065 }

Field * osg::QFieldViewBase::getFieldPtr void   )  [inline, inherited]
 

Definition at line 68 of file OSGQFieldView_qt.inl.

References osg::QFieldViewBase::_pFieldCon, osg::QFieldViewBase::_uiAspect, osg::QFieldViewBase::_uiFieldId, osg::FieldContainerPtrBase::getAspectCPtr(), and osg::FieldContainer::getField().

Referenced by osg::QMFieldView::beginEdit(), osg::QFieldLabelFactory::createLabel(), osg::QFieldContainerView::fillTable(), osg::QFieldValueLabelBase::getFieldPtr(), osg::QMFieldView::initScrollbar(), osg::QMFieldView::mouseDoubleClickEvent(), osg::QMFieldView::mousePressEvent(), osg::QMFieldView::redrawChanged(), and osg::QMFieldView::sizeHint().

00069 {
00070     FieldContainer *pFCAsp = _pFieldCon.getAspectCPtr(_uiAspect);
00071 
00072     return pFCAsp->getField(_uiFieldId);
00073 }

const Field * osg::QFieldViewBase::getFieldPtr void   )  const [inline, inherited]
 

Definition at line 76 of file OSGQFieldView_qt.inl.

References osg::QFieldViewBase::_pFieldCon, osg::QFieldViewBase::_uiAspect, osg::QFieldViewBase::_uiFieldId, osg::FieldContainerPtrBase::getAspectCPtr(), and osg::FieldContainer::getField().

00077 {
00078     FieldContainer *pFCAsp = _pFieldCon.getAspectCPtr(_uiAspect);
00079 
00080     return pFCAsp->getField(_uiFieldId);
00081 }

void osg::QFieldViewBase::clicked FieldContainerPtr  pFC,
UInt32  uiFieldId,
UInt32  uiIndex,
ButtonState  button
[signal, inherited]
 

Referenced by osg::QMFieldView::mousePressEvent(), and mousePressEvent().

void osg::QFieldViewBase::doubleClicked FieldContainerPtr  pFC,
UInt32  uiFieldId,
UInt32  uiIndex,
ButtonState  button
[signal, inherited]
 

Referenced by osg::QMFieldView::mouseDoubleClickEvent(), and mouseDoubleClickEvent().


Member Data Documentation

QFieldValueLabelBase* osg::QSFieldView::_pLabel [private]
 

Definition at line 169 of file OSGQFieldView_qt.h.

Referenced by initSelf(), minimumSizeHint(), onFieldUpdated(), paintEvent(), setAll(), setAspect(), setFieldContainer(), setFieldId(), sizeHint(), and ~QSFieldView().

QFieldEditorBase* osg::QSFieldView::_pEditor [private]
 

Definition at line 170 of file OSGQFieldView_qt.h.

Referenced by beginEdit(), endEdit(), initSelf(), paintEvent(), resizeEvent(), setAll(), setAspect(), setFieldContainer(), setFieldId(), and ~QSFieldView().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 04:31:07 2005 for OpenSG by  doxygen 1.4.3