25 QList<QgsLabelPosition *> searchResults;
27 searchResults.push_back( const_cast< QgsLabelPosition * >( pos ) );
33 QList<QgsLabelPosition *>::const_iterator resultIt = searchResults.constBegin();
34 for ( ; resultIt != searchResults.constEnd(); ++resultIt )
36 if ( ( *resultIt )->labelGeometry.contains( &p ) )
38 posList.push_back( *resultIt );
50 QList<QgsLabelPosition *> searchResults;
51 mSpatialIndex.intersects( r, [&searchResults](
const QgsLabelPosition *pos ) ->
bool {
57 QList<QgsLabelPosition *>::const_iterator resultIt = searchResults.constBegin();
58 for ( ; resultIt != searchResults.constEnd(); ++resultIt )
60 if ( ( *resultIt )->labelGeometry.intersects( r ) )
62 posList.push_back( *resultIt );
69 QList<const QgsCalloutPosition *> searchResults;
70 mCalloutIndex.intersects( rectangle, [&searchResults](
const QgsCalloutPosition *pos ) ->
bool {
71 searchResults.push_back( pos );
75 std::sort( searchResults.begin(), searchResults.end() );
76 searchResults.erase( std::unique( searchResults.begin(), searchResults.end() ), searchResults.end() );
Represents the calculated placement of a map label callout line.
Represents the calculated placement of a map label.
Q_DECL_DEPRECATED void clear()
Removes and deletes all the entries.
void label(const QgsPointXY &p, QList< QgsLabelPosition * > &posList) const
Returns label position(s) at a given point.
void labelsInRect(const QgsRectangle &r, QList< QgsLabelPosition * > &posList) const
Returns label position(s) in given rectangle.
QList< const QgsCalloutPosition * > calloutsInRectangle(const QgsRectangle &rectangle) const
Returns the list of callouts with origins or destinations inside the given rectangle.
Q_DECL_DEPRECATED void setMapSettings(const QgsMapSettings &settings)
Sets the map settings associated with the labeling run.
Q_DECL_DEPRECATED QList< QgsLabelPosition > allLabels() const
Returns a list of all labels generated by the labeling run.
Contains configuration for rendering maps.
A rectangle specified with double values.