32 mMapTipVisible =
false;
54 QString myTipText = fetchFeature( thepLayer, theMapPosition, thepMapCanvas );
55 mMapTipVisible = !myTipText.
isEmpty();
61 mLastPosition = thePixelPosition;
67 if ( !mMapTipVisible )
73 mMapTipVisible =
false;
A rectangle specified with double values.
Base class for all map layer types.
void setXMaximum(double x)
Set the maximum x value.
Use exact geometry intersection (slower) instead of bounding boxes.
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest())
Query the provider for features specified in request.
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QgsPoint mapToLayerCoordinates(QgsMapLayer *theLayer, QgsPoint point) const
transform point coordinates from output CRS to layer's CRS
void showText(const QPoint &pos, const QString &text, QWidget *w)
virtual ~QgsMapTip()
Destructor.
Map canvas is a class for displaying all GIS data types on a canvas.
double x() const
Get the x value of the point.
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context...
void setYMinimum(double y)
Set the minimum y value.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void showMapTip(QgsMapLayer *thepLayer, QgsPoint &theMapPosition, QPoint &thePixelPosition, QgsMapCanvas *mpMapCanvas)
Show a maptip at a given point on the map canvas.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
const QString displayField() const
Returns the primary display field name used in the identify results dialog.
A class to represent a point.
void clear(QgsMapCanvas *mpMapCanvas)
Clear the current maptip if it exists.
static QgsExpressionContextScope * mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object...
QVariant attribute(const QString &name) const
Lookup attribute value from attribute name.
void setYMaximum(double y)
Set the maximum y value.
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
static Q_DECL_DEPRECATED QString replaceExpressionText(const QString &action, const QgsFeature *feat, QgsVectorLayer *layer, const QMap< QString, QVariant > *substitutionMap=nullptr, const QgsDistanceArea *distanceArea=nullptr)
This function currently replaces each expression between [% and %] in the string with the result of i...
double y() const
Get the y value of the point.
QgsMapTip()
Default constructor.
static QgsExpressionContextScope * projectScope()
Creates a new scope which contains variables and functions relating to the current QGIS project...
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
bool nextFeature(QgsFeature &f)
Represents a vector layer which manages a vector based data sets.
int fieldNameIndex(const QString &fieldName) const
Returns the index of a field name or -1 if the field does not exist.
void setXMinimum(double x)
Set the minimum x value.