mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
Adress comments
This commit is contained in:
parent
082f82baab
commit
10897ff3a9
@ -87,14 +87,16 @@ Returns the current combination of flags set for the scene.
|
||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent *event );
|
||||
|
||||
|
||||
QRectF modelBounds( double margin ) const;
|
||||
QRectF modelBounds( double margin = 0.0 ) const;
|
||||
%Docstring
|
||||
Calculates the bouding bounds of all components of the model.
|
||||
Calculates the bounding rectangle of all components of the model.
|
||||
|
||||
:param margin: optional marginal ( absolute value in scene coordinate)
|
||||
to add around items
|
||||
:param margin: optional margin (absolute value in scene coordinates) to
|
||||
add around items.
|
||||
|
||||
:return: model bounds, in scene units.
|
||||
|
||||
.. versionadded:: 3.44
|
||||
%End
|
||||
|
||||
|
||||
|
@ -87,14 +87,16 @@ Returns the current combination of flags set for the scene.
|
||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent *event );
|
||||
|
||||
|
||||
QRectF modelBounds( double margin ) const;
|
||||
QRectF modelBounds( double margin = 0.0 ) const;
|
||||
%Docstring
|
||||
Calculates the bouding bounds of all components of the model.
|
||||
Calculates the bounding rectangle of all components of the model.
|
||||
|
||||
:param margin: optional marginal ( absolute value in scene coordinate)
|
||||
to add around items
|
||||
:param margin: optional margin (absolute value in scene coordinates) to
|
||||
add around items.
|
||||
|
||||
:return: model bounds, in scene units.
|
||||
|
||||
.. versionadded:: 3.44
|
||||
%End
|
||||
|
||||
|
||||
|
@ -75,11 +75,8 @@ QRectF QgsModelGraphicsScene::modelBounds( double margin ) const
|
||||
for ( QGraphicsItem *item : constItems )
|
||||
{
|
||||
QgsModelComponentGraphicItem *componentItem = dynamic_cast<QgsModelComponentGraphicItem *>( item );
|
||||
if ( !componentItem )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
bounds = bounds.united( componentItem->sceneBoundingRect() );
|
||||
if ( componentItem )
|
||||
bounds = bounds.united( componentItem->sceneBoundingRect() );
|
||||
}
|
||||
|
||||
if ( bounds.isValid() && margin > 0.0 )
|
||||
|
@ -99,12 +99,12 @@ class GUI_EXPORT QgsModelGraphicsScene : public QGraphicsScene
|
||||
void mousePressEvent( QGraphicsSceneMouseEvent *event ) override;
|
||||
|
||||
/**
|
||||
* Calculates the bouding bounds of all components of the model.
|
||||
* \param margin optional marginal ( absolute value in scene coordinate) to add around items
|
||||
* Calculates the bounding rectangle of all components of the model.
|
||||
* \param margin optional margin (absolute value in scene coordinates) to add around items.
|
||||
* \returns model bounds, in scene units.
|
||||
*
|
||||
* \since QGIS 3.44
|
||||
*/
|
||||
QRectF modelBounds( double margin ) const;
|
||||
QRectF modelBounds( double margin = 0.0 ) const;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -397,7 +397,6 @@ void QgsModelGraphicsView::setModelScene( QgsModelGraphicsScene *scene )
|
||||
{
|
||||
setScene( scene );
|
||||
|
||||
mPreviousSceneRect = sceneRect();
|
||||
// IMPORTANT!
|
||||
// previous snap markers, snap lines are owned by previous layout - so don't delete them here!
|
||||
mSnapMarker = new QgsModelViewSnapMarker();
|
||||
|
@ -244,8 +244,6 @@ class GUI_EXPORT QgsModelGraphicsView : public QGraphicsView
|
||||
|
||||
QgsModelSnapper mSnapper;
|
||||
QgsModelViewSnapMarker *mSnapMarker = nullptr;
|
||||
|
||||
QRectF mPreviousSceneRect;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user