QGIS API Documentation  master-6227475
QgsFormAnnotationItem Class Reference

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

#include <qgsformannotationitem.h>

+ Inheritance diagram for QgsFormAnnotationItem:
+ Collaboration diagram for QgsFormAnnotationItem:

List of all members.

Public Member Functions

 QgsFormAnnotationItem (QgsMapCanvas *canvas, QgsVectorLayer *vlayer=0, bool hasFeature=false, int feature=0)
 ~QgsFormAnnotationItem ()
QString designerForm () const
QSizeF minimumFrameSize () const
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 preferredFrameSize () const
 Returns the optimal frame size.
void readXML (const QDomDocument &doc, const QDomElement &itemElem)
void setDesignerForm (const QString &uiFile)
void setMapPosition (const QgsPoint &pos)
 Reimplemented from QgsAnnotationItem.
QgsVectorLayervectorLayer () const
void writeXML (QDomDocument &doc) 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

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

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


Member Function Documentation

QString QgsFormAnnotationItem::designerForm ( ) const [inline]

Definition at line 48 of file qgsformannotationitem.h.

QSizeF QgsFormAnnotationItem::minimumFrameSize ( ) const [virtual]

Reimplemented from QgsAnnotationItem.

Definition at line 144 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 114 of file qgsformannotationitem.cpp.

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

Returns the optimal frame size.

Definition at line 157 of file qgsformannotationitem.cpp.

References mDesignerWidget.

Referenced by setDesignerForm().

void QgsFormAnnotationItem::setMapPosition ( const QgsPoint pos) [virtual]

Reimplemented from QgsAnnotationItem.

Reimplemented from QgsAnnotationItem.

Definition at line 108 of file qgsformannotationitem.cpp.

References setFeatureForMapPosition().

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

Sets visibility status based on mVectorLayer visibility.

Definition at line 260 of file qgsformannotationitem.cpp.

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

Referenced by QgsFormAnnotationItem(), and readXML().

Definition at line 53 of file qgsformannotationitem.h.


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().

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().


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