28#include <QAbstractButton>
32#include "moc_qgsmaptool.cpp"
34using namespace Qt::StringLiterals;
54 return mCanvas->getCoordinateTransform()->toMapCoordinates( point );
59 return mCanvas->mapSettings().layerToMapCoordinates(
layer, point );
70 return mCanvas->mapSettings().mapToLayerCoordinates(
layer, point );
75 return mCanvas->mapSettings().mapToLayerCoordinates(
layer, point );
80 return mCanvas->mapSettings().layerToMapCoordinates(
layer, point );
85 return mCanvas->mapSettings().mapToLayerCoordinates(
layer, rect );
90 qreal x = point.
x(), y = point.
y();
91 mCanvas->getCoordinateTransform()->transformInPlace( x, y );
92 return QPoint( std::round( x ), std::round( y ) );
143 disconnect(
mAction, &QObject::destroyed,
this, &QgsMapTool::actionDestroyed );
146 connect(
mAction, &QObject::destroyed,
this, &QgsMapTool::actionDestroyed );
149void QgsMapTool::actionDestroyed()
281 if ( !properties.
isActive( propertyKey ) )
286 switch ( property.propertyType() )
297 return property.field();
310 if ( expression.
prepare( &context ) )
317 return columnRef->
name();
328 if ( function->name() ==
"coalesce"_L1 )
336 return columnRef->
name();
358 if ( !fieldname.isEmpty() )
@ Invalid
Invalid (not set) property.
@ Field
Field based property.
@ Expression
Expression based property.
@ Millimeters
Millimeters.
static const double DEFAULT_SEARCH_RADIUS_MM
Identify search radius in mm.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
An abstract base class for defining QgsExpression functions.
An expression node which takes its value from a feature's field.
QString name() const
The name of the column.
An expression node for expression functions.
int fnIndex() const
Returns the index of the node's function.
QgsExpressionNode::NodeList * args() const
Returns a list of arguments specified for the function.
QList< QgsExpressionNode * > list()
Gets a list of all the nodes.
Abstract base class for all nodes that can appear in an expression.
virtual QgsExpressionNode::NodeType nodeType() const =0
Gets the type of this node.
const QgsExpressionNode * effectiveNode() const
Returns a reference to the simplest node which represents this node, after any compilation optimizati...
Handles parsing and evaluation of expressions (formerly called "search strings").
bool prepare(const QgsExpressionContext *context)
Gets the expression ready for evaluation - find out column indexes.
const QgsExpressionNode * rootNode() const
Returns the root node of the expression.
Q_INVOKABLE int lookupField(const QString &fieldName) const
Looks up field's index from the field name.
Base class for all map layer types.
A mouse event which is the result of a user interaction with a QgsMapCanvas.
Contains configuration for rendering maps.
double magnificationFactor() const
Returns the magnification factor.
Point geometry type, with support for z-dimension and m-values.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
bool isActive(int key) const final
Returns true if the collection contains an active property with the specified key.
QgsProperty property(int key) const final
Returns a matching property from the collection, if one exists.
A store for object properties.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
double convertToMapUnits(double size, Qgis::RenderUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale()) const
Converts a size from the specified units to map units.
static QgsRenderContext fromMapSettings(const QgsMapSettings &mapSettings)
create initialized QgsRenderContext instance from given QgsMapSettings
static QgsSettingsTreeNode * sTreeMap
Represents a vector layer which manages a vector based dataset.
#define QgsDebugMsgLevel(str, level)