QGIS API Documentation  2.3.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
QgsMapTip Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

QgsMapTip::QgsMapTip ( )

Default constructor.

Definition at line 29 of file qgsmaptip.cpp.

References mMapTipVisible.

QgsMapTip::~QgsMapTip ( )
virtual

Destructor.

Definition at line 35 of file qgsmaptip.cpp.

Member Function Documentation

void QgsMapTip::clear ( QgsMapCanvas mpMapCanvas)

Clear the current maptip if it exists.

Parameters
mpMapCanvasthe canvas from which the tip should be cleared.

Definition at line 65 of file qgsmaptip.cpp.

References mLastPosition, and mMapTipVisible.

QString QgsMapTip::fetchFeature ( QgsMapLayer thepLayer,
QgsPoint theMapPosition,
QgsMapCanvas thepMapCanvas 
)
private
QString QgsMapTip::replaceText ( QString  displayText,
QgsVectorLayer layer,
QgsFeature feat 
)
private
void QgsMapTip::showMapTip ( QgsMapLayer thepLayer,
QgsPoint theMapPosition,
QPoint &  thePixelPosition,
QgsMapCanvas mpMapCanvas 
)

Show a maptip at a given point on the map canvas.

Parameters
thepLayera qgis vector map layer pointer that will be used to provide the attribute data for the map tip.
theMapPositiona reference to the position of the cursor in map coordinatess.
thePixelPositiona reference to the position of the cursor in pixel coordinates.
mpMapCanvasa map canvas on which the tip is drawn

Definition at line 40 of file qgsmaptip.cpp.

References fetchFeature(), mLastPosition, and mMapTipVisible.

Member Data Documentation

QPoint QgsMapTip::mLastPosition
private

Definition at line 68 of file qgsmaptip.h.

Referenced by clear(), and showMapTip().

bool QgsMapTip::mMapTipVisible
private

Definition at line 65 of file qgsmaptip.h.

Referenced by clear(), QgsMapTip(), and showMapTip().


The documentation for this class was generated from the following files: