16 #ifndef QGSMODELGRAPHICITEM_H
17 #define QGSMODELGRAPHICITEM_H
21 #include <QGraphicsObject>
24 class QgsModelGraphicsView;
36 class GUI_EXPORT QgsModelDesignerFlatButtonGraphicItem :
public QGraphicsObject
47 QgsModelDesignerFlatButtonGraphicItem( QGraphicsItem *parent
SIP_TRANSFERTHIS,
const QPicture &picture,
const QPointF &position,
48 const QSizeF &size = QSizeF( 16, 16 ) );
50 void paint( QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget =
nullptr )
override;
51 QRectF boundingRect()
const override;
52 void hoverEnterEvent( QGraphicsSceneHoverEvent *event )
override;
53 void hoverLeaveEvent( QGraphicsSceneHoverEvent *event )
override;
54 void mousePressEvent( QGraphicsSceneMouseEvent *event )
override;
77 void setPosition(
const QPointF &position );
82 QgsModelGraphicsView *view();
96 void setPicture(
const QPicture &picture );
102 bool mHoverState =
false;
112 class GUI_EXPORT QgsModelDesignerFoldButtonGraphicItem :
public QgsModelDesignerFlatButtonGraphicItem
126 QgsModelDesignerFoldButtonGraphicItem( QGraphicsItem *parent
SIP_TRANSFERTHIS,
bool folded,
const QPointF &position,
127 const QSizeF &size = QSizeF( 11, 11 ) );
129 void mousePressEvent( QGraphicsSceneMouseEvent *event )
override;
141 void folded(
bool folded );
145 QPicture mPlusPicture;
146 QPicture mMinusPicture;
147 bool mFolded =
false;
A QgsModelViewMouseEvent is the result of a user interaction with the mouse on a QgsModelGraphicsView...