Skip to content

Commit

Permalink
Rebase to master
Browse files Browse the repository at this point in the history
  • Loading branch information
domi4484 committed Jan 10, 2022
1 parent 4b8485f commit 028eaf8
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 28 deletions.
10 changes: 5 additions & 5 deletions python/core/auto_additions/qgis.py
Expand Up @@ -773,12 +773,12 @@
Qgis.TemporalIntervalMatchMethod.__doc__ = 'Method to use when resolving a temporal range to a data provider layer or band.\n\n.. versionadded:: 3.22\n\n' + '* ``MatchUsingWholeRange``: ' + Qgis.TemporalIntervalMatchMethod.MatchUsingWholeRange.__doc__ + '\n' + '* ``MatchExactUsingStartOfRange``: ' + Qgis.TemporalIntervalMatchMethod.MatchExactUsingStartOfRange.__doc__ + '\n' + '* ``MatchExactUsingEndOfRange``: ' + Qgis.TemporalIntervalMatchMethod.MatchExactUsingEndOfRange.__doc__ + '\n' + '* ``FindClosestMatchToStartOfRange``: ' + Qgis.TemporalIntervalMatchMethod.FindClosestMatchToStartOfRange.__doc__ + '\n' + '* ``FindClosestMatchToEndOfRange``: ' + Qgis.TemporalIntervalMatchMethod.FindClosestMatchToEndOfRange.__doc__
# --
Qgis.TemporalIntervalMatchMethod.baseClass = Qgis
QgsCoordinateTransform.TransformDirection = Qgis.TransformDirection
# monkey patching scoped based enum
Qgis.CoordinateType.XY.__doc__ = "Coordinate defined by X and Y values"
Qgis.CoordinateType.Point.__doc__ = "Coordinate defined by a point"
Qgis.CoordinateType.__doc__ = 'Types of coordinate definitions\n\n.. versionadded:: 3.22\n\n' + '* ``XY``: ' + Qgis.CoordinateType.XY.__doc__ + '\n' + '* ``Point``: ' + Qgis.CoordinateType.Point.__doc__
# --
Qgis.CoordinateType.baseClass = Qgis
QgsCoordinateTransform.ForwardTransform = Qgis.TransformDirection.Forward
QgsCoordinateTransform.ForwardTransform.is_monkey_patched = True
QgsCoordinateTransform.ForwardTransform.__doc__ = "Forward transform (from source to destination)"
QgsCoordinateTransform.ReverseTransform = Qgis.TransformDirection.Reverse
QgsCoordinateTransform.ReverseTransform.is_monkey_patched = True
QgsCoordinateTransform.ReverseTransform.__doc__ = "Reverse/inverse transform (from destination to source)"
Qgis.TransformDirection.__doc__ = 'Indicates the direction (forward or inverse) of a transform.\n\n.. versionadded:: 3.22\n\n' + '* ``ForwardTransform``: ' + Qgis.TransformDirection.Forward.__doc__ + '\n' + '* ``ReverseTransform``: ' + Qgis.TransformDirection.Reverse.__doc__
Expand Down
8 changes: 4 additions & 4 deletions python/core/auto_generated/qgis.sip.in
Expand Up @@ -554,10 +554,10 @@ The development version
FindClosestMatchToEndOfRange
};

enum class CoordinateType
{
XY,
Point
enum class TransformDirection
{
Forward,
Reverse
};

enum class MapSettingsFlag
Expand Down
7 changes: 0 additions & 7 deletions src/app/labeling/qgsmaptoollabel.h
Expand Up @@ -219,13 +219,6 @@ class APP_EXPORT QgsMapToolLabel: public QgsMapToolAdvancedDigitizing
bool createAuxiliaryFields( QgsCalloutIndexes &calloutIndexes );
bool createAuxiliaryFields( QgsCalloutPosition &details, QgsCalloutIndexes &calloutIndexes );

bool createAuxiliaryFields( QgsPalIndexes &palIndexes );
bool createAuxiliaryFields( LabelDetails &details, QgsPalIndexes &palIndexes ) const;
bool createAuxiliaryFields( QgsDiagramIndexes &diagIndexes );
bool createAuxiliaryFields( LabelDetails &details, QgsDiagramIndexes &diagIndexes );
bool createAuxiliaryFields( QgsCalloutIndexes &calloutIndexes );
bool createAuxiliaryFields( QgsCalloutPosition &details, QgsCalloutIndexes &calloutIndexes );

void updateHoveredLabel( QgsMapMouseEvent *e );
void clearHoveredLabel();
virtual bool canModifyLabel( const LabelDetails &label );
Expand Down
20 changes: 10 additions & 10 deletions src/app/labeling/qgsmaptoolmovelabel.cpp
Expand Up @@ -243,18 +243,18 @@ void QgsMapToolMoveLabel::cadCanvasPressEvent( QgsMapMouseEvent *e )
return;
}
}
}

mStartPointMapCoords = e->mapPoint();
QgsPointXY referencePoint;
if ( !currentLabelRotationPoint( referencePoint, !currentLabelPreserveRotation() ) )
{
referencePoint.setX( mCurrentLabel.pos.labelRect.xMinimum() );
referencePoint.setY( mCurrentLabel.pos.labelRect.yMinimum() );
mStartPointMapCoords = e->mapPoint();
QgsPointXY referencePoint;
if ( !currentLabelRotationPoint( referencePoint, !currentLabelPreserveRotation() ) )
{
referencePoint.setX( mCurrentLabel.pos.labelRect.xMinimum() );
referencePoint.setY( mCurrentLabel.pos.labelRect.yMinimum() );
}
mClickOffsetX = mStartPointMapCoords.x() - referencePoint.x();
mClickOffsetY = mStartPointMapCoords.y() - referencePoint.y();
createRubberBands();
}
mClickOffsetX = mStartPointMapCoords.x() - referencePoint.x();
mClickOffsetY = mStartPointMapCoords.y() - referencePoint.y();
createRubberBands();
}
}
else
Expand Down
11 changes: 11 additions & 0 deletions src/core/qgis.h
Expand Up @@ -902,6 +902,17 @@ class CORE_EXPORT Qgis
Q_ENUM( TemporalIntervalMatchMethod )

/**
* Indicates the direction (forward or inverse) of a transform.
*
* \since QGIS 3.22
*/
enum class TransformDirection SIP_MONKEYPATCH_SCOPEENUM_UNNEST( QgsCoordinateTransform, TransformDirection ) : int
{
Forward SIP_MONKEYPATCH_COMPAT_NAME( ForwardTransform ), //!< Forward transform (from source to destination)
Reverse SIP_MONKEYPATCH_COMPAT_NAME( ReverseTransform ) //!< Reverse/inverse transform (from destination to source)
};
Q_ENUM( TransformDirection )

/**
* Flags which adjust the way maps are rendered.
*
Expand Down
7 changes: 5 additions & 2 deletions src/ui/qgstextformatwidgetbase.ui
Expand Up @@ -3934,8 +3934,8 @@ font-style: italic;</string>
<rect>
<x>0</x>
<y>0</y>
<width>488</width>
<height>404</height>
<width>159</width>
<height>211</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_46">
Expand Down Expand Up @@ -6950,6 +6950,9 @@ font-style: italic;</string>
<tabstop>mGeometryGeneratorGroupBox</tabstop>
<tabstop>mGeometryGeneratorExpressionButton</tabstop>
<tabstop>mGeometryGeneratorType</tabstop>
<tabstop>mCoordXDDBtn</tabstop>
<tabstop>mCoordYDDBtn</tabstop>
<tabstop>mCoordPointDDBtn</tabstop>
<tabstop>mCoordAlignmentHDDBtn</tabstop>
<tabstop>mCoordAlignmentVDDBtn</tabstop>
<tabstop>mCoordRotationDDBtn</tabstop>
Expand Down

0 comments on commit 028eaf8

Please sign in to comment.