mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -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 );
|
virtual void mousePressEvent( QGraphicsSceneMouseEvent *event );
|
||||||
|
|
||||||
|
|
||||||
QRectF modelBounds( double margin ) const;
|
QRectF modelBounds( double margin = 0.0 ) const;
|
||||||
%Docstring
|
%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)
|
:param margin: optional margin (absolute value in scene coordinates) to
|
||||||
to add around items
|
add around items.
|
||||||
|
|
||||||
:return: model bounds, in scene units.
|
:return: model bounds, in scene units.
|
||||||
|
|
||||||
|
.. versionadded:: 3.44
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,14 +87,16 @@ Returns the current combination of flags set for the scene.
|
|||||||
virtual void mousePressEvent( QGraphicsSceneMouseEvent *event );
|
virtual void mousePressEvent( QGraphicsSceneMouseEvent *event );
|
||||||
|
|
||||||
|
|
||||||
QRectF modelBounds( double margin ) const;
|
QRectF modelBounds( double margin = 0.0 ) const;
|
||||||
%Docstring
|
%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)
|
:param margin: optional margin (absolute value in scene coordinates) to
|
||||||
to add around items
|
add around items.
|
||||||
|
|
||||||
:return: model bounds, in scene units.
|
:return: model bounds, in scene units.
|
||||||
|
|
||||||
|
.. versionadded:: 3.44
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,10 +75,7 @@ QRectF QgsModelGraphicsScene::modelBounds( double margin ) const
|
|||||||
for ( QGraphicsItem *item : constItems )
|
for ( QGraphicsItem *item : constItems )
|
||||||
{
|
{
|
||||||
QgsModelComponentGraphicItem *componentItem = dynamic_cast<QgsModelComponentGraphicItem *>( item );
|
QgsModelComponentGraphicItem *componentItem = dynamic_cast<QgsModelComponentGraphicItem *>( item );
|
||||||
if ( !componentItem )
|
if ( componentItem )
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
bounds = bounds.united( componentItem->sceneBoundingRect() );
|
bounds = bounds.united( componentItem->sceneBoundingRect() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,12 +99,12 @@ class GUI_EXPORT QgsModelGraphicsScene : public QGraphicsScene
|
|||||||
void mousePressEvent( QGraphicsSceneMouseEvent *event ) override;
|
void mousePressEvent( QGraphicsSceneMouseEvent *event ) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
* \returns model bounds, in scene units.
|
* \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 );
|
setScene( scene );
|
||||||
|
|
||||||
mPreviousSceneRect = sceneRect();
|
|
||||||
// IMPORTANT!
|
// IMPORTANT!
|
||||||
// previous snap markers, snap lines are owned by previous layout - so don't delete them here!
|
// previous snap markers, snap lines are owned by previous layout - so don't delete them here!
|
||||||
mSnapMarker = new QgsModelViewSnapMarker();
|
mSnapMarker = new QgsModelViewSnapMarker();
|
||||||
|
@ -244,8 +244,6 @@ class GUI_EXPORT QgsModelGraphicsView : public QGraphicsView
|
|||||||
|
|
||||||
QgsModelSnapper mSnapper;
|
QgsModelSnapper mSnapper;
|
||||||
QgsModelViewSnapMarker *mSnapMarker = nullptr;
|
QgsModelViewSnapMarker *mSnapMarker = nullptr;
|
||||||
|
|
||||||
QRectF mPreviousSceneRect;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user