#include <qgsmaptip.h>
Public Member Functions | |
| QgsMapTip () | |
| Default constructor. | |
| virtual | ~QgsMapTip () |
| Destructor. | |
| void | showMapTip (QgsMapLayer *thepLayer, QgsPoint &theMapPosition, QPoint &thePixelPosition, QgsMapCanvas *mpMapCanvas) |
| Show a maptip at a given point on the map canvas. | |
| void | clear (QgsMapCanvas *mpMapCanvas) |
| Clear the current maptip if it exists. | |
Private Member Functions | |
| QString | fetchFeature (QgsMapLayer *thepLayer, QgsPoint &theMapPosition, QgsMapCanvas *thepMapCanvas) |
Private Attributes | |
| bool | mMapTipVisible |
| QPoint | mLastPosition |
Definition at line 28 of file qgsmaptip.h.
| QgsMapTip::QgsMapTip | ( | ) |
| QgsMapTip::~QgsMapTip | ( | ) | [virtual] |
| 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 39 of file qgsmaptip.cpp.
References fetchFeature(), mLastPosition, and mMapTipVisible.
| 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 68 of file qgsmaptip.cpp.
References mLastPosition, and mMapTipVisible.
| QString QgsMapTip::fetchFeature | ( | QgsMapLayer * | thepLayer, | |
| QgsPoint & | theMapPosition, | |||
| QgsMapCanvas * | thepMapCanvas | |||
| ) | [private] |
Definition at line 79 of file qgsmaptip.cpp.
References QgsVectorDataProvider::attributeIndexes(), QgsFeature::attributeMap(), QGis::DEFAULT_IDENTIFY_RADIUS, QgsMapCanvas::extent(), QgsVectorDataProvider::fields(), QgsVectorDataProvider::nextFeature(), QgsVectorDataProvider::select(), QgsRectangle::setXMaximum(), QgsRectangle::setXMinimum(), QgsRectangle::setYMaximum(), QgsRectangle::setYMinimum(), QgsRectangle::width(), QgsPoint::x(), and QgsPoint::y().
Referenced by showMapTip().
bool QgsMapTip::mMapTipVisible [private] |
QPoint QgsMapTip::mLastPosition [private] |
1.5.6