QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
IndependentTextItem Class Reference

#include <independenttextitem.h>

Inheritance diagram for IndependentTextItem:
Inheritance graph
Collaboration diagram for IndependentTextItem:
Collaboration graph

Public Types

enum  { Type = UserType + 1005 }
 
- Public Types inherited from DiagramTextItem
enum  { Type = UserType + 1004 }
 

Public Member Functions

 IndependentTextItem ()
 
 IndependentTextItem (const QString &)
 IndependentTextItem::IndependentTextItem Constructeur.
 
 ~IndependentTextItem () override
 Destructeur.
 
int type () const override
 
void fromXml (const QDomElement &) override
 
QDomElement toXml (QDomDocument &) const override
 
- Public Member Functions inherited from DiagramTextItem
 DiagramTextItem (QGraphicsItem *=nullptr)
 DiagramTextItem::DiagramTextItem.
 
 DiagramTextItem (const QString &, QGraphicsItem *=nullptr)
 DiagramTextItem::DiagramTextItem.
 
int type () const override
 
Diagramdiagram () const
 DiagramTextItem::diagram.
 
void edit ()
 Edit the text with HtmlEditor.
 
QPointF mapMovementToScene (const QPointF &) const
 
QPointF mapMovementFromScene (const QPointF &) const
 
QPointF mapMovementToParent (const QPointF &) const
 
QPointF mapMovementFromParent (const QPointF &) const
 
void setFont (const QFont &font)
 
void setColor (const QColor &color)
 
QColor color () const
 
void setNoEditable (bool e=true)
 
void setAlignment (const Qt::Alignment &alignment)
 
Qt::Alignment alignment () const
 
QRectF frameRect () const
 DiagramTextItem::frameRect.
 
void setHtml (const QString &text)
 
void setPlainText (const QString &text)
 
bool isHtml () const
 

Protected Member Functions

void focusOutEvent (QFocusEvent *event) override
 
- Protected Member Functions inherited from DiagramTextItem
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
 DiagramTextItem::paint Draw this text field. This method draws the text by calling QGraphicsTextItem::paint. If text is hovered, this method draws the bounding rect in grey.
 
void focusInEvent (QFocusEvent *) override
 DiagramTextItem::focusInEvent.
 
void focusOutEvent (QFocusEvent *) override
 DiagramTextItem::focusOutEvent.
 
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) override
 
void mousePressEvent (QGraphicsSceneMouseEvent *event) override
 DiagramTextItem::mousePressEvent.
 
void mouseMoveEvent (QGraphicsSceneMouseEvent *event) override
 DiagramTextItem::mouseMoveEvent.
 
void mouseReleaseEvent (QGraphicsSceneMouseEvent *event) override
 DiagramTextItem::mouseReleaseEvent.
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *) override
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *) override
 
void hoverMoveEvent (QGraphicsSceneHoverEvent *) override
 
virtual void applyRotation (const qreal &)
 
void prepareAlignment ()
 DiagramTextItem::prepareAlignment Call this function before changing the bounding rect of this text.
 
void finishAlignment ()
 DiagramTextItem::finishAlignment Call this function after changing the bounding rect of this text to set the position of this text according to the alignment property.
 

Additional Inherited Members

- Signals inherited from DiagramTextItem
void colorChanged (QColor color)
 
void alignmentChanged (Qt::Alignment alignment)
 
void textEdited (const QString &old_str, const QString &new_str)
 
void fontChanged (QFont font)
 
- Public Attributes inherited from DiagramTextItem
bool m_block_alignment = false
 
- Protected Attributes inherited from DiagramTextItem
bool m_mouse_hover = false
 
bool m_first_move = true
 
bool m_no_editable
 
bool m_is_html = false
 
QString m_previous_html_text
 
QString m_previous_text
 
QPointF m_mouse_to_origin_movement
 
- Properties inherited from DiagramTextItem
QColor color
 
Qt::Alignment alignment
 
QString plainText
 
QFont font
 

Detailed Description

This class represents an independent text field on a particular diagram. It may be moved, edited, and rotated.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Type 

Constructor & Destructor Documentation

◆ IndependentTextItem() [1/2]

IndependentTextItem::IndependentTextItem ( )

Constructeur

Parameters
parent_diagramLe schema auquel est rattache le champ de texte
Here is the call graph for this function:

◆ IndependentTextItem() [2/2]

IndependentTextItem::IndependentTextItem ( const QString &  text)

IndependentTextItem::IndependentTextItem Constructeur.

Parameters
textLe texte affiche par le champ de texte

◆ ~IndependentTextItem()

IndependentTextItem::~IndependentTextItem ( )
override

Destructeur.

Member Function Documentation

◆ focusOutEvent()

void IndependentTextItem::focusOutEvent ( QFocusEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ fromXml()

void IndependentTextItem::fromXml ( const QDomElement &  e)
overridevirtual

Permet de lire le texte a mettre dans le champ a partir d'un element XML. Cette methode se base sur la position du champ pour assigner ou non la valeur a ce champ.

Parameters
eL'element XML representant le champ de texte

Implements DiagramTextItem.

Here is the call graph for this function:

◆ toXml()

QDomElement IndependentTextItem::toXml ( QDomDocument &  document) const
overridevirtual
Parameters
documentLe document XML a utiliser
Returns
L'element XML representant ce champ de texte

Reimplemented from DiagramTextItem.

Here is the call graph for this function:

◆ type()

int IndependentTextItem::type ( ) const
inlineoverride

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