Quantum GIS API Documentation  1.8
Public Member Functions | Private Slots | Private Member Functions | Private Attributes
QgsFormAnnotationItem Class Reference

An annotation item that embedds a designer form showing the feature attribute. More...

#include <qgsformannotationitem.h>

Inheritance diagram for QgsFormAnnotationItem:
Inheritance graph
[legend]
Collaboration diagram for QgsFormAnnotationItem:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 QgsFormAnnotationItem (QgsMapCanvas *canvas, QgsVectorLayer *vlayer=0, bool hasFeature=false, int feature=0)
 ~QgsFormAnnotationItem ()
void paint (QPainter *painter)
 function to be implemented by derived classes
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
 paint function called by map canvas
QSizeF minimumFrameSize () const
QSizeF preferredFrameSize () const
 Returns the optimal frame size.
void setMapPosition (const QgsPoint &pos)
 Reimplemented from QgsAnnotationItem.
void setDesignerForm (const QString &uiFile)
QString designerForm () const
void writeXML (QDomDocument &doc) const
void readXML (const QDomDocument &doc, const QDomElement &itemElem)
QgsVectorLayervectorLayer () const

Private Slots

void setFeatureForMapPosition ()
 Sets a feature for the current map position and updates the dialog.
void updateVisibility ()
 Sets visibility status based on mVectorLayer visibility.

Private Member Functions

QWidget * createDesignerWidget (const QString &filePath)

Private Attributes

QGraphicsProxyWidget * mWidgetContainer
QWidget * mDesignerWidget
QgsVectorLayermVectorLayer
 Associated vectorlayer (or 0 if attributes are not supposed to be replaced)
bool mHasAssociatedFeature
 True if the item is related to a vector feature.
QgsFeatureId mFeature
 Associated feature.
QString mDesignerForm
 Path to (and including) the .ui file.

Detailed Description

An annotation item that embedds a designer form showing the feature attribute.

Definition at line 28 of file qgsformannotationitem.h.


Constructor & Destructor Documentation

QgsFormAnnotationItem::QgsFormAnnotationItem ( QgsMapCanvas canvas,
QgsVectorLayer vlayer = 0,
bool  hasFeature = false,
int  feature = 0 
)

Definition at line 51 of file qgsformannotationitem.cpp.

References mDesignerWidget.


Member Function Documentation

QWidget * QgsFormAnnotationItem::createDesignerWidget ( const QString &  filePath) [private]
QString QgsFormAnnotationItem::designerForm ( ) const [inline]

Definition at line 48 of file qgsformannotationitem.h.

QSizeF QgsFormAnnotationItem::minimumFrameSize ( ) const [virtual]

Reimplemented from QgsAnnotationItem.

Definition at line 146 of file qgsformannotationitem.cpp.

References mDesignerWidget, and QgsAnnotationItem::mFrameBorderWidth.

void QgsFormAnnotationItem::paint ( QPainter *  painter) [virtual]

function to be implemented by derived classes

Implements QgsMapCanvasItem.

Definition at line 116 of file qgsformannotationitem.cpp.

void QgsFormAnnotationItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
) [virtual]

Returns the optimal frame size.

Definition at line 159 of file qgsformannotationitem.cpp.

References mDesignerWidget.

Referenced by setDesignerForm().

void QgsFormAnnotationItem::readXML ( const QDomDocument &  doc,
const QDomElement &  itemElem 
) [virtual]
void QgsFormAnnotationItem::setDesignerForm ( const QString &  uiFile)
void QgsFormAnnotationItem::setMapPosition ( const QgsPoint pos) [virtual]

Reimplemented from QgsAnnotationItem.

Reimplemented from QgsAnnotationItem.

Definition at line 110 of file qgsformannotationitem.cpp.

References setFeatureForMapPosition().

void QgsFormAnnotationItem::updateVisibility ( ) [private, slot]

Sets visibility status based on mVectorLayer visibility.

Definition at line 262 of file qgsformannotationitem.cpp.

References QgsMapCanvas::layers(), QgsMapCanvasItem::mMapCanvas, and mVectorLayer.

Referenced by QgsFormAnnotationItem(), and readXML().

Definition at line 53 of file qgsformannotationitem.h.

void QgsFormAnnotationItem::writeXML ( QDomDocument &  doc) const [virtual]

Member Data Documentation

Path to (and including) the .ui file.

Definition at line 71 of file qgsformannotationitem.h.

Referenced by QgsFormAnnotationItem(), readXML(), setDesignerForm(), setFeatureForMapPosition(), and writeXML().

Associated feature.

Definition at line 69 of file qgsformannotationitem.h.

Referenced by createDesignerWidget(), readXML(), setFeatureForMapPosition(), and writeXML().

True if the item is related to a vector feature.

Definition at line 67 of file qgsformannotationitem.h.

Referenced by createDesignerWidget(), readXML(), setFeatureForMapPosition(), and writeXML().

Associated vectorlayer (or 0 if attributes are not supposed to be replaced)

Definition at line 65 of file qgsformannotationitem.h.

Referenced by createDesignerWidget(), QgsFormAnnotationItem(), readXML(), setFeatureForMapPosition(), updateVisibility(), and writeXML().

QGraphicsProxyWidget* QgsFormAnnotationItem::mWidgetContainer [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines