|
QGIS API Documentation
2.4.0-Chugiak
|
A maptip is a class to display a tip on a map canvas when a mouse is hovered over a feature. More...
#include <qgsmaptip.h>
Public Member Functions | |
| QgsMapTip () | |
| Default constructor. More... | |
| virtual | ~QgsMapTip () |
| Destructor. More... | |
| void | showMapTip (QgsMapLayer *thepLayer, QgsPoint &theMapPosition, QPoint &thePixelPosition, QgsMapCanvas *mpMapCanvas) |
| Show a maptip at a given point on the map canvas. More... | |
| void | clear (QgsMapCanvas *mpMapCanvas) |
| Clear the current maptip if it exists. More... | |
Private Member Functions | |
| QString | fetchFeature (QgsMapLayer *thepLayer, QgsPoint &theMapPosition, QgsMapCanvas *thepMapCanvas) |
| QString | replaceText (QString displayText, QgsVectorLayer *layer, QgsFeature &feat) |
Private Attributes | |
| bool | mMapTipVisible |
| QPoint | mLastPosition |
A maptip is a class to display a tip on a map canvas when a mouse is hovered over a feature.
Definition at line 29 of file qgsmaptip.h.
| QgsMapTip::QgsMapTip | ( | ) |
|
virtual |
Destructor.
Definition at line 35 of file qgsmaptip.cpp.
| void QgsMapTip::clear | ( | QgsMapCanvas * | mpMapCanvas | ) |
Clear the current maptip if it exists.
| mpMapCanvas | the canvas from which the tip should be cleared. |
Definition at line 65 of file qgsmaptip.cpp.
References mLastPosition, and mMapTipVisible.
|
private |
Definition at line 76 of file qgsmaptip.cpp.
References QgsFeature::attribute(), QgsVectorLayer::displayField(), QgsFeatureRequest::ExactIntersect, QgsVectorLayer::fieldNameIndex(), QgsVectorLayer::getFeatures(), QgsMapCanvas::mapSettings(), QgsMapSettings::mapToLayerCoordinates(), QgsFeatureIterator::nextFeature(), QgsExpression::replaceExpressionText(), QgsMapTool::searchRadiusMU(), QgsRectangle::setXMaximum(), QgsRectangle::setXMinimum(), QgsRectangle::setYMaximum(), QgsRectangle::setYMinimum(), QgsPoint::x(), and QgsPoint::y().
Referenced by showMapTip().
|
private |
| void QgsMapTip::showMapTip | ( | QgsMapLayer * | thepLayer, |
| QgsPoint & | theMapPosition, | ||
| QPoint & | thePixelPosition, | ||
| QgsMapCanvas * | mpMapCanvas | ||
| ) |
Show a maptip at a given point on the map canvas.
| thepLayer | a qgis vector map layer pointer that will be used to provide the attribute data for the map tip. |
| theMapPosition | a reference to the position of the cursor in map coordinatess. |
| thePixelPosition | a reference to the position of the cursor in pixel coordinates. |
| mpMapCanvas | a map canvas on which the tip is drawn |
Definition at line 40 of file qgsmaptip.cpp.
References fetchFeature(), mLastPosition, and mMapTipVisible.
|
private |
Definition at line 68 of file qgsmaptip.h.
Referenced by clear(), and showMapTip().
|
private |
Definition at line 65 of file qgsmaptip.h.
Referenced by clear(), QgsMapTip(), and showMapTip().
1.8.7