QElectroTech
0.8-dev
|
#include <diagramimageitem.h>
Public Types | |
enum | { Type = UserType + 1007 } |
Public Member Functions | |
DiagramImageItem (QetGraphicsItem *=nullptr) | |
DiagramImageItem::DiagramImageItem Constructor without pixmap. More... | |
DiagramImageItem (const QPixmap &pixmap, QetGraphicsItem *=nullptr) | |
DiagramImageItem::DiagramImageItem Constructor with pixmap. More... | |
~DiagramImageItem () override | |
DiagramImageItem::~DiagramImageItem Destructor. More... | |
int | type () const override |
virtual bool | fromXml (const QDomElement &) |
DiagramImageItem::fromXml Load this image fro xml elemebt e. More... | |
virtual QDomElement | toXml (QDomDocument &) const |
void | editProperty () override |
DiagramImageItem::editProperty Open the approriate dialog to edit this image. More... | |
void | setPixmap (const QPixmap &pixmap) |
DiagramImageItem::setPixmap Set the new pixmap to be draw. More... | |
QRectF | boundingRect () const override |
DiagramImageItem::boundingRect the outer bounds of the item as a rectangle, if no pixmap are set, return a default QRectF. More... | |
QString | name () const override |
DiagramImageItem::name. More... | |
Public Member Functions inherited from QetGraphicsItem | |
QetGraphicsItem (QGraphicsItem *parent=nullptr) | |
QetGraphicsItem::QetGraphicsItem Default constructor. More... | |
~QetGraphicsItem () override=0 | |
Diagram * | diagram () const |
virtual void | setPos (const QPointF &p) |
virtual void | setPos (qreal x, qreal y) |
virtual bool | isMovable () const |
virtual void | setMovable (bool movable) |
QET::GraphicsItemState | state () const |
QetGraphicsItem::state. More... | |
Protected Member Functions | |
void | paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override |
DiagramImageItem::paint Draw the pixmap. More... | |
Protected Member Functions inherited from QetGraphicsItem | |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) override |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) override |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override |
QetGraphicsItem::mouseReleaseEvent handle mouse release click. More... | |
Protected Attributes | |
QPixmap | pixmap_ |
Protected Attributes inherited from QetGraphicsItem | |
bool | is_movable_ |
bool | m_first_move |
bool | snap_to_grid_ |
QPointF | m_mouse_to_origin_movement |
QET::GraphicsItemState | m_state = QET:: GIOK |
This class represents a selectable, movable and editable image on a diagram.
DiagramImageItem::DiagramImageItem | ( | QetGraphicsItem * | parent_item = nullptr | ) |
DiagramImageItem::DiagramImageItem Constructor without pixmap.
parent_item | the parent graphics item |
DiagramImageItem::DiagramImageItem | ( | const QPixmap & | pixmap, |
QetGraphicsItem * | parent_item = nullptr |
||
) |
DiagramImageItem::DiagramImageItem Constructor with pixmap.
pixmap | the pixmap to be draw |
parent_item | the parent graphic item |
|
override |
DiagramImageItem::~DiagramImageItem Destructor.
|
override |
DiagramImageItem::boundingRect the outer bounds of the item as a rectangle, if no pixmap are set, return a default QRectF.
|
overridevirtual |
DiagramImageItem::editProperty Open the approriate dialog to edit this image.
Reimplemented from QetGraphicsItem.
|
virtual |
DiagramImageItem::fromXml Load this image fro xml elemebt e.
e |
|
overridevirtual |
Reimplemented from QetGraphicsItem.
|
overrideprotected |
DiagramImageItem::paint Draw the pixmap.
painter | the Qpainter to use for draw the pixmap |
option | the style option |
widget | the QWidget where we draw the pixmap |
void DiagramImageItem::setPixmap | ( | const QPixmap & | pixmap | ) |
DiagramImageItem::setPixmap Set the new pixmap to be draw.
pixmap | the new pixmap |
|
virtual |
document | Le document XML a utiliser |
|
inlineoverride |
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a DiagramImageItem
|
protected |