Quantum GIS API Documentation
1.8
|
An annotation item that embedds a designer form showing the feature attribute. More...
#include <qgsformannotationitem.h>
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) |
QgsVectorLayer * | vectorLayer () 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 |
QgsVectorLayer * | mVectorLayer |
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. |
An annotation item that embedds a designer form showing the feature attribute.
Definition at line 28 of file qgsformannotationitem.h.
QgsFormAnnotationItem::QgsFormAnnotationItem | ( | QgsMapCanvas * | canvas, |
QgsVectorLayer * | vlayer = 0 , |
||
bool | hasFeature = false , |
||
int | feature = 0 |
||
) |
Definition at line 35 of file qgsformannotationitem.cpp.
References QgsVectorLayer::annotationForm(), mDesignerForm, QgsMapCanvasItem::mMapCanvas, mVectorLayer, mWidgetContainer, setFeatureForMapPosition(), and updateVisibility().
Definition at line 51 of file qgsformannotationitem.cpp.
References mDesignerWidget.
QWidget * QgsFormAnnotationItem::createDesignerWidget | ( | const QString & | filePath | ) | [private] |
Definition at line 70 of file qgsformannotationitem.cpp.
References QgsFeature::attributeMap(), QgsAttributeEditor::createAttributeEditor(), QgsVectorLayer::featureAtId(), file, mFeature, mHasAssociatedFeature, mVectorLayer, and QgsVectorLayer::pendingFields().
Referenced by readXML(), setDesignerForm(), and setFeatureForMapPosition().
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] |
paint function called by map canvas
Reimplemented from QgsMapCanvasItem.
Definition at line 121 of file qgsformannotationitem.cpp.
References QgsAnnotationItem::drawFrame(), QgsAnnotationItem::drawMarkerSymbol(), QgsAnnotationItem::drawSelectionBoxes(), QgsAnnotationItem::mFrameBorderWidth, QgsAnnotationItem::mFrameSize, QgsAnnotationItem::mMapPositionFixed, QgsAnnotationItem::mOffsetFromReferencePoint, and mWidgetContainer.
QSizeF QgsFormAnnotationItem::preferredFrameSize | ( | ) | const |
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] |
Implements QgsAnnotationItem.
Definition at line 191 of file qgsformannotationitem.cpp.
References QgsAnnotationItem::_readXML(), createDesignerWidget(), QgsMapLayerRegistry::instance(), QgsMapLayerRegistry::mapLayer(), mDesignerForm, mDesignerWidget, mFeature, QgsAnnotationItem::mFrameBackgroundColor, mHasAssociatedFeature, QgsMapCanvasItem::mMapCanvas, mVectorLayer, mWidgetContainer, setFeatureForMapPosition(), and updateVisibility().
void QgsFormAnnotationItem::setDesignerForm | ( | const QString & | uiFile | ) |
Definition at line 56 of file qgsformannotationitem.cpp.
References createDesignerWidget(), mDesignerForm, mDesignerWidget, QgsAnnotationItem::mFrameBackgroundColor, mWidgetContainer, preferredFrameSize(), and QgsAnnotationItem::setFrameSize().
void QgsFormAnnotationItem::setFeatureForMapPosition | ( | ) | [private, slot] |
Sets a feature for the current map position and updates the dialog.
Definition at line 222 of file qgsformannotationitem.cpp.
References createDesignerWidget(), QGis::DEFAULT_IDENTIFY_RADIUS, QgsMapCanvas::extent(), QgsFeature::id(), mDesignerForm, mDesignerWidget, mFeature, QgsAnnotationItem::mFrameBackgroundColor, mHasAssociatedFeature, QgsMapCanvasItem::mMapCanvas, QgsAnnotationItem::mMapPosition, mVectorLayer, mWidgetContainer, QgsVectorLayer::nextFeature(), QgsVectorLayer::select(), QgsRectangle::width(), QgsPoint::x(), and QgsPoint::y().
Referenced by QgsFormAnnotationItem(), readXML(), and setMapPosition().
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().
QgsVectorLayer* QgsFormAnnotationItem::vectorLayer | ( | ) | const [inline] |
Definition at line 53 of file qgsformannotationitem.h.
void QgsFormAnnotationItem::writeXML | ( | QDomDocument & | doc | ) | const [virtual] |
Implements QgsAnnotationItem.
Definition at line 171 of file qgsformannotationitem.cpp.
References QgsAnnotationItem::_writeXML(), QgsMapLayer::id(), mDesignerForm, mFeature, mHasAssociatedFeature, and mVectorLayer.
QString QgsFormAnnotationItem::mDesignerForm [private] |
Path to (and including) the .ui file.
Definition at line 71 of file qgsformannotationitem.h.
Referenced by QgsFormAnnotationItem(), readXML(), setDesignerForm(), setFeatureForMapPosition(), and writeXML().
QWidget* QgsFormAnnotationItem::mDesignerWidget [private] |
Definition at line 63 of file qgsformannotationitem.h.
Referenced by minimumFrameSize(), preferredFrameSize(), readXML(), setDesignerForm(), setFeatureForMapPosition(), and ~QgsFormAnnotationItem().
QgsFeatureId QgsFormAnnotationItem::mFeature [private] |
Associated feature.
Definition at line 69 of file qgsformannotationitem.h.
Referenced by createDesignerWidget(), readXML(), setFeatureForMapPosition(), and writeXML().
bool QgsFormAnnotationItem::mHasAssociatedFeature [private] |
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] |
Definition at line 62 of file qgsformannotationitem.h.
Referenced by paint(), QgsFormAnnotationItem(), readXML(), setDesignerForm(), and setFeatureForMapPosition().