QGIS API Documentation  master-6164ace
QgsHtmlAnnotationItem Class Reference

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

#include <qgshtmlannotationitem.h>

+ Inheritance diagram for QgsHtmlAnnotationItem:
+ Collaboration diagram for QgsHtmlAnnotationItem:

List of all members.

Public Member Functions

 QgsHtmlAnnotationItem (QgsMapCanvas *canvas, QgsVectorLayer *vlayer=0, bool hasFeature=false, int feature=0)
 ~QgsHtmlAnnotationItem ()
QString htmlPage () 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
void readXML (const QDomDocument &doc, const QDomElement &itemElem)
void setHTMLPage (const QString &htmlFile)
void setMapPosition (const QgsPoint &pos)
 Reimplemented from QgsAnnotationItem.
QgsVectorLayervectorLayer () const
void writeXML (QDomDocument &doc) const

Private Slots

void javascript ()
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

QString replaceText (QString displayText, QgsVectorLayer *layer, QgsFeature &feat)

Private Attributes

QgsFeature mFeature
QgsFeatureId mFeatureId
 Associated feature.
bool mHasAssociatedFeature
 True if the item is related to a vector feature.
QString mHtmlFile
QString mHtmlSource
QgsVectorLayermVectorLayer
 Associated vectorlayer (or 0 if attributes are not supposed to be replaced)
QWebView * mWebView
QGraphicsProxyWidget * mWidgetContainer

Detailed Description

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

Definition at line 30 of file qgshtmlannotationitem.h.


Constructor & Destructor Documentation


Member Function Documentation

QString QgsHtmlAnnotationItem::htmlPage ( ) const [inline]

Definition at line 48 of file qgshtmlannotationitem.h.

Referenced by writeXML().

void QgsHtmlAnnotationItem::javascript ( ) [private, slot]

Definition at line 228 of file qgshtmlannotationitem.cpp.

References QgsMapCanvasItem::mMapCanvas, mVectorLayer, and mWebView.

Referenced by QgsHtmlAnnotationItem().

QSizeF QgsHtmlAnnotationItem::minimumFrameSize ( ) const [virtual]

Reimplemented from QgsAnnotationItem.

Definition at line 121 of file qgshtmlannotationitem.cpp.

References QgsAnnotationItem::mFrameBorderWidth, and mWebView.

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

function to be implemented by derived classes

Implements QgsMapCanvasItem.

Definition at line 87 of file qgshtmlannotationitem.cpp.

void QgsHtmlAnnotationItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget = 0 
) [virtual]
QString QgsHtmlAnnotationItem::replaceText ( QString  displayText,
QgsVectorLayer layer,
QgsFeature feat 
) [private]
void QgsHtmlAnnotationItem::setHTMLPage ( const QString &  htmlFile)

Definition at line 62 of file qgshtmlannotationitem.cpp.

References file, mHtmlFile, mHtmlSource, and setFeatureForMapPosition().

Referenced by readXML().

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

Reimplemented from QgsAnnotationItem.

Reimplemented from QgsAnnotationItem.

Definition at line 81 of file qgshtmlannotationitem.cpp.

References setFeatureForMapPosition().

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

Sets visibility status based on mVectorLayer visibility.

Definition at line 218 of file qgshtmlannotationitem.cpp.

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

Referenced by QgsHtmlAnnotationItem(), and readXML().

Definition at line 53 of file qgshtmlannotationitem.h.

Referenced by setFeatureForMapPosition().


Member Data Documentation

Associated feature.

Definition at line 71 of file qgshtmlannotationitem.h.

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

True if the item is related to a vector feature.

Definition at line 69 of file qgshtmlannotationitem.h.

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

Definition at line 73 of file qgshtmlannotationitem.h.

Referenced by readXML(), and setHTMLPage().

Definition at line 74 of file qgshtmlannotationitem.h.

Referenced by setFeatureForMapPosition(), and setHTMLPage().

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

Definition at line 67 of file qgshtmlannotationitem.h.

Referenced by javascript(), QgsHtmlAnnotationItem(), readXML(), setFeatureForMapPosition(), updateVisibility(), and writeXML().

QGraphicsProxyWidget* QgsHtmlAnnotationItem::mWidgetContainer [private]

Definition at line 64 of file qgshtmlannotationitem.h.

Referenced by paint(), and QgsHtmlAnnotationItem().


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