16 #ifndef QGSLAYOUTVIEWRUBBERBAND_H 17 #define QGSLAYOUTVIEWRUBBERBAND_H 26 class QGraphicsRectItem;
27 class QGraphicsEllipseItem;
28 class QGraphicsPolygonItem;
44 if ( dynamic_cast<QgsLayoutViewMouseEvent *>( sipCpp ) )
45 sipType = sipType_QgsLayoutViewMouseEvent;
69 virtual void start( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
75 virtual void update( QPointF position, Qt::KeyboardModifiers modifiers ) = 0;
82 virtual QRectF finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers =
nullptr ) = 0;
101 QBrush brush()
const;
108 void setBrush(
const QBrush &brush );
122 void setPen(
const QPen &pen );
132 void sizeChanged(
const QString &size );
142 QRectF updateRect( QPointF start, QPointF position,
bool constrainSquare,
bool fromCenter );
148 QBrush mBrush = Qt::NoBrush;
149 QPen mPen = QPen( QBrush( QColor( 227, 22, 22, 200 ) ), 0 );
173 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
174 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
175 QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers =
nullptr )
override;
180 QGraphicsRectItem *mRubberBandItem =
nullptr;
183 QPointF mRubberBandStartPos;
206 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
207 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
208 QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers =
nullptr )
override;
213 QGraphicsEllipseItem *mRubberBandItem =
nullptr;
216 QPointF mRubberBandStartPos;
239 void start( QPointF position, Qt::KeyboardModifiers modifiers )
override;
240 void update( QPointF position, Qt::KeyboardModifiers modifiers )
override;
241 QRectF
finish( QPointF position = QPointF(), Qt::KeyboardModifiers modifiers =
nullptr )
override;
246 QGraphicsPolygonItem *mRubberBandItem =
nullptr;
249 QPointF mRubberBandStartPos;
252 #endif // QGSLAYOUTVIEWRUBBERBAND_H A graphical widget to display and interact with QgsLayouts.
QgsLayoutViewEllipseRubberBand is elliptical rubber band for use within QgsLayoutView widgets...
QgsLayoutViewTriangleRubberBand is triangular rubber band for use within QgsLayoutView widgets...
virtual void update(QPointF position, Qt::KeyboardModifiers modifiers)=0
Called when a rubber band should be updated to reflect a temporary ending position (in layout coordin...
virtual void start(QPointF position, Qt::KeyboardModifiers modifiers)=0
Called when a rubber band should be created at the specified starting position (in layout coordinate ...
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
virtual QgsLayoutViewRubberBand * create(QgsLayoutView *view) const =0
Creates a new instance of the QgsLayoutViewRubberBand subclass.
QgsLayoutViewRectangularRubberBand is rectangular rubber band for use within QgsLayoutView widgets...
QgsLayoutViewRubberBand is an abstract base class for temporary rubber band items in various shapes...
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
virtual QRectF finish(QPointF position=QPointF(), Qt::KeyboardModifiers modifiers=nullptr)=0
Called when a rubber band use has finished and the rubber band is no longer required.