|
QGIS API Documentation
master-6164ace
|
An annotation item that embedds a designer form showing the feature attribute. More...
#include <qgshtmlannotationitem.h>
Inheritance diagram for QgsHtmlAnnotationItem:
Collaboration diagram for QgsHtmlAnnotationItem: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. | |
| QgsVectorLayer * | vectorLayer () 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 |
| QgsVectorLayer * | mVectorLayer |
| Associated vectorlayer (or 0 if attributes are not supposed to be replaced) | |
| QWebView * | mWebView |
| QGraphicsProxyWidget * | mWidgetContainer |
An annotation item that embedds a designer form showing the feature attribute.
Definition at line 30 of file qgshtmlannotationitem.h.
| QgsHtmlAnnotationItem::QgsHtmlAnnotationItem | ( | QgsMapCanvas * | canvas, |
| QgsVectorLayer * | vlayer = 0, |
||
| bool | hasFeature = false, |
||
| int | feature = 0 |
||
| ) |
Definition at line 37 of file qgshtmlannotationitem.cpp.
References javascript(), QgsMapCanvasItem::mMapCanvas, mVectorLayer, mWebView, mWidgetContainer, setFeatureForMapPosition(), and updateVisibility().
Definition at line 57 of file qgshtmlannotationitem.cpp.
References mWebView.
| 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] |
paint function called by map canvas
Reimplemented from QgsMapCanvasItem.
Definition at line 92 of file qgshtmlannotationitem.cpp.
References QgsAnnotationItem::drawFrame(), QgsAnnotationItem::drawMarkerSymbol(), QgsAnnotationItem::drawSelectionBoxes(), QgsAnnotationItem::mFrameBorderWidth, QgsAnnotationItem::mFrameSize, QgsAnnotationItem::mMapPositionFixed, QgsAnnotationItem::mOffsetFromReferencePoint, and mWidgetContainer.
| void QgsHtmlAnnotationItem::readXML | ( | const QDomDocument & | doc, |
| const QDomElement & | itemElem | ||
| ) | [virtual] |
Implements QgsAnnotationItem.
Definition at line 155 of file qgshtmlannotationitem.cpp.
References QgsAnnotationItem::_readXML(), QgsMapLayerRegistry::instance(), QgsMapLayerRegistry::mapLayer(), mFeatureId, mHasAssociatedFeature, mHtmlFile, QgsMapCanvasItem::mMapCanvas, mVectorLayer, mWebView, setFeatureForMapPosition(), setHTMLPage(), and updateVisibility().
| QString QgsHtmlAnnotationItem::replaceText | ( | QString | displayText, |
| QgsVectorLayer * | layer, | ||
| QgsFeature & | feat | ||
| ) | [private] |
| void QgsHtmlAnnotationItem::setFeatureForMapPosition | ( | ) | [private, slot] |
Sets a feature for the current map position and updates the dialog.
Definition at line 184 of file qgshtmlannotationitem.cpp.
References QGis::DEFAULT_IDENTIFY_RADIUS, QgsFeatureRequest::ExactIntersect, QgsMapCanvas::extent(), QgsVectorLayer::getFeatures(), QgsFeature::id(), mFeature, mFeatureId, mHasAssociatedFeature, mHtmlSource, QgsMapCanvasItem::mMapCanvas, QgsAnnotationItem::mMapPosition, mVectorLayer, mWebView, QgsFeatureRequest::NoGeometry, QgsExpression::replaceExpressionText(), vectorLayer(), QgsRectangle::width(), QgsPoint::x(), and QgsPoint::y().
Referenced by QgsHtmlAnnotationItem(), readXML(), setHTMLPage(), and setMapPosition().
| 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().
| QgsVectorLayer* QgsHtmlAnnotationItem::vectorLayer | ( | ) | const [inline] |
Definition at line 53 of file qgshtmlannotationitem.h.
Referenced by setFeatureForMapPosition().
| void QgsHtmlAnnotationItem::writeXML | ( | QDomDocument & | doc | ) | const [virtual] |
Implements QgsAnnotationItem.
Definition at line 134 of file qgshtmlannotationitem.cpp.
References QgsAnnotationItem::_writeXML(), htmlPage(), QgsMapLayer::id(), mFeatureId, mHasAssociatedFeature, and mVectorLayer.
QgsFeature QgsHtmlAnnotationItem::mFeature [private] |
Definition at line 72 of file qgshtmlannotationitem.h.
Referenced by setFeatureForMapPosition().
Associated feature.
Definition at line 71 of file qgshtmlannotationitem.h.
Referenced by readXML(), setFeatureForMapPosition(), and writeXML().
bool QgsHtmlAnnotationItem::mHasAssociatedFeature [private] |
True if the item is related to a vector feature.
Definition at line 69 of file qgshtmlannotationitem.h.
Referenced by readXML(), setFeatureForMapPosition(), and writeXML().
QString QgsHtmlAnnotationItem::mHtmlFile [private] |
Definition at line 73 of file qgshtmlannotationitem.h.
Referenced by readXML(), and setHTMLPage().
QString QgsHtmlAnnotationItem::mHtmlSource [private] |
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().
QWebView* QgsHtmlAnnotationItem::mWebView [private] |
Definition at line 65 of file qgshtmlannotationitem.h.
Referenced by javascript(), minimumFrameSize(), QgsHtmlAnnotationItem(), readXML(), setFeatureForMapPosition(), and ~QgsHtmlAnnotationItem().
QGraphicsProxyWidget* QgsHtmlAnnotationItem::mWidgetContainer [private] |
Definition at line 64 of file qgshtmlannotationitem.h.
Referenced by paint(), and QgsHtmlAnnotationItem().