QElectroTech  0.8-dev
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DiagramImageItem Class Reference

#include <diagramimageitem.h>

Inheritance diagram for DiagramImageItem:
Inheritance graph
Collaboration diagram for DiagramImageItem:
Collaboration graph

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
 
Diagramdiagram () 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
 

Detailed Description

This class represents a selectable, movable and editable image on a diagram.

See also
QGraphicsItem::GraphicsItemFlags

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Constructor & Destructor Documentation

◆ DiagramImageItem() [1/2]

DiagramImageItem::DiagramImageItem ( QetGraphicsItem parent_item = nullptr)

DiagramImageItem::DiagramImageItem Constructor without pixmap.

Parameters
parent_itemthe parent graphics item

◆ DiagramImageItem() [2/2]

DiagramImageItem::DiagramImageItem ( const QPixmap &  pixmap,
QetGraphicsItem parent_item = nullptr 
)

DiagramImageItem::DiagramImageItem Constructor with pixmap.

Parameters
pixmapthe pixmap to be draw
parent_itemthe parent graphic item
Here is the call graph for this function:

◆ ~DiagramImageItem()

DiagramImageItem::~DiagramImageItem ( )
override

Member Function Documentation

◆ boundingRect()

QRectF DiagramImageItem::boundingRect ( ) const
override

DiagramImageItem::boundingRect the outer bounds of the item as a rectangle, if no pixmap are set, return a default QRectF.

Returns
a QRectF represent the bounding rectangle
Here is the caller graph for this function:

◆ editProperty()

void DiagramImageItem::editProperty ( )
overridevirtual

DiagramImageItem::editProperty Open the approriate dialog to edit this image.

Reimplemented from QetGraphicsItem.

Here is the call graph for this function:

◆ fromXml()

bool DiagramImageItem::fromXml ( const QDomElement &  e)
virtual

DiagramImageItem::fromXml Load this image fro xml elemebt e.

Parameters
e
Returns
true if succesfully load.
Here is the call graph for this function:

◆ name()

QString DiagramImageItem::name ( ) const
overridevirtual

DiagramImageItem::name.

Returns
the generic name of this item (picture)

Reimplemented from QetGraphicsItem.

◆ paint()

void DiagramImageItem::paint ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option,
QWidget *  widget 
)
overrideprotected

DiagramImageItem::paint Draw the pixmap.

Parameters
painterthe Qpainter to use for draw the pixmap
optionthe style option
widgetthe QWidget where we draw the pixmap
Here is the call graph for this function:

◆ setPixmap()

void DiagramImageItem::setPixmap ( const QPixmap &  pixmap)

DiagramImageItem::setPixmap Set the new pixmap to be draw.

Parameters
pixmapthe new pixmap
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toXml()

QDomElement DiagramImageItem::toXml ( QDomDocument &  document) const
virtual
Parameters
documentLe document XML a utiliser
Returns
L'element XML representant l'image
Here is the call graph for this function:

◆ type()

int DiagramImageItem::type ( ) const
inlineoverride

Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a DiagramImageItem

Returns
the QGraphicsItem type

Member Data Documentation

◆ pixmap_

QPixmap DiagramImageItem::pixmap_
protected

The documentation for this class was generated from the following files: