KDStateMachineEditor API Documentation 2.1
Loading...
Searching...
No Matches
Classes | Public Types | Signals | Public Member Functions | Static Public Member Functions | Properties | List of all members
KDSME::Element Class Reference

#include <element.h>

Inheritance diagram for KDSME::Element:
Inheritance graph
[legend]
Collaboration diagram for KDSME::Element:
Collaboration graph
[legend]

Classes

struct  Private
 

Public Types

enum  Flag { NoFlags = 0x0 , ElementIsDragEnabled = 0x1 , ElementIsSelectable = 0x2 , ElementIsEditable = 0x4 }
 
enum  Type {
  ElementType , TransitionType , SignalTransitionType , TimeoutTransitionType ,
  StateType , StateMachineType , HistoryStateType , FinalStateType ,
  PseudoStateType
}
 

Signals

void flagsChanged (KDSME::Element::Flags flags)
 
void heightChanged (qreal height)
 
void labelChanged (const QString &label)
 
void parentChanged (KDSME::Element *parent)
 
void posChanged (const QPointF &pos)
 
void selectedChanged (bool selected)
 
void visibleChanged (bool visible)
 
void widthChanged (qreal width)
 

Public Member Functions

 Element (QObject *parent=nullptr)
 
 ~Element ()
 
QPointF absolutePos () const
 
virtual QRectF boundingRect () const
 
QList< Element * > childElements () const
 
Flags flags () const
 
qreal height () const
 
quintptr internalId () const
 
void * internalPointer () const
 
bool isSelected () const
 
bool isVisible () const
 
QString label () const
 
ElementparentElement () const
 
QPointF pos () const
 
QSizeF preferredSize () const
 
void setFlags (Flags flags)
 
void setHeight (qreal height)
 
void setInternalId (quintptr id)
 
void setInternalPointer (void *ptr)
 
void setLabel (const QString &label)
 
void setParent (QObject *object)
 
void setParentElement (Element *parent)
 
void setPos (const QPointF &pos)
 
void setSelected (bool selected)
 
void setVisible (bool visible)
 
void setWidth (qreal width)
 
virtual QString toDisplayString () const
 
virtual Type type () const
 
qreal width () const
 

Static Public Member Functions

static Q_INVOKABLE KDSME::Element::Type stringToType (const char *type)
 
static Q_INVOKABLE const char * typeToString (KDSME::Element::Type type)
 

Properties

Flags flags
 
qreal height
 
QString label
 
KDSME::Elementparent
 
QPointF pos
 The position of the element from the top-left corner.
 
bool selected
 Whether this item is marked as selected.
 
Type type
 
bool visible
 Whether this item is visible in the scene.
 
qreal width
 

Detailed Description

Definition at line 34 of file element.h.

Member Enumeration Documentation

◆ Flag

Enumerator
NoFlags 
ElementIsDragEnabled 
ElementIsSelectable 
ElementIsEditable 

Definition at line 69 of file element.h.

◆ Type

Enumerator
ElementType 
TransitionType 
SignalTransitionType 
TimeoutTransitionType 
StateType 
StateMachineType 
HistoryStateType 
FinalStateType 
PseudoStateType 

Definition at line 51 of file element.h.

Constructor & Destructor Documentation

◆ Element()

Element::Element ( QObject *  parent = nullptr)
explicit

Definition at line 30 of file element.cpp.

◆ ~Element()

Element::~Element ( )

Definition at line 36 of file element.cpp.

Member Function Documentation

◆ absolutePos()

QPointF Element::absolutePos ( ) const

Definition at line 134 of file element.cpp.

References parentElement(), and pos.

Referenced by KDSME::LayoutUtils::moveToParent().

◆ boundingRect()

QRectF Element::boundingRect ( ) const
virtual

Definition at line 199 of file element.cpp.

References height, pos, and width.

Referenced by KDSME::SvgExporter::exportMachine(), KDSME::StateMachineView::fitInView(), and preferredSize().

◆ childElements()

QList< Element * > Element::childElements ( ) const

◆ flags()

Element::Flags Element::flags ( ) const

Definition at line 45 of file element.cpp.

◆ flagsChanged

void KDSME::Element::flagsChanged ( KDSME::Element::Flags  flags)
signal

Referenced by setFlags().

◆ height()

qreal Element::height ( ) const

Definition at line 120 of file element.cpp.

◆ heightChanged

void KDSME::Element::heightChanged ( qreal  height)
signal

◆ internalId()

quintptr Element::internalId ( ) const

Internal ID (e.g. memory address)

Internal id you can use to keep a mapping between elements and your data structures

Definition at line 72 of file element.cpp.

◆ internalPointer()

void * Element::internalPointer ( ) const

Definition at line 82 of file element.cpp.

◆ isSelected()

bool Element::isSelected ( ) const

Definition at line 159 of file element.cpp.

◆ isVisible()

bool Element::isVisible ( ) const

Definition at line 145 of file element.cpp.

Referenced by QuickSceneItem::setElement().

◆ label()

QString Element::label ( ) const

Label of this state (required to be unique)

Definition at line 58 of file element.cpp.

◆ labelChanged

void KDSME::Element::labelChanged ( const QString &  label)
signal

Referenced by setLabel().

◆ parentChanged

void KDSME::Element::parentChanged ( KDSME::Element parent)
signal

Referenced by setParent().

◆ parentElement()

Element * Element::parentElement ( ) const

Definition at line 205 of file element.cpp.

References parent.

Referenced by absolutePos(), KDSME::LayoutUtils::moveToParent(), and setParent().

◆ pos()

QPointF Element::pos ( ) const

Definition at line 92 of file element.cpp.

◆ posChanged

void KDSME::Element::posChanged ( const QPointF &  pos)
signal

Referenced by setPos().

◆ preferredSize()

QSizeF Element::preferredSize ( ) const

◆ selectedChanged

void KDSME::Element::selectedChanged ( bool  selected)
signal

Referenced by setSelected().

◆ setFlags()

void Element::setFlags ( Flags  flags)

Definition at line 50 of file element.cpp.

References flags, and flagsChanged().

◆ setHeight()

void Element::setHeight ( qreal  height)

Definition at line 125 of file element.cpp.

References height, and heightChanged().

Referenced by KDSME::StateMachine::StateMachine(), and KDSME::RegionLayouter::layoutRegion().

◆ setInternalId()

void Element::setInternalId ( quintptr  id)

Definition at line 77 of file element.cpp.

◆ setInternalPointer()

void Element::setInternalPointer ( void *  ptr)

Definition at line 87 of file element.cpp.

◆ setLabel()

void Element::setLabel ( const QString &  label)

◆ setParent()

void Element::setParent ( QObject *  object)

◆ setParentElement()

void Element::setParentElement ( Element parent)

Definition at line 210 of file element.cpp.

References parent, and setParent().

◆ setPos()

void Element::setPos ( const QPointF &  pos)

Definition at line 97 of file element.cpp.

References pos, and posChanged().

Referenced by KDSME::LayoutUtils::moveToParent().

◆ setSelected()

void Element::setSelected ( bool  selected)

Definition at line 164 of file element.cpp.

References selected, and selectedChanged().

Referenced by KDSME::StateMachineScene::currentChanged().

◆ setVisible()

void Element::setVisible ( bool  visible)

Definition at line 150 of file element.cpp.

References visible, and visibleChanged().

Referenced by QuickSceneItem::setElement().

◆ setWidth()

void Element::setWidth ( qreal  width)

Definition at line 111 of file element.cpp.

References width, and widthChanged().

Referenced by KDSME::StateMachine::StateMachine(), and KDSME::RegionLayouter::layoutRegion().

◆ stringToType()

Element::Type Element::stringToType ( const char *  type)
static

Definition at line 234 of file element.cpp.

References KDSME::ObjectHelper::stringToEnum(), and type.

Referenced by KDSME::EditController::sendDropEvent().

◆ toDisplayString()

QString Element::toDisplayString ( ) const
virtual

◆ type()

Element::Type Element::type ( ) const
virtual

◆ typeToString()

const char * Element::typeToString ( KDSME::Element::Type  type)
static

Definition at line 229 of file element.cpp.

References KDSME::ObjectHelper::enumToString(), and type.

◆ visibleChanged

void KDSME::Element::visibleChanged ( bool  visible)
signal

◆ width()

qreal Element::width ( ) const

Definition at line 106 of file element.cpp.

◆ widthChanged

void KDSME::Element::widthChanged ( qreal  width)
signal

Property Documentation

◆ flags

Flags KDSME::Element::flags
readwrite

Definition at line 39 of file element.h.

Referenced by KDSME::StateModel::flags(), and setFlags().

◆ height

qreal KDSME::Element::height
readwrite

Definition at line 44 of file element.h.

Referenced by boundingRect(), QuickSceneItem::setElement(), and setHeight().

◆ label

QString KDSME::Element::label
readwrite

◆ parent

KDSME::Element * KDSME::Element::parent
readwrite

◆ pos

QPointF KDSME::Element::pos
readwrite

The position of the element from the top-left corner.

Definition at line 42 of file element.h.

Referenced by absolutePos(), boundingRect(), KDSME::LayoutUtils::moveToParent(), and setPos().

◆ selected

bool KDSME::Element::selected
readwrite

Whether this item is marked as selected.

Definition at line 48 of file element.h.

Referenced by setSelected().

◆ type

Type KDSME::Element::type
read

Definition at line 38 of file element.h.

Referenced by preferredSize(), stringToType(), and typeToString().

◆ visible

bool KDSME::Element::visible
readwrite

Whether this item is visible in the scene.

Definition at line 46 of file element.h.

Referenced by setVisible().

◆ width

qreal KDSME::Element::width
readwrite

Definition at line 43 of file element.h.

Referenced by boundingRect(), QuickSceneItem::setElement(), and setWidth().


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

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDStateMachineEditor
Create Qt State Machine metacode using a graphical user interface
https://github.com/KDAB/KDStateMachineEditor
Generated on Tue Jul 15 2025 15:21:47 for KDStateMachineEditor API Documentation by doxygen 1.9.8