16#ifndef QGSMODELGRAPHICITEM_H
17#define QGSMODELGRAPHICITEM_H
21#include <QGraphicsObject>
24class QgsModelGraphicsView;
36class GUI_EXPORT QgsModelDesignerFlatButtonGraphicItem :
public QGraphicsObject
46 QgsModelDesignerFlatButtonGraphicItem( QGraphicsItem *parent
SIP_TRANSFERTHIS,
const QPicture &picture,
const QPointF &position,
const QSizeF &size = QSizeF( 16, 16 ) );
48 void paint( QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget =
nullptr )
override;
49 QRectF boundingRect()
const override;
50 void hoverEnterEvent( QGraphicsSceneHoverEvent *event )
override;
51 void hoverLeaveEvent( QGraphicsSceneHoverEvent *event )
override;
52 void mousePressEvent( QGraphicsSceneMouseEvent *event )
override;
75 void setPosition(
const QPointF &position );
80 QgsModelGraphicsView *view();
93 void setPicture(
const QPicture &picture );
99 bool mHoverState =
false;
109class GUI_EXPORT QgsModelDesignerFoldButtonGraphicItem :
public QgsModelDesignerFlatButtonGraphicItem
121 QgsModelDesignerFoldButtonGraphicItem( QGraphicsItem *parent
SIP_TRANSFERTHIS,
bool folded,
const QPointF &position,
const QSizeF &size = QSizeF( 11, 11 ) );
123 void mousePressEvent( QGraphicsSceneMouseEvent *event )
override;
135 void folded(
bool folded );
138 QPicture mPlusPicture;
139 QPicture mMinusPicture;
140 bool mFolded =
false;
A QgsModelViewMouseEvent is the result of a user interaction with the mouse on a QgsModelGraphicsView...