Mod doc set style de same

This commit is contained in:
Simon De Backer
2020-08-16 11:19:36 +02:00
parent 90417ae509
commit d4ee161c07
274 changed files with 6823 additions and 6756 deletions

View File

@@ -18,11 +18,11 @@
#include "abstractpartellipse.h"
/**
* @brief AbstractPartEllipse::AbstractPartEllipse
* Constructor
* @param editor : QETElementEditor of this part
* @param parent : parent item
*/
@brief AbstractPartEllipse::AbstractPartEllipse
Constructor
@param editor : QETElementEditor of this part
@param parent : parent item
*/
AbstractPartEllipse::AbstractPartEllipse(QETElementEditor *editor, QGraphicsItem *parent) :
CustomElementGraphicPart(editor, parent),
m_rect (QRectF(0, 0, 0, 0)),
@@ -31,17 +31,17 @@ AbstractPartEllipse::AbstractPartEllipse(QETElementEditor *editor, QGraphicsItem
{}
/**
* @brief AbstractPartEllipse::~AbstractPartEllipse
* Destructor
*/
@brief AbstractPartEllipse::~AbstractPartEllipse
Destructor
*/
AbstractPartEllipse::~AbstractPartEllipse() {}
/**
* @brief AbstractPartEllipse::startUserTransformation
* Start the user-induced transformation, provided this primitive is contained
* within the initial_selection_rect bounding rectangle.
* @param initial_selection_rect
*/
@brief AbstractPartEllipse::startUserTransformation
Start the user-induced transformation, provided this primitive is contained
within the initial_selection_rect bounding rectangle.
@param initial_selection_rect
*/
void AbstractPartEllipse::startUserTransformation(const QRectF &initial_selection_rect)
{
Q_UNUSED(initial_selection_rect)
@@ -51,11 +51,11 @@ void AbstractPartEllipse::startUserTransformation(const QRectF &initial_selectio
}
/**
* @brief AbstractPartEllipse::handleUserTransformation
* Handle the user-induced transformation from \a initial_selection_rect to \a new_selection_rect
* @param initial_selection_rect
* @param new_selection_rect
*/
@brief AbstractPartEllipse::handleUserTransformation
Handle the user-induced transformation from \a initial_selection_rect to \a new_selection_rect
@param initial_selection_rect
@param new_selection_rect
*/
void AbstractPartEllipse::handleUserTransformation(const QRectF &initial_selection_rect, const QRectF &new_selection_rect)
{
QList<QPointF> mapped_points = mapPoints(initial_selection_rect, new_selection_rect, saved_points_);
@@ -63,10 +63,10 @@ void AbstractPartEllipse::handleUserTransformation(const QRectF &initial_selecti
}
/**
* @brief AbstractPartEllipse::boundingRect
* Bounding rectangle this part can fit into
* @return
*/
@brief AbstractPartEllipse::boundingRect
Bounding rectangle this part can fit into
@return
*/
QRectF AbstractPartEllipse::boundingRect() const
{
qreal adjust = (SHADOWS_HEIGHT + penWeight()) / 2;
@@ -79,40 +79,43 @@ QRectF AbstractPartEllipse::boundingRect() const
}
/**
* @brief AbstractPartEllipse::sceneGeometricRect
* @return the minimum, margin-less rectangle this part can fit into in scene coordinates.
* It is different from boundingRect() because it is not supposed
* to imply any margin, and it is different from shape because it is a regular
* rectangle, not a complex shape.
*/
@brief AbstractPartEllipse::sceneGeometricRect
@return the minimum,
margin-less rectangle this part can fit into in scene coordinates.
It is different from boundingRect() because it is not supposed
to imply any margin,
and it is different from shape because it is a regular
rectangle, not a complex shape.
*/
QRectF AbstractPartEllipse::sceneGeometricRect() const {
return(mapToScene(rect()).boundingRect());
}
/**
* @brief AbstractPartEllipse::sceneTopLeft
* @return return the top left of rectangle, in scene coordinate
*/
@brief AbstractPartEllipse::sceneTopLeft
@return return the top left of rectangle, in scene coordinate
*/
QPointF AbstractPartEllipse::sceneTopLeft() const {
return(mapToScene(rect().topLeft()));
}
/**
* @brief AbstractPartEllipse::rect
* Returns the item's ellipse geometry as a QRectF.
*/
@brief AbstractPartEllipse::rect
Returns the item's ellipse geometry as a QRectF.
*/
QRectF AbstractPartEllipse::rect() const {
return m_rect;
}
/**
* @brief AbstractPartEllipse::setRect
* Sets the item's ellipse geometry to rect.
* The rectangle's left edge defines the left edge of the ellipse,
* and the rectangle's top edge describes the top of the ellipse
* The height and width of the rectangle describe the height and width of the ellipse.
* @param rect
*/
@brief AbstractPartEllipse::setRect
Sets the item's ellipse geometry to rect.
The rectangle's left edge defines the left edge of the ellipse,
and the rectangle's top edge describes the top of the ellipse
The height and width of the rectangle
describe the height and width of the ellipse.
@param rect
*/
void AbstractPartEllipse::setRect(const QRectF &rect)
{
if (rect == m_rect) return;
@@ -123,21 +126,24 @@ void AbstractPartEllipse::setRect(const QRectF &rect)
}
/**
* @brief AbstractPartEllipse::isUseless
* @return true if this part is irrelevant and does not deserve to be Retained / registered.
* An ellipse is relevant when is rect is not null.
*/
@brief AbstractPartEllipse::isUseless
@return true if this part is irrelevant
and does not deserve to be Retained / registered.
An ellipse is relevant when is rect is not null.
*/
bool AbstractPartEllipse::isUseless() const {
return(rect().isNull());
}
/**
* @brief AbstractPartEllipse::setStartAngle
* Sets the start angle for an ellipse segment to angle, which is in 16ths of a degree.
* This angle is used together with spanAngle() for representing an ellipse segment (a pie).
* By default, the start angle is 0.
* @param start_angle
*/
@brief AbstractPartEllipse::setStartAngle
Sets the start angle for an ellipse segment to angle,
which is in 16ths of a degree.
This angle is used together with spanAngle()
for representing an ellipse segment (a pie).
By default, the start angle is 0.
@param start_angle
*/
void AbstractPartEllipse::setStartAngle(const int &start_angle)
{
if (m_start_angle == start_angle) return;
@@ -147,12 +153,13 @@ void AbstractPartEllipse::setStartAngle(const int &start_angle)
}
/**
* @brief AbstractPartEllipse::setSpanAngle
* Returns the span angle of an ellipse segment in 16ths of a degree.
* This angle is used together with startAngle() for representing an ellipse segment (a pie).
* By default, this function returns 5760 (360 * 16, a full ellipse).
* @param span_angle
*/
@brief AbstractPartEllipse::setSpanAngle
Returns the span angle of an ellipse segment in 16ths of a degree.
This angle is used together with startAngle()
for representing an ellipse segment (a pie).
By default, this function returns 5760 (360 * 16, a full ellipse).
@param span_angle
*/
void AbstractPartEllipse::setSpanAngle(const int &span_angle)
{
if (m_span_angle == span_angle) return;

View File

@@ -23,15 +23,19 @@
class QetGraphicsHandlerItem;
/**
* @brief The AbstractPartEllipse class
* This is the base class for all ellipse based item like ellipse, circle, arc.
* This class only provide common method for edit the ellipse like rect that contain the ellipse.
* All coordinates is in item coordinate, except pos(), center(), centerX() and centerY()
* which are in parent coordinate (or scene if no parent).
*
* In several points, this class is a copy of QGraphicsEllipseItem with some change,
* (the use of Q_PROPERTY) to be easily used with Element editor.
*/
@brief The AbstractPartEllipse class
This is the base class for all ellipse based item like ellipse,
circle, arc.
This class only provide common method for edit the ellipse
like rect that contain the ellipse.
All coordinates is in item coordinate, except pos(),
center(), centerX() and centerY()
which are in parent coordinate (or scene if no parent).
In several points,
this class is a copy of QGraphicsEllipseItem with some change,
(the use of Q_PROPERTY) to be easily used with Element editor.
*/
class AbstractPartEllipse : public CustomElementGraphicPart
{
Q_OBJECT

View File

@@ -20,12 +20,12 @@
#include "QPropertyUndoCommand/qpropertyundocommand.h"
/**
* @brief CustomElementGraphicPart::CustomElementGraphicPart
* Default constructor.
* By default, item is selectable, send geometry change (Qt > 4.6),
* accept mouse left button and accept hover event
* @param editor QETElement editor that belong this.
*/
@brief CustomElementGraphicPart::CustomElementGraphicPart
Default constructor.
By default, item is selectable, send geometry change (Qt > 4.6),
accept mouse left button and accept hover event
@param editor QETElement editor that belong this.
*/
CustomElementGraphicPart::CustomElementGraphicPart(QETElementEditor *editor, QGraphicsItem *parent) :
QGraphicsObject (parent),
CustomElementPart(editor),
@@ -41,18 +41,18 @@ CustomElementGraphicPart::CustomElementGraphicPart(QETElementEditor *editor, QGr
}
/**
* @brief CustomElementGraphicPart::~CustomElementGraphicPart
* Destructor
*/
@brief CustomElementGraphicPart::~CustomElementGraphicPart
Destructor
*/
CustomElementGraphicPart::~CustomElementGraphicPart() {}
/**
* @brief CustomElementGraphicPart::drawCross
* Draw a cross at pos center
* @param center : center of cross
* @param painter : painter to use for draw cross,
* the painter state is restored at end of this method.
*/
@brief CustomElementGraphicPart::drawCross
Draw a cross at pos center
@param center : center of cross
@param painter : painter to use for draw cross,
the painter state is restored at end of this method.
*/
void CustomElementGraphicPart::drawCross(const QPointF &center, QPainter *painter)
{
painter -> save();
@@ -64,10 +64,10 @@ void CustomElementGraphicPart::drawCross(const QPointF &center, QPainter *painte
}
/**
* @brief CustomElementGraphicPart::setLineStyle
* Set line style to ls
* @param ls
*/
@brief CustomElementGraphicPart::setLineStyle
Set line style to ls
@param ls
*/
void CustomElementGraphicPart::setLineStyle(const LineStyle ls)
{
if (_linestyle == ls) return;
@@ -76,10 +76,10 @@ void CustomElementGraphicPart::setLineStyle(const LineStyle ls)
}
/**
* @brief CustomElementGraphicPart::setLineWeight
* Set line weight to lw
* @param lw
*/
@brief CustomElementGraphicPart::setLineWeight
Set line weight to lw
@param lw
*/
void CustomElementGraphicPart::setLineWeight(const LineWeight lw)
{
if (_lineweight == lw) return;
@@ -88,9 +88,9 @@ void CustomElementGraphicPart::setLineWeight(const LineWeight lw)
}
/**
* @brief CustomElementGraphicPart::penWeight
* @return the weight of pen
*/
@brief CustomElementGraphicPart::penWeight
@return the weight of pen
*/
qreal CustomElementGraphicPart::penWeight() const
{
if (_lineweight == NoneWeight || _lineweight == ThinWeight) return 0;
@@ -101,10 +101,10 @@ qreal CustomElementGraphicPart::penWeight() const
}
/**
* @brief CustomElementGraphicPart::setFilling
* Set filling to f
* @param f
*/
@brief CustomElementGraphicPart::setFilling
Set filling to f
@param f
*/
void CustomElementGraphicPart::setFilling(const Filling f)
{
if (_filling == f) return;
@@ -113,10 +113,10 @@ void CustomElementGraphicPart::setFilling(const Filling f)
}
/**
* @brief CustomElementGraphicPart::setColor
* Set color to c
* @param c
*/
@brief CustomElementGraphicPart::setColor
Set color to c
@param c
*/
void CustomElementGraphicPart::setColor(const Color c)
{
if (_color == c) return;
@@ -125,10 +125,10 @@ void CustomElementGraphicPart::setColor(const Color c)
}
/**
* @brief CustomElementGraphicPart::setAntialiased
* Set antialias to b
* @param b
*/
@brief CustomElementGraphicPart::setAntialiased
Set antialias to b
@param b
*/
void CustomElementGraphicPart::setAntialiased(const bool b)
{
if (_antialiased == b) return;
@@ -137,13 +137,13 @@ void CustomElementGraphicPart::setAntialiased(const bool b)
}
/**
* @brief CustomElementGraphicPart::stylesToXml
* Write the curent style to xml element.
* The style are stored like this:
* name-of-style:value;name-of-style:value
* Each style separate by ; and name-style/value are separate by :
* @param qde : QDOmElement used to write the style.
*/
@brief CustomElementGraphicPart::stylesToXml
Write the curent style to xml element.
The style are stored like this:
name-of-style:value;name-of-style:value
Each style separate by ; and name-style/value are separate by :
@param qde : QDOmElement used to write the style.
*/
void CustomElementGraphicPart::stylesToXml(QDomElement &qde) const
{
QString css_like_styles;
@@ -486,10 +486,10 @@ void CustomElementGraphicPart::stylesToXml(QDomElement &qde) const
/**
* @brief CustomElementGraphicPart::stylesFromXml
* Read the style used by this, from a xml element.
* @param qde : QDomElement used to read the style
*/
@brief CustomElementGraphicPart::stylesFromXml
Read the style used by this, from a xml element.
@param qde : QDomElement used to read the style
*/
void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
{
resetStyles();
@@ -849,10 +849,10 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
/**
* @brief CustomElementGraphicPart::resetStyles
* Reset the curent style to default,
* same style of default constructor
*/
@brief CustomElementGraphicPart::resetStyles
Reset the curent style to default,
same style of default constructor
*/
void CustomElementGraphicPart::resetStyles()
{
_linestyle = NormalStyle;
@@ -863,10 +863,10 @@ void CustomElementGraphicPart::resetStyles()
}
/**
* @brief CustomElementGraphicPart::applyStylesToQPainter
* Apply the current style to the QPainter
* @param painter
*/
@brief CustomElementGraphicPart::applyStylesToQPainter
Apply the current style to the QPainter
@param painter
*/
void CustomElementGraphicPart::applyStylesToQPainter(QPainter &painter) const
{
//Get the pen and brush
@@ -1216,12 +1216,12 @@ void CustomElementGraphicPart::applyStylesToQPainter(QPainter &painter) const
}
/**
* @brief CustomElementGraphicPart::drawShadowShape
* Draw a transparent blue shadow arround the shape of this item.
* The QPainterPathStroker used to draw shadows have a width of SHADOWS_HEIGHT
* Be carefull if penWeight of this item is to 0 the outline of strock is bigger of 0.5
* @param painter : painter to use for draw this shadows
*/
@brief CustomElementGraphicPart::drawShadowShape
Draw a transparent blue shadow arround the shape of this item.
The QPainterPathStroker used to draw shadows have a width of SHADOWS_HEIGHT
Be carefull if penWeight of this item is to 0 the outline of strock is bigger of 0.5
@param painter : painter to use for draw this shadows
*/
void CustomElementGraphicPart::drawShadowShape(QPainter *painter)
{
//@FIXME if pen weight is 0, the strock outline is SHADOWS_HEIGHT/2 + 0.5
@@ -1240,14 +1240,14 @@ void CustomElementGraphicPart::drawShadowShape(QPainter *painter)
}
/**
* @brief CustomElementGraphicPart::itemChange
* Reimplemented from QGraphicsObject.
* If the item position change call updateCurrentPartEditor()
* the change is always send to QGraphicsObject
* @param change
* @param value
* @return the returned value of QGraphicsObject::itemChange
*/
@brief CustomElementGraphicPart::itemChange
Reimplemented from QGraphicsObject.
If the item position change call updateCurrentPartEditor()
the change is always send to QGraphicsObject
@param change
@param value
@return the returned value of QGraphicsObject::itemChange
*/
QVariant CustomElementGraphicPart::itemChange(GraphicsItemChange change, const QVariant &value)
{
if (scene())
@@ -1258,11 +1258,11 @@ QVariant CustomElementGraphicPart::itemChange(GraphicsItemChange change, const Q
}
/**
* @brief CustomElementGraphicPart::hoverEnterEvent
* Reimplemented from QGraphicsObject.
* Set m_hovered to true
* @param event
*/
@brief CustomElementGraphicPart::hoverEnterEvent
Reimplemented from QGraphicsObject.
Set m_hovered to true
@param event
*/
void CustomElementGraphicPart::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
m_hovered = true;
@@ -1270,11 +1270,11 @@ void CustomElementGraphicPart::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
}
/**
* @brief CustomElementGraphicPart::hoverLeaveEvent
* Reimplemented from QGraphicsObject.
* Set m_hovered to false
* @param event
*/
@brief CustomElementGraphicPart::hoverLeaveEvent
Reimplemented from QGraphicsObject.
Set m_hovered to false
@param event
*/
void CustomElementGraphicPart::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
m_hovered = false;

View File

@@ -26,10 +26,12 @@ class QPainter;
/**
* @brief The CustomElementGraphicPart class
* This class is the base for all home-made primitive like line, rectangle, ellipse etc....
* It provides methods and enums to manage style attributes available for primitive (color, pen style, etc...)
*/
@brief The CustomElementGraphicPart class
This class is the base for all home-made primitive like line,
rectangle, ellipse etc....
It provides methods and enums to manage style attributes available
for primitive (color, pen style, etc...)
*/
class CustomElementGraphicPart : public QGraphicsObject, public CustomElementPart
{
#define SHADOWS_HEIGHT 4.0

View File

@@ -23,11 +23,11 @@
/**
* @brief PartArc::PartArc
* Constructor
* @param editor : QETElementEditor of this part
* @param parent : parent item
*/
@brief PartArc::PartArc
Constructor
@param editor : QETElementEditor of this part
@param parent : parent item
*/
PartArc::PartArc(QETElementEditor *editor, QGraphicsItem *parent) :
AbstractPartEllipse(editor, parent)
{
@@ -36,9 +36,9 @@ PartArc::PartArc(QETElementEditor *editor, QGraphicsItem *parent) :
}
/**
* @brief PartArc::~PartArc
* Destructor
*/
@brief PartArc::~PartArc
Destructor
*/
PartArc::~PartArc()
{
if(m_undo_command) delete m_undo_command;
@@ -46,12 +46,12 @@ PartArc::~PartArc()
}
/**
* @brief PartArc::paint
* Draw this arc
* @param painter
* @param options
* @param widget
*/
@brief PartArc::paint
Draw this arc
@param painter
@param options
@param widget
*/
void PartArc::paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget)
{
Q_UNUSED(widget);
@@ -90,11 +90,11 @@ void PartArc::paint(QPainter *painter, const QStyleOptionGraphicsItem *options,
}
/**
* @brief PartArc::toXml
* Export this arc in xml
* @param xml_document : Xml document to use for create the xml element.
* @return : an xml element that describe this arc
*/
@brief PartArc::toXml
Export this arc in xml
@param xml_document : Xml document to use for create the xml element.
@return : an xml element that describe this arc
*/
const QDomElement PartArc::toXml(QDomDocument &xml_document) const {
QDomElement xml_element = xml_document.createElement("arc");
QPointF top_left(sceneTopLeft());
@@ -110,10 +110,10 @@ const QDomElement PartArc::toXml(QDomDocument &xml_document) const {
}
/**
* @brief PartArc::fromXml
* Import the properties of this arc from a xml element.
* @param qde : Xml document to use.
*/
@brief PartArc::fromXml
Import the properties of this arc from a xml element.
@param qde : Xml document to use.
*/
void PartArc::fromXml(const QDomElement &qde) {
stylesFromXml(qde);
m_rect = QRectF(mapFromScene(qde.attribute("x", "0").toDouble(),
@@ -126,9 +126,9 @@ void PartArc::fromXml(const QDomElement &qde) {
}
/**
* @brief PartArc::shape
* @return the shape of this item
*/
@brief PartArc::shape
@return the shape of this item
*/
QPainterPath PartArc::shape() const
{
QPainterPath shape;
@@ -155,10 +155,10 @@ QPainterPath PartArc::shadowShape() const
}
/**
* @brief PartArc::mouseReleaseEvent
* Handle mouse release event
* @param event
*/
@brief PartArc::mouseReleaseEvent
Handle mouse release event
@param event
*/
void PartArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton && event->buttonDownPos(Qt::LeftButton) == event->pos())
@@ -168,11 +168,11 @@ void PartArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief PartArc::itemChange
* @param change
* @param value
* @return
*/
@brief PartArc::itemChange
@param change
@param value
@return
*/
QVariant PartArc::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{
if (change == ItemSelectedHasChanged && scene())
@@ -208,11 +208,11 @@ QVariant PartArc::itemChange(QGraphicsItem::GraphicsItemChange change, const QVa
}
/**
* @brief PartArc::sceneEventFilter
* @param watched
* @param event
* @return
*/
@brief PartArc::sceneEventFilter
@param watched
@param event
@return
*/
bool PartArc::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
{
//Watched must be an handler
@@ -248,8 +248,8 @@ bool PartArc::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
}
/**
* @brief PartArc::switchResizeMode
*/
@brief PartArc::switchResizeMode
*/
void PartArc::switchResizeMode()
{
if (m_resize_mode == 1)
@@ -283,8 +283,8 @@ void PartArc::switchResizeMode()
}
/**
* @brief PartArc::adjusteHandlerPos
*/
@brief PartArc::adjusteHandlerPos
*/
void PartArc::adjusteHandlerPos()
{
if (m_handler_vector.isEmpty())
@@ -307,10 +307,10 @@ void PartArc::adjusteHandlerPos()
}
/**
* @brief PartArc::handlerMousePressEvent
* @param qghi
* @param event
*/
@brief PartArc::handlerMousePressEvent
@param qghi
@param event
*/
void PartArc::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -346,10 +346,10 @@ void PartArc::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsScen
}
/**
* @brief PartArc::handlerMouseMoveEvent
* @param qghi
* @param event
*/
@brief PartArc::handlerMouseMoveEvent
@param qghi
@param event
*/
void PartArc::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -380,10 +380,10 @@ void PartArc::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsScene
}
/**
* @brief PartArc::handlerMouseReleaseEvent
* @param qghi
* @param event
*/
@brief PartArc::handlerMouseReleaseEvent
@param qghi
@param event
*/
void PartArc::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -421,9 +421,9 @@ void PartArc::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSc
}
/**
* @brief PartArc::sceneSelectionChanged
* When the scene selection change, if there are several primitive selected, we remove the handler of this item
*/
@brief PartArc::sceneSelectionChanged
When the scene selection change, if there are several primitive selected, we remove the handler of this item
*/
void PartArc::sceneSelectionChanged()
{
if (this->isSelected() && scene()->selectedItems().size() == 1)
@@ -433,9 +433,9 @@ void PartArc::sceneSelectionChanged()
}
/**
* @brief PartArc::addHandler
* Add handlers for this item
*/
@brief PartArc::addHandler
Add handlers for this item
*/
void PartArc::addHandler()
{
if (m_handler_vector.isEmpty() && scene())
@@ -464,9 +464,9 @@ void PartArc::addHandler()
}
/**
* @brief PartArc::removeHandler
* Remove the handlers of this item
*/
@brief PartArc::removeHandler
Remove the handlers of this item
*/
void PartArc::removeHandler()
{
if (!m_handler_vector.isEmpty())

View File

@@ -24,10 +24,10 @@ class QPropertyUndoCommand;
class QetGraphicsHandlerItem;
/**
* @brief The PartArc class
* This class represents an elliptical arc primitive which may be used to
* compose the drawing of an electrical element within the element editor.
*/
@brief The PartArc class
This class represents an elliptical arc primitive which may be used to
compose the drawing of an electrical element within the element editor.
*/
class PartArc : public AbstractPartEllipse
{
Q_OBJECT
@@ -42,9 +42,9 @@ class PartArc : public AbstractPartEllipse
public:
enum { Type = UserType + 1101 };
/**
* Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartArc.
* @return the QGraphicsItem type
*/
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartArc.
@return the QGraphicsItem type
*/
int type() const override { return Type; }
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr) override;

View File

@@ -58,22 +58,24 @@ QString PartDynamicTextField::xmlName() const {
}
/**
* @brief PartDynamicTextField::startUserTransformation
* @param initial_selection_rect
* Start the user-induced transformation, provided this primitive is contained
* within the initial_selection_rect bounding rectangle.
*/
@brief PartDynamicTextField::startUserTransformation
@param initial_selection_rect
Start the user-induced transformation,
provided this primitive is contained
within the initial_selection_rect bounding rectangle.
*/
void PartDynamicTextField::startUserTransformation(const QRectF &initial_selection_rect) {
Q_UNUSED(initial_selection_rect)
m_saved_point = pos(); // scene coordinates, no need to mapFromScene()
}
/**
* @brief PartDynamicTextField::handleUserTransformation
* @param initial_selection_rect
* @param new_selection_rect
* Handle the user-induced transformation from initial_selection_rect to new_selection_rect
*/
@brief PartDynamicTextField::handleUserTransformation
@param initial_selection_rect
@param new_selection_rect
Handle the user-induced transformation
from initial_selection_rect to new_selection_rect
*/
void PartDynamicTextField::handleUserTransformation(
const QRectF &initial_selection_rect,
const QRectF &new_selection_rect)
@@ -84,10 +86,10 @@ void PartDynamicTextField::handleUserTransformation(
}
/**
* @brief PartDynamicTextField::toXml
* @param document
* @return
*/
@brief PartDynamicTextField::toXml
@param document
@return
*/
const QDomElement PartDynamicTextField::toXml(QDomDocument &dom_doc) const {
QDomElement root_element = dom_doc.createElement(xmlName());
@@ -147,9 +149,9 @@ const QDomElement PartDynamicTextField::toXml(QDomDocument &dom_doc) const {
}
/**
* @brief PartDynamicTextField::fromXml
* @param element
*/
@brief PartDynamicTextField::fromXml
@param element
*/
void PartDynamicTextField::fromXml(const QDomElement &dom_elmt) {
if (dom_elmt.tagName() != xmlName()) {
qDebug() << "PartDynamicTextField::fromXml : Wrong tagg name";
@@ -215,10 +217,11 @@ void PartDynamicTextField::fromXml(const QDomElement &dom_elmt) {
}
/**
* @brief PartDynamicTextField::fromTextFieldXml
* Setup this text from the xml definition of a text field (The xml tagg of a text field is "input");
* @param dom_element
*/
@brief PartDynamicTextField::fromTextFieldXml
Setup this text from the xml definition
of a text field (The xml tagg of a text field is "input");
@param dom_element
*/
void PartDynamicTextField::fromTextFieldXml(const QDomElement &dom_element)
{
if(dom_element.tagName() != "input")
@@ -254,18 +257,18 @@ void PartDynamicTextField::fromTextFieldXml(const QDomElement &dom_element)
}
/**
* @brief PartDynamicTextField::textFrom
* @return what the final text is created from.
*/
@brief PartDynamicTextField::textFrom
@return what the final text is created from.
*/
DynamicElementTextItem::TextFrom PartDynamicTextField::textFrom() const {
return m_text_from;
}
/**
* @brief PartDynamicTextField::setTextFrom
* Set the final text is created from.
* @param text_from
*/
@brief PartDynamicTextField::setTextFrom
Set the final text is created from.
@param text_from
*/
void PartDynamicTextField::setTextFrom(DynamicElementTextItem::TextFrom text_from) {
m_text_from = text_from;
switch (m_text_from) {
@@ -285,18 +288,18 @@ void PartDynamicTextField::setTextFrom(DynamicElementTextItem::TextFrom text_fro
}
/**
* @brief PartDynamicTextField::text
* @return the text of this text
*/
@brief PartDynamicTextField::text
@return the text of this text
*/
QString PartDynamicTextField::text() const {
return m_text;
}
/**
* @brief PartDynamicTextField::setText
* Set the text of this text
* @param text
*/
@brief PartDynamicTextField::setText
Set the text of this text
@param text
*/
void PartDynamicTextField::setText(const QString &text) {
m_text = text;
setPlainText(m_text);
@@ -311,18 +314,18 @@ void PartDynamicTextField::setInfoName(const QString &info_name) {
}
/**
* @brief PartDynamicTextField::infoName
* @return the info name of this text
*/
@brief PartDynamicTextField::infoName
@return the info name of this text
*/
QString PartDynamicTextField::infoName() const{
return m_info_name;
}
/**
* @brief PartDynamicTextField::setCompositeText
* Set the composite text of this text item to @text
* @param text
*/
@brief PartDynamicTextField::setCompositeText
Set the composite text of this text item to @text
@param text
*/
void PartDynamicTextField::setCompositeText(const QString &text) {
m_composite_text = text;
if(m_text_from == DynamicElementTextItem::CompositeText && elementScene())
@@ -331,26 +334,26 @@ void PartDynamicTextField::setCompositeText(const QString &text) {
}
/**
* @brief PartDynamicTextField::compositeText
* @return the composite text of this text
*/
@brief PartDynamicTextField::compositeText
@return the composite text of this text
*/
QString PartDynamicTextField::compositeText() const {
return m_composite_text;
}
/**
* @brief PartDynamicTextField::setColor
* @param color set text color to color
*/
@brief PartDynamicTextField::setColor
@param color set text color to color
*/
void PartDynamicTextField::setColor(const QColor& color) {
setDefaultTextColor(color);
emit colorChanged(color);
}
/**
* @brief PartDynamicTextField::color
* @return The color of this text
*/
@brief PartDynamicTextField::color
@return The color of this text
*/
QColor PartDynamicTextField::color() const {
return defaultTextColor();
}
@@ -415,9 +418,9 @@ void PartDynamicTextField::setFont(const QFont &font) {
}
/**
* @brief PartDynamicTextField::mouseMoveEvent
* @param event
*/
@brief PartDynamicTextField::mouseMoveEvent
@param event
*/
void PartDynamicTextField::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
if((event -> buttons() & Qt::LeftButton) && (flags() & QGraphicsItem::ItemIsMovable)) {
QPointF pos = event -> scenePos() + (m_origine_pos - event -> buttonDownScenePos(Qt::LeftButton));
@@ -428,9 +431,9 @@ void PartDynamicTextField::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
}
/**
* @brief PartDynamicTextField::mousePressEvent
* @param event
*/
@brief PartDynamicTextField::mousePressEvent
@param event
*/
void PartDynamicTextField::mousePressEvent(QGraphicsSceneMouseEvent *event) {
if(event -> button() == Qt::LeftButton)
m_origine_pos = this -> pos();
@@ -439,9 +442,9 @@ void PartDynamicTextField::mousePressEvent(QGraphicsSceneMouseEvent *event) {
}
/**
* @brief PartDynamicTextField::mouseReleaseEvent
* @param event
*/
@brief PartDynamicTextField::mouseReleaseEvent
@param event
*/
void PartDynamicTextField::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
if((event -> button() & Qt::LeftButton) &&
(flags() & QGraphicsItem::ItemIsMovable) &&
@@ -457,11 +460,11 @@ void PartDynamicTextField::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
}
/**
* @brief PartDynamicTextField::itemChange
* @param change
* @param value
* @return
*/
@brief PartDynamicTextField::itemChange
@param change
@param value
@return
*/
QVariant PartDynamicTextField::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) {
if (change == QGraphicsItem::ItemPositionHasChanged || change == QGraphicsItem::ItemSceneHasChanged) {
updateCurrentPartEditor();
@@ -525,9 +528,10 @@ void PartDynamicTextField::paint(QPainter *painter, const QStyleOptionGraphicsIt
}
/**
* @brief PartDynamicTextField::elementInfoChanged
* Used to up to date this text field, when the element information (see elementScene) changed
*/
@brief PartDynamicTextField::elementInfoChanged
Used to up to date this text field,
when the element information (see elementScene) changed
*/
void PartDynamicTextField::elementInfoChanged() {
if(!elementScene())
return;

View File

@@ -23,12 +23,13 @@
#include "dynamicelementtextitem.h"
/**
* @brief The PartDynamicTextField class
* This class represents an editable dynamic text field which may be used to compose the
* drawing of an electrical element within the element editor.
* The field will remain editable once the element is added onto
* a diagram
*/
@brief The PartDynamicTextField class
This class represents an editable dynamic text field
which may be used to compose the
drawing of an electrical element within the element editor.
The field will remain editable once the element is added onto
a diagram
*/
class PartDynamicTextField : public QGraphicsTextItem, public CustomElementPart
{
Q_OBJECT

View File

@@ -22,20 +22,20 @@
#include "QetGraphicsItemModeler/qetgraphicshandlerutility.h"
/**
* @brief PartEllipse::PartEllipse
* Constructor
* @param editor : QETElementEditor of this part
* @param parent : parent item
*/
@brief PartEllipse::PartEllipse
Constructor
@param editor : QETElementEditor of this part
@param parent : parent item
*/
PartEllipse::PartEllipse(QETElementEditor *editor, QGraphicsItem *parent) :
AbstractPartEllipse(editor, parent),
m_undo_command(nullptr)
{}
/**
* @brief PartEllipse::~PartEllipse
* Destructor
*/
@brief PartEllipse::~PartEllipse
Destructor
*/
PartEllipse::~PartEllipse()
{
if(m_undo_command) delete m_undo_command;
@@ -43,12 +43,12 @@ PartEllipse::~PartEllipse()
}
/**
* @brief PartEllipse::paint
* Draw this ellpise
* @param painter
* @param options
* @param widget
*/
@brief PartEllipse::paint
Draw this ellpise
@param painter
@param options
@param widget
*/
void PartEllipse::paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget)
{
Q_UNUSED(widget);
@@ -71,11 +71,11 @@ void PartEllipse::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
}
/**
* @brief PartEllipse::toXml
* Export this ellipse in xml
* @param xml_document : Xml document to use for create the xml element.
* @return : an xml element that describe this ellipse
*/
@brief PartEllipse::toXml
Export this ellipse in xml
@param xml_document : Xml document to use for create the xml element.
@return : an xml element that describe this ellipse
*/
const QDomElement PartEllipse::toXml(QDomDocument &xml_document) const
{
QDomElement xml_element;
@@ -101,10 +101,10 @@ const QDomElement PartEllipse::toXml(QDomDocument &xml_document) const
}
/**
* @brief PartEllipse::fromXml
* Import the properties of this ellipse from a xml element.
* @param qde : Xml document to use.
*/
@brief PartEllipse::fromXml
Import the properties of this ellipse from a xml element.
@param qde : Xml document to use.
*/
void PartEllipse::fromXml(const QDomElement &qde)
{
stylesFromXml(qde);
@@ -124,9 +124,9 @@ void PartEllipse::fromXml(const QDomElement &qde)
}
/**
* @brief PartEllipse::shape
* @return the shape of this item
*/
@brief PartEllipse::shape
@return the shape of this item
*/
QPainterPath PartEllipse::shape() const
{
QPainterPath shape;
@@ -151,10 +151,10 @@ QPainterPath PartEllipse::shadowShape() const
}
/**
* @brief PartEllipse::mouseReleaseEvent
* Handle mouse release event
* @param event
*/
@brief PartEllipse::mouseReleaseEvent
Handle mouse release event
@param event
*/
void PartEllipse::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton && event->buttonDownPos(Qt::LeftButton) == event->pos())
@@ -164,11 +164,11 @@ void PartEllipse::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief PartEllipse::itemChange
* @param change
* @param value
* @return
*/
@brief PartEllipse::itemChange
@param change
@param value
@return
*/
QVariant PartEllipse::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{
if (change == ItemSelectedHasChanged && scene())
@@ -204,11 +204,11 @@ QVariant PartEllipse::itemChange(QGraphicsItem::GraphicsItemChange change, const
}
/**
* @brief PartEllipse::sceneEventFilter
* @param watched
* @param event
* @return
*/
@brief PartEllipse::sceneEventFilter
@param watched
@param event
@return
*/
bool PartEllipse::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
{
//Watched must be an handler
@@ -260,8 +260,8 @@ void PartEllipse::switchResizeMode()
}
/**
* @brief PartEllipse::adjusteHandlerPos
*/
@brief PartEllipse::adjusteHandlerPos
*/
void PartEllipse::adjusteHandlerPos()
{
if (m_handler_vector.isEmpty())
@@ -278,10 +278,10 @@ void PartEllipse::adjusteHandlerPos()
}
/**
* @brief PartEllipse::handlerMousePressEvent
* @param qghi
* @param event
*/
@brief PartEllipse::handlerMousePressEvent
@param qghi
@param event
*/
void PartEllipse::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -294,10 +294,10 @@ void PartEllipse::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphics
}
/**
* @brief PartEllipse::handlerMouseMoveEvent
* @param qghi
* @param event
*/
@brief PartEllipse::handlerMouseMoveEvent
@param qghi
@param event
*/
void PartEllipse::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -316,10 +316,10 @@ void PartEllipse::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsS
}
/**
* @brief PartEllipse::handlerMouseReleaseEvent
* @param qghi
* @param event
*/
@brief PartEllipse::handlerMouseReleaseEvent
@param qghi
@param event
*/
void PartEllipse::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -332,9 +332,9 @@ void PartEllipse::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphi
}
/**
* @brief PartEllipse::sceneSelectionChanged
* When the scene selection change, if there are several primitive selected, we remove the handler of this item
*/
@brief PartEllipse::sceneSelectionChanged
When the scene selection change, if there are several primitive selected, we remove the handler of this item
*/
void PartEllipse::sceneSelectionChanged()
{
if (this->isSelected() && scene()->selectedItems().size() == 1)
@@ -344,9 +344,9 @@ void PartEllipse::sceneSelectionChanged()
}
/**
* @brief PartEllipse::addHandler
* Add handlers for this item
*/
@brief PartEllipse::addHandler
Add handlers for this item
*/
void PartEllipse::addHandler()
{
if (m_handler_vector.isEmpty() && scene())
@@ -368,9 +368,9 @@ void PartEllipse::addHandler()
}
/**
* @brief PartEllipse::removeHandler
* Remove the handlers of this item
*/
@brief PartEllipse::removeHandler
Remove the handlers of this item
*/
void PartEllipse::removeHandler()
{
if (!m_handler_vector.isEmpty())

View File

@@ -23,10 +23,10 @@
class QPropertyUndoCommand;
/**
* @brief The PartEllipse class
* This class represents an ellipse primitive which may be used to compose the
* drawing of an electrical element within the element editor.
*/
@brief The PartEllipse class
This class represents an ellipse primitive which may be used to compose the
drawing of an electrical element within the element editor.
*/
class PartEllipse : public AbstractPartEllipse
{
Q_OBJECT
@@ -43,9 +43,9 @@ class PartEllipse : public AbstractPartEllipse
public:
enum { Type = UserType + 1103 };
/**
* Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartEllipse.
* @return the QGraphicsItem type
*/
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartEllipse.
@return the QGraphicsItem type
*/
int type() const override { return Type; }
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr) override;

View File

@@ -23,11 +23,11 @@
/**
* @brief PartLine::PartLine
* Constructor
* @param editor : QETElementEditor of this part
* @param parent : parent item
*/
@brief PartLine::PartLine
Constructor
@param editor : QETElementEditor of this part
@param parent : parent item
*/
PartLine::PartLine(QETElementEditor *editor, QGraphicsItem *parent) :
CustomElementGraphicPart(editor, parent),
first_end(Qet::None),
@@ -47,10 +47,10 @@ PartLine::~PartLine()
}
/**
* @brief PartLine::requiredLengthForEndType
* @param end_type
* @return the number of "length" needed to draw a extremity of type Qet::EndType.
*/
@brief PartLine::requiredLengthForEndType
@param end_type
@return the number of "length" needed to draw a extremity of type Qet::EndType.
*/
uint PartLine::requiredLengthForEndType(const Qet::EndType &end_type)
{
uint length_count_required = 0;
@@ -64,12 +64,12 @@ uint PartLine::requiredLengthForEndType(const Qet::EndType &end_type)
}
/**
* @brief PartLine::paint
* Draw this line
* @param painter
* @param options
* @param widget
*/
@brief PartLine::paint
Draw this line
@param painter
@param options
@param widget
*/
void PartLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget)
{
Q_UNUSED(widget);
@@ -97,11 +97,11 @@ void PartLine::paint(QPainter *painter, const QStyleOptionGraphicsItem *options,
}
/**
* @brief PartLine::toXml
* Export this line in xml
* @param xml_document : Xml document to use for create the xml element.
* @return an xml element that describe this line
*/
@brief PartLine::toXml
Export this line in xml
@param xml_document : Xml document to use for create the xml element.
@return an xml element that describe this line
*/
const QDomElement PartLine::toXml(QDomDocument &xml_document) const
{
QPointF p1(sceneP1());
@@ -122,10 +122,10 @@ const QDomElement PartLine::toXml(QDomDocument &xml_document) const
}
/**
* @brief PartLine::fromXml
* Import the properties of this line from a xml element.
* @param qde : Xml document to use
*/
@brief PartLine::fromXml
Import the properties of this line from a xml element.
@param qde : Xml document to use
*/
void PartLine::fromXml(const QDomElement &qde) {
stylesFromXml(qde);
m_line = QLineF(mapFromScene(qde.attribute("x1", "0").toDouble(),
@@ -140,11 +140,11 @@ void PartLine::fromXml(const QDomElement &qde) {
}
/**
* @brief PartLine::itemChange
* @param change
* @param value
* @return
*/
@brief PartLine::itemChange
@param change
@param value
@return
*/
QVariant PartLine::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{
if (change == ItemSelectedHasChanged && scene())
@@ -180,11 +180,11 @@ QVariant PartLine::itemChange(QGraphicsItem::GraphicsItemChange change, const QV
}
/**
* @brief PartLine::sceneEventFilter
* @param watched
* @param event
* @return
*/
@brief PartLine::sceneEventFilter
@param watched
@param event
@return
*/
bool PartLine::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
{
//Watched must be an handler
@@ -220,9 +220,9 @@ bool PartLine::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
}
/**
* @brief PartLine::adjusteHandlerPos
* Adjust the position of the handler item
*/
@brief PartLine::adjusteHandlerPos
Adjust the position of the handler item
*/
void PartLine::adjusteHandlerPos()
{
if(m_handler_vector.isEmpty())
@@ -240,10 +240,10 @@ void PartLine::adjusteHandlerPos()
}
/**
* @brief PartLine::handlerMousePressEvent
* @param qghi
* @param event
*/
@brief PartLine::handlerMousePressEvent
@param qghi
@param event
*/
void PartLine::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -256,10 +256,10 @@ void PartLine::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSce
}
/**
* @brief PartLine::handlerMouseMoveEvent
* @param qghi
* @param event
*/
@brief PartLine::handlerMouseMoveEvent
@param qghi
@param event
*/
void PartLine::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -279,10 +279,10 @@ void PartLine::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsScen
}
/**
* @brief PartLine::handlerMouseReleaseEvent
* @param qghi
* @param event
*/
@brief PartLine::handlerMouseReleaseEvent
@param qghi
@param event
*/
void PartLine::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -295,9 +295,9 @@ void PartLine::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsS
}
/**
* @brief PartLine::sceneSelectionChanged
* When the scene selection change, if there are several primitive selected, we remove the handler of this item
*/
@brief PartLine::sceneSelectionChanged
When the scene selection change, if there are several primitive selected, we remove the handler of this item
*/
void PartLine::sceneSelectionChanged()
{
if (this->isSelected() && scene()->selectedItems().size() == 1)
@@ -307,9 +307,9 @@ void PartLine::sceneSelectionChanged()
}
/**
* @brief PartLine::addHandler
* Add handlers for this item
*/
@brief PartLine::addHandler
Add handlers for this item
*/
void PartLine::addHandler()
{
if (m_handler_vector.isEmpty() && scene())
@@ -330,9 +330,9 @@ void PartLine::addHandler()
}
/**
* @brief PartLine::removeHandler
* Remove the handlers of this item
*/
@brief PartLine::removeHandler
Remove the handlers of this item
*/
void PartLine::removeHandler()
{
if (!m_handler_vector.isEmpty())
@@ -343,25 +343,25 @@ void PartLine::removeHandler()
}
/**
* @brief PartLine::sceneP1
* @return the point p1 in scene coordinate
*/
@brief PartLine::sceneP1
@return the point p1 in scene coordinate
*/
QPointF PartLine::sceneP1() const {
return(mapToScene(m_line.p1()));
}
/**
* @brief PartLine::sceneP2
* @return the point p2 in scen coordinate
*/
@brief PartLine::sceneP2
@return the point p2 in scen coordinate
*/
QPointF PartLine::sceneP2() const {
return(mapToScene(m_line.p2()));
}
/**
* @brief PartLine::shape
* @return the shape of this item
*/
@brief PartLine::shape
@return the shape of this item
*/
QPainterPath PartLine::shape() const
{
QPainterPath shape;
@@ -404,10 +404,10 @@ QPainterPath PartLine::shadowShape() const
}
/**
* @brief PartLine::fourShapePoints
* @return a list with the two points that delimite the line
* + the four points surrounding these two points
*/
@brief PartLine::fourShapePoints
@return a list with the two points that delimite the line
+ the four points surrounding these two points
*/
QList<QPointF> PartLine::fourShapePoints() const
{
const qreal marge = 2.0;
@@ -452,9 +452,9 @@ QList<QPointF> PartLine::fourShapePoints() const
}
/**
* @brief PartLine::firstEndCircleRect
* @return the rectangle bordering the entirety of the first extremity
*/
@brief PartLine::firstEndCircleRect
@return the rectangle bordering the entirety of the first extremity
*/
QRectF PartLine::firstEndCircleRect() const
{
QList<QPointF> interesting_points = fourEndPoints(m_line.p1(),
@@ -470,9 +470,9 @@ QRectF PartLine::firstEndCircleRect() const
}
/**
* @brief PartLine::secondEndCircleRect
* @return the rectangle bordering the entirety of the second extremity
*/
@brief PartLine::secondEndCircleRect
@return the rectangle bordering the entirety of the second extremity
*/
QRectF PartLine::secondEndCircleRect() const {
QList<QPointF> interesting_points = fourEndPoints(m_line.p2(),
m_line.p1(),
@@ -487,13 +487,13 @@ QRectF PartLine::secondEndCircleRect() const {
}
/**
* @brief PartLine::debugPaint
* Display several composante of the drawing
* -the bounding rect
* -special points at each extremity
* -the quadrature of the circle at each extremity, even if itself is an other type
* @param painter
*/
@brief PartLine::debugPaint
Display several composante of the drawing
-the bounding rect
-special points at each extremity
-the quadrature of the circle at each extremity, even if itself is an other type
@param painter
*/
void PartLine::debugPaint(QPainter *painter)
{
painter -> save();
@@ -516,9 +516,9 @@ void PartLine::debugPaint(QPainter *painter)
}
/**
* @brief PartLine::boundingRect
* @return the bounding rect of this part
*/
@brief PartLine::boundingRect
@return the bounding rect of this part
*/
QRectF PartLine::boundingRect() const
{
QRectF bound;
@@ -539,31 +539,31 @@ QRectF PartLine::boundingRect() const
}
/**
* @brief PartLine::isUseless
* @return true if this part is irrelevant and does not deserve to be Retained / registered.
* A line is relevant when is two point is different
*/
@brief PartLine::isUseless
@return true if this part is irrelevant and does not deserve to be Retained / registered.
A line is relevant when is two point is different
*/
bool PartLine::isUseless() const {
return(m_line.p1() == m_line.p2());
}
/**
* @brief PartLine::sceneGeometricRect
* @return the minimum, margin-less rectangle this part can fit into, in scene
* coordinates. It is different from boundingRect() because it is not supposed
* to imply any margin, and it is different from shape because it is a regular
* rectangle, not a complex shape.
*/
@brief PartLine::sceneGeometricRect
@return the minimum, margin-less rectangle this part can fit into, in scene
coordinates. It is different from boundingRect() because it is not supposed
to imply any margin, and it is different from shape because it is a regular
rectangle, not a complex shape.
*/
QRectF PartLine::sceneGeometricRect() const {
return(QRectF(sceneP1(), sceneP2()));
}
/**
* @brief PartLine::startUserTransformation
* Start the user-induced transformation, provided this primitive is contained
* within the \a initial_selection_rect bounding rectangle.
* @param initial_selection_rect
*/
@brief PartLine::startUserTransformation
Start the user-induced transformation, provided this primitive is contained
within the \a initial_selection_rect bounding rectangle.
@param initial_selection_rect
*/
void PartLine::startUserTransformation(const QRectF &initial_selection_rect)
{
Q_UNUSED(initial_selection_rect)
@@ -572,11 +572,11 @@ void PartLine::startUserTransformation(const QRectF &initial_selection_rect)
}
/**
* @brief PartLine::handleUserTransformation
* Handle the user-induced transformation from \a initial_selection_rect to \a new_selection_rect
* @param initial_selection_rect
* @param new_selection_rect
*/
@brief PartLine::handleUserTransformation
Handle the user-induced transformation from \a initial_selection_rect to \a new_selection_rect
@param initial_selection_rect
@param new_selection_rect
*/
void PartLine::handleUserTransformation(const QRectF &initial_selection_rect, const QRectF &new_selection_rect)
{
QList<QPointF> mapped_points = mapPoints(initial_selection_rect, new_selection_rect, saved_points_);
@@ -585,19 +585,19 @@ void PartLine::handleUserTransformation(const QRectF &initial_selection_rect, co
}
/**
* @brief PartLine::fourEndPoints
* Return the four interesting point needed to draw the shape
* at extremity of line (circle, diamond, arrow, triangle)
* This points are in order :
@brief PartLine::fourEndPoints
Return the four interesting point needed to draw the shape
at extremity of line (circle, diamond, arrow, triangle)
This points are in order :
* O : point on the line, at a distance 'length' of the extremity
* A : point on the line at a 'length' of 2x the extremity length
* B : point at a distance of length O - O is the projection of B on the line
* C : point at a distance of length O - O is the projection of C on the line
* @param end_point : The concerned extremity
* @param other_point : other needed point to define the line
* @param length : length to use between the extremity and the point O
* @return
*/
@param end_point : The concerned extremity
@param other_point : other needed point to define the line
@param length : length to use between the extremity and the point O
@return
*/
QList<QPointF> PartLine::fourEndPoints(const QPointF &end_point, const QPointF &other_point, const qreal &length)
{
//Vector and length of the line
@@ -665,12 +665,12 @@ void PartLine::setSecondEndLength(const qreal &l)
}
/**
* @brief PartLine::path
* @return this line has a QPainterPath.
* It's notably use when this line have an end type (circle, triangle etc....),
* because return a QPainterPath with end already draw.
* Else if there isn't an end type get P1 and P2 of line is better (faster).
*/
@brief PartLine::path
@return this line has a QPainterPath.
It's notably use when this line have an end type (circle, triangle etc....),
because return a QPainterPath with end already draw.
Else if there isn't an end type get P1 and P2 of line is better (faster).
*/
QPainterPath PartLine::path() const
{
QPainterPath path;

View File

@@ -63,9 +63,9 @@ class PartLine : public CustomElementGraphicPart
enum { Type = UserType + 1104 };
/**
* Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartLine.
* @return the QGraphicsItem type
*/
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartLine.
@return the QGraphicsItem type
*/
int type() const override { return Type; }
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr) override;
QString name() const override { return(QObject::tr("ligne", "element part name")); }

View File

@@ -25,11 +25,11 @@
/**
* @brief PartPolygon::PartPolygon
* Constructor
* @param editor : editor of this item
* @param parent : parent item
*/
@brief PartPolygon::PartPolygon
Constructor
@param editor : editor of this item
@param parent : parent item
*/
PartPolygon::PartPolygon(QETElementEditor *editor, QGraphicsItem *parent) :
CustomElementGraphicPart(editor, parent),
m_closed(false),
@@ -44,8 +44,8 @@ PartPolygon::PartPolygon(QETElementEditor *editor, QGraphicsItem *parent) :
}
/**
* @brief PartPolygon::~PartPolygon
*/
@brief PartPolygon::~PartPolygon
*/
PartPolygon::~PartPolygon()
{
if(m_undo_command) delete m_undo_command;
@@ -53,12 +53,12 @@ PartPolygon::~PartPolygon()
}
/**
* @brief PartPolygon::paint
* Draw this polygon
* @param painter
* @param options
* @param widget
*/
@brief PartPolygon::paint
Draw this polygon
@param painter
@param options
@param widget
*/
void PartPolygon::paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget)
{
Q_UNUSED(widget);
@@ -78,10 +78,10 @@ void PartPolygon::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio
}
/**
* @brief PartPolygon::fromXml
* Import the properties of this polygon from a xml element
* @param qde : Xml document to use
*/
@brief PartPolygon::fromXml
Import the properties of this polygon from a xml element
@param qde : Xml document to use
*/
void PartPolygon::fromXml(const QDomElement &qde)
{
stylesFromXml(qde);
@@ -108,11 +108,11 @@ void PartPolygon::fromXml(const QDomElement &qde)
}
/**
* @brief PartPolygon::toXml
* Export this polygin in xml
* @param xml_document : Xml document to use for create the xml element
* @return an xml element that describe this polygon
*/
@brief PartPolygon::toXml
Export this polygin in xml
@param xml_document : Xml document to use for create the xml element
@return an xml element that describe this polygon
*/
const QDomElement PartPolygon::toXml(QDomDocument &xml_document) const
{
QDomElement xml_element = xml_document.createElement("polygon");
@@ -129,10 +129,10 @@ const QDomElement PartPolygon::toXml(QDomDocument &xml_document) const
}
/**
* @brief PartPolygon::isUseless
* @return true if this part is irrelevant and does not deserve to be Retained / registered.
* A polygon is relevant when he have 2 differents points
*/
@brief PartPolygon::isUseless
@return true if this part is irrelevant and does not deserve to be Retained / registered.
A polygon is relevant when he have 2 differents points
*/
bool PartPolygon::isUseless() const
{
if (m_polygon.count() < 2) return(true);
@@ -144,22 +144,22 @@ bool PartPolygon::isUseless() const
}
/**
* @brief PartPolygon::sceneGeometricRect
* @return the minimum, margin-less rectangle this part can fit into, in scene
* coordinates. It is different from boundingRect() because it is not supposed
* to imply any margin, and it is different from shape because it is a regular
* rectangle, not a complex shape.
*/
@brief PartPolygon::sceneGeometricRect
@return the minimum, margin-less rectangle this part can fit into, in scene
coordinates. It is different from boundingRect() because it is not supposed
to imply any margin, and it is different from shape because it is a regular
rectangle, not a complex shape.
*/
QRectF PartPolygon::sceneGeometricRect() const {
return(mapToScene(m_polygon.boundingRect()).boundingRect());
}
/**
* @brief PartPolygon::startUserTransformation
* Start the user-induced transformation, provided this primitive is contained
* within the initial_selection_rect bounding rectangle.
* @param initial_selection_rect
*/
@brief PartPolygon::startUserTransformation
Start the user-induced transformation, provided this primitive is contained
within the initial_selection_rect bounding rectangle.
@param initial_selection_rect
*/
void PartPolygon::startUserTransformation(const QRectF &initial_selection_rect)
{
Q_UNUSED(initial_selection_rect)
@@ -167,11 +167,11 @@ void PartPolygon::startUserTransformation(const QRectF &initial_selection_rect)
}
/**
* @brief PartPolygon::handleUserTransformation
* Handle the user-induced transformation from initial_selection_rect to new_selection_rect
* @param initial_selection_rect
* @param new_selection_rect
*/
@brief PartPolygon::handleUserTransformation
Handle the user-induced transformation from initial_selection_rect to new_selection_rect
@param initial_selection_rect
@param new_selection_rect
*/
void PartPolygon::handleUserTransformation(const QRectF &initial_selection_rect, const QRectF &new_selection_rect)
{
QList<QPointF> mapped_points = mapPoints(initial_selection_rect, new_selection_rect, saved_points_);
@@ -179,29 +179,29 @@ void PartPolygon::handleUserTransformation(const QRectF &initial_selection_rect,
}
/**
* @brief PartPolygon::preferredScalingMethod
* This method is called by the decorator when it needs to determine the best
* way to interactively scale a primitive. It is typically called when only a
* single primitive is being scaled.
* @return : This reimplementation systematically returns QET::RoundScaleRatios.
*/
@brief PartPolygon::preferredScalingMethod
This method is called by the decorator when it needs to determine the best
way to interactively scale a primitive. It is typically called when only a
single primitive is being scaled.
@return : This reimplementation systematically returns QET::RoundScaleRatios.
*/
QET::ScalingMethod PartPolygon::preferredScalingMethod() const {
return(QET::RoundScaleRatios);
}
/**
* @brief PartPolygon::polygon
* @return the item's polygon, or an empty polygon if no polygon has been set.
*/
@brief PartPolygon::polygon
@return the item's polygon, or an empty polygon if no polygon has been set.
*/
QPolygonF PartPolygon::polygon() const {
return m_polygon;
}
/**
* @brief PartPolygon::setPolygon
* Sets the item's polygon to be the given polygon.
* @param polygon
*/
@brief PartPolygon::setPolygon
Sets the item's polygon to be the given polygon.
@param polygon
*/
void PartPolygon::setPolygon(const QPolygonF &polygon)
{
if (m_polygon == polygon) return;
@@ -212,10 +212,10 @@ void PartPolygon::setPolygon(const QPolygonF &polygon)
}
/**
* @brief PartPolygon::addPoint
* Add new point to polygon
* @param point
*/
@brief PartPolygon::addPoint
Add new point to polygon
@param point
*/
void PartPolygon::addPoint(const QPointF &point)
{
prepareGeometryChange();
@@ -223,10 +223,10 @@ void PartPolygon::addPoint(const QPointF &point)
}
/**
* @brief PartPolygon::setLastPoint
* Set the last point of polygon to @point
* @param point
*/
@brief PartPolygon::setLastPoint
Set the last point of polygon to @point
@param point
*/
void PartPolygon::setLastPoint(const QPointF &point)
{
if (m_polygon.size())
@@ -237,9 +237,9 @@ void PartPolygon::setLastPoint(const QPointF &point)
}
/**
* @brief PartPolygon::removeLastPoint
* Remove the last point of polygon
*/
@brief PartPolygon::removeLastPoint
Remove the last point of polygon
*/
void PartPolygon::removeLastPoint()
{
if (m_polygon.size())
@@ -258,11 +258,11 @@ void PartPolygon::setClosed(bool close)
}
/**
* @brief PartPolygon::setHandlerColor
* Set the handler at pos @pos (in polygon coordinate) to color @color.
* @param pos
* @param color
*/
@brief PartPolygon::setHandlerColor
Set the handler at pos @pos (in polygon coordinate) to color @color.
@param pos
@param color
*/
void PartPolygon::setHandlerColor(QPointF pos, const QColor &color)
{
for (QetGraphicsHandlerItem *qghi : m_handler_vector) {
@@ -273,8 +273,8 @@ void PartPolygon::setHandlerColor(QPointF pos, const QColor &color)
}
/**
* @brief PartPolygon::resetAllHandlerColor
* Reset the color of every handlers
@brief PartPolygon::resetAllHandlerColor
Reset the color of every handlers
*/
void PartPolygon::resetAllHandlerColor()
{
@@ -284,11 +284,11 @@ void PartPolygon::resetAllHandlerColor()
}
/**
* @brief PartPolygon::itemChange
* @param change
* @param value
* @return
*/
@brief PartPolygon::itemChange
@param change
@param value
@return
*/
QVariant PartPolygon::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{
if (change == ItemSelectedHasChanged && scene())
@@ -324,11 +324,11 @@ QVariant PartPolygon::itemChange(QGraphicsItem::GraphicsItemChange change, const
}
/**
* @brief PartPolygon::sceneEventFilter
* @param watched
* @param event
* @return
*/
@brief PartPolygon::sceneEventFilter
@param watched
@param event
@return
*/
bool PartPolygon::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
{
//Watched must be an handler
@@ -388,8 +388,8 @@ void PartPolygon::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
}
/**
* @brief PartPolygon::adjusteHandlerPos
*/
@brief PartPolygon::adjusteHandlerPos
*/
void PartPolygon::adjusteHandlerPos()
{
if(m_handler_vector.isEmpty())
@@ -410,10 +410,10 @@ void PartPolygon::adjusteHandlerPos()
}
/**
* @brief PartPolygon::handlerMousePressEvent
* @param qghi
* @param event
*/
@brief PartPolygon::handlerMousePressEvent
@param qghi
@param event
*/
void PartPolygon::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -424,10 +424,10 @@ void PartPolygon::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphics
}
/**
* @brief PartPolygon::handlerMouseMoveEvent
* @param qghi
* @param event
*/
@brief PartPolygon::handlerMouseMoveEvent
@param qghi
@param event
*/
void PartPolygon::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -444,10 +444,10 @@ void PartPolygon::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsS
}
/**
* @brief PartPolygon::handlerMouseReleaseEvent
* @param qghi
* @param event
*/
@brief PartPolygon::handlerMouseReleaseEvent
@param qghi
@param event
*/
void PartPolygon::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi);
@@ -460,9 +460,9 @@ void PartPolygon::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphi
}
/**
* @brief PartPolygon::sceneSelectionChanged
* When the scene selection change, if there are several primitive selected, we remove the handler of this item
*/
@brief PartPolygon::sceneSelectionChanged
When the scene selection change, if there are several primitive selected, we remove the handler of this item
*/
void PartPolygon::sceneSelectionChanged()
{
if (this->isSelected() && scene()->selectedItems().size() == 1)
@@ -472,9 +472,9 @@ void PartPolygon::sceneSelectionChanged()
}
/**
* @brief PartPolygon::addHandler
* Add handlers for this item
*/
@brief PartPolygon::addHandler
Add handlers for this item
*/
void PartPolygon::addHandler()
{
if (m_handler_vector.isEmpty() && scene())
@@ -492,9 +492,9 @@ void PartPolygon::addHandler()
}
/**
* @brief PartPolygon::removeHandler
* Remove the handlers of this item
*/
@brief PartPolygon::removeHandler
Remove the handlers of this item
*/
void PartPolygon::removeHandler()
{
if (!m_handler_vector.isEmpty())
@@ -505,9 +505,9 @@ void PartPolygon::removeHandler()
}
/**
* @brief PartPolygon::insertPoint
* Insert a point in this polygone
*/
@brief PartPolygon::insertPoint
Insert a point in this polygone
*/
void PartPolygon::insertPoint()
{
QPolygonF new_polygon = QetGraphicsHandlerUtility::polygonForInsertPoint(m_polygon, m_closed, elementScene()->snapToGrid(m_context_menu_pos));
@@ -522,9 +522,9 @@ void PartPolygon::insertPoint()
}
/**
* @brief PartPolygon::removePoint
* remove a point on this polygon
*/
@brief PartPolygon::removePoint
remove a point on this polygon
*/
void PartPolygon::removePoint()
{
if (m_handler_vector.size() == 2)
@@ -556,9 +556,9 @@ void PartPolygon::removePoint()
}
/**
* @brief PartPolygon::shape
* @return the shape of this item
*/
@brief PartPolygon::shape
@return the shape of this item
*/
QPainterPath PartPolygon::shape() const
{
QPainterPath shape;
@@ -589,9 +589,9 @@ QPainterPath PartPolygon::shadowShape() const
}
/**
* @brief PartPolygon::boundingRect
* @return the bounding rect of this item
*/
@brief PartPolygon::boundingRect
@return the bounding rect of this item
*/
QRectF PartPolygon::boundingRect() const
{
QRectF r = m_polygon.boundingRect();

View File

@@ -26,10 +26,10 @@ class QetGraphicsHandlerItem;
class QAction;
/**
* @brief The PartPolygon class
* This class represents a polygon primitive which may be used to compose the
* drawing of an electrical element within the element editor.
*/
@brief The PartPolygon class
This class represents a polygon primitive which may be used to compose the
drawing of an electrical element within the element editor.
*/
class PartPolygon : public CustomElementGraphicPart
{
Q_OBJECT

View File

@@ -22,29 +22,29 @@
#include "QetGraphicsItemModeler/qetgraphicshandlerutility.h"
/**
* @brief PartRectangle::PartRectangle
* Constructor
* @param editor the QETElementEditor of this item
* @param parent parent item
*/
@brief PartRectangle::PartRectangle
Constructor
@param editor the QETElementEditor of this item
@param parent parent item
*/
PartRectangle::PartRectangle(QETElementEditor *editor, QGraphicsItem *parent) :
CustomElementGraphicPart(editor, parent)
{}
/**
* @brief PartRectangle::~PartRectangle
*/
@brief PartRectangle::~PartRectangle
*/
PartRectangle::~PartRectangle() {
removeHandler();
}
/**
* @brief PartRectangle::paint
* Draw this Rectangle
* @param painter
* @param options
* @param widget
*/
@brief PartRectangle::paint
Draw this Rectangle
@param painter
@param options
@param widget
*/
void PartRectangle::paint(QPainter *painter, const QStyleOptionGraphicsItem *options, QWidget *widget)
{
Q_UNUSED(widget);
@@ -72,11 +72,11 @@ void PartRectangle::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
}
/**
* @brief PartRectangle::toXml
* Export this rectangle in xml
* @param xml_document : Xml document to use for create the xml element.
* @return an xml element that describe this ellipse
*/
@brief PartRectangle::toXml
Export this rectangle in xml
@param xml_document : Xml document to use for create the xml element.
@return an xml element that describe this ellipse
*/
const QDomElement PartRectangle::toXml(QDomDocument &xml_document) const
{
QDomElement xml_element = xml_document.createElement("rect");
@@ -104,10 +104,10 @@ const QDomElement PartRectangle::toXml(QDomDocument &xml_document) const
}
/**
* @brief PartRectangle::fromXml
* Import the properties of this rectangle from a xml element.
* @param qde : Xml document to use.
*/
@brief PartRectangle::fromXml
Import the properties of this rectangle from a xml element.
@param qde : Xml document to use.
*/
void PartRectangle::fromXml(const QDomElement &qde)
{
stylesFromXml(qde);
@@ -123,18 +123,18 @@ void PartRectangle::fromXml(const QDomElement &qde)
}
/**
* @brief PartRectangle::rect
* @return : Returns the item's rectangle.
*/
@brief PartRectangle::rect
@return : Returns the item's rectangle.
*/
QRectF PartRectangle::rect() const {
return m_rect;
}
/**
* @brief PartRectangle::setRect
* Sets the item's rectangle to be the given rectangle.
* @param rect
*/
@brief PartRectangle::setRect
Sets the item's rectangle to be the given rectangle.
@param rect
*/
void PartRectangle::setRect(const QRectF &rect)
{
if (rect == m_rect) return;
@@ -161,28 +161,28 @@ void PartRectangle::setYRadius(qreal Y)
}
/**
* @brief PartRectangle::sceneGeometricRect
* @return the minimum, margin-less rectangle this part can fit into, in scene
* coordinates. It is different from boundingRect() because it is not supposed
* to imply any margin, and it is different from shape because it is a regular
* rectangle, not a complex shape.
*/
@brief PartRectangle::sceneGeometricRect
@return the minimum, margin-less rectangle this part can fit into, in scene
coordinates. It is different from boundingRect() because it is not supposed
to imply any margin, and it is different from shape because it is a regular
rectangle, not a complex shape.
*/
QRectF PartRectangle::sceneGeometricRect() const {
return(mapToScene(rect()).boundingRect());
}
/**
* @brief PartRectangle::sceneTopLeft
* @return the top left of rectangle, in scene coordinate
*/
@brief PartRectangle::sceneTopLeft
@return the top left of rectangle, in scene coordinate
*/
QPointF PartRectangle::sceneTopLeft() const {
return(mapToScene(rect().topLeft()));
}
/**
* @brief PartRectangle::shape
* @return the shape of this item
*/
@brief PartRectangle::shape
@return the shape of this item
*/
QPainterPath PartRectangle::shape() const
{
QPainterPath shape;
@@ -207,9 +207,9 @@ QPainterPath PartRectangle::shadowShape() const
}
/**
* @brief PartRectangle::boundingRect
* @return Bounding rectangle this part can fit into
*/
@brief PartRectangle::boundingRect
@return Bounding rectangle this part can fit into
*/
QRectF PartRectangle::boundingRect() const
{
qreal adjust = (SHADOWS_HEIGHT + penWeight()) / 2;
@@ -224,20 +224,20 @@ QRectF PartRectangle::boundingRect() const
}
/**
* @brief PartRectangle::isUseless
* @return true if this part is irrelevant and does not deserve to be Retained / registered.
* An rectangle is relevant when he's not null.
*/
@brief PartRectangle::isUseless
@return true if this part is irrelevant and does not deserve to be Retained / registered.
An rectangle is relevant when he's not null.
*/
bool PartRectangle::isUseless() const {
return(rect().isNull());
}
/**
* @brief PartRectangle::startUserTransformation
* Start the user-induced transformation, provided this primitive is contained
* within the initial_selection_rect bounding rectangle.
* @param initial_selection_rect
*/
@brief PartRectangle::startUserTransformation
Start the user-induced transformation, provided this primitive is contained
within the initial_selection_rect bounding rectangle.
@param initial_selection_rect
*/
void PartRectangle::startUserTransformation(const QRectF &initial_selection_rect)
{
Q_UNUSED(initial_selection_rect)
@@ -247,11 +247,11 @@ void PartRectangle::startUserTransformation(const QRectF &initial_selection_rect
}
/**
* @brief PartRectangle::handleUserTransformation
* Handle the user-induced transformation from \a initial_selection_rect to \a new_selection_rect
* @param initial_selection_rect
* @param new_selection_rect
*/
@brief PartRectangle::handleUserTransformation
Handle the user-induced transformation from \a initial_selection_rect to \a new_selection_rect
@param initial_selection_rect
@param new_selection_rect
*/
void PartRectangle::handleUserTransformation(const QRectF &initial_selection_rect, const QRectF &new_selection_rect)
{
QList<QPointF> mapped_points = mapPoints(initial_selection_rect, new_selection_rect, saved_points_);
@@ -259,10 +259,10 @@ void PartRectangle::handleUserTransformation(const QRectF &initial_selection_rec
}
/**
* @brief PartRectangle::mouseReleaseEvent
* Handle mouse release event
* @param event
*/
@brief PartRectangle::mouseReleaseEvent
Handle mouse release event
@param event
*/
void PartRectangle::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton && event->buttonDownPos(Qt::LeftButton) == event->pos())
@@ -272,11 +272,11 @@ void PartRectangle::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
/**
* @brief PartRectangle::itemChange
* @param change
* @param value
* @return
*/
@brief PartRectangle::itemChange
@param change
@param value
@return
*/
QVariant PartRectangle::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{
if (change == ItemSelectedHasChanged && scene())
@@ -312,11 +312,11 @@ QVariant PartRectangle::itemChange(QGraphicsItem::GraphicsItemChange change, con
}
/**
* @brief PartRectangle::sceneEventFilter
* @param watched
* @param event
* @return
*/
@brief PartRectangle::sceneEventFilter
@param watched
@param event
@return
*/
bool PartRectangle::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
{
//Watched must be an handler
@@ -352,8 +352,8 @@ bool PartRectangle::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
}
/**
* @brief PartRectangle::switchResizeMode
*/
@brief PartRectangle::switchResizeMode
*/
void PartRectangle::switchResizeMode()
{
if (m_resize_mode == 1)
@@ -385,8 +385,8 @@ void PartRectangle::switchResizeMode()
}
/**
* @brief PartRectangle::adjusteHandlerPos
*/
@brief PartRectangle::adjusteHandlerPos
*/
void PartRectangle::adjusteHandlerPos()
{
if (m_handler_vector.isEmpty()) {
@@ -417,10 +417,10 @@ void PartRectangle::adjusteHandlerPos()
}
/**
* @brief PartRectangle::handlerMousePressEvent
* @param qghi
* @param event
*/
@brief PartRectangle::handlerMousePressEvent
@param qghi
@param event
*/
void PartRectangle::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi)
@@ -435,10 +435,10 @@ void PartRectangle::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphi
}
/**
* @brief PartRectangle::handlerMouseMoveEvent
* @param qghi
* @param event
*/
@brief PartRectangle::handlerMouseMoveEvent
@param qghi
@param event
*/
void PartRectangle::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
{
Q_UNUSED(qghi)
@@ -496,9 +496,9 @@ void PartRectangle::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGrap
}
/**
* @brief PartRectangle::sceneSelectionChanged
* When the scene selection change, if there are several primitive selected, we remove the handler of this item
*/
@brief PartRectangle::sceneSelectionChanged
When the scene selection change, if there are several primitive selected, we remove the handler of this item
*/
void PartRectangle::sceneSelectionChanged()
{
if (this->isSelected() && scene()->selectedItems().size() == 1)
@@ -508,9 +508,9 @@ void PartRectangle::sceneSelectionChanged()
}
/**
* @brief PartRectangle::addHandler
* Add handlers for this item
*/
@brief PartRectangle::addHandler
Add handlers for this item
*/
void PartRectangle::addHandler()
{
if (m_handler_vector.isEmpty() && scene())
@@ -538,9 +538,9 @@ void PartRectangle::addHandler()
}
/**
* @brief PartRectangle::removeHandler
* Remove the handlers of this item
*/
@brief PartRectangle::removeHandler
Remove the handlers of this item
*/
void PartRectangle::removeHandler()
{
if (!m_handler_vector.isEmpty())

View File

@@ -23,9 +23,9 @@
class QetGraphicsHandlerItem;
/**
* This class represents a rectangle primitive which may be used to compose the
* drawing of an electrical element within the element editor.
* All coordinates is in item coordinate, except pos()
This class represents a rectangle primitive which may be used to compose the
drawing of an electrical element within the element editor.
All coordinates is in item coordinate, except pos()
*/
class PartRectangle : public CustomElementGraphicPart
{
@@ -52,9 +52,9 @@ class PartRectangle : public CustomElementGraphicPart
public:
enum { Type = UserType + 1109 };
/**
* Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartRectangle.
* @return the QGraphicsItem type
*/
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartRectangle.
@return the QGraphicsItem type
*/
int type () const override { return Type; }
void paint (QPainter *, const QStyleOptionGraphicsItem *, QWidget * = nullptr) override;
QString name () const override { return(QObject::tr("rectangle", "element part name")); }

View File

@@ -93,9 +93,9 @@ void PartTerminal::paint(QPainter *p, const QStyleOptionGraphicsItem *options, Q
}
/**
* @brief PartTerminal::shape
* @return the shape of this item
*/
@brief PartTerminal::shape
@return the shape of this item
*/
QPainterPath PartTerminal::shape() const {
QPainterPath shape;
shape.lineTo(d -> second_point);
@@ -107,9 +107,9 @@ QPainterPath PartTerminal::shape() const {
}
/**
* @brief PartTerminal::boundingRect
* @return the bounding rect of this item
*/
@brief PartTerminal::boundingRect
@return the bounding rect of this item
*/
QRectF PartTerminal::boundingRect() const {
QRectF br(QPointF(0, 0), d -> second_point);
br = br.normalized();

View File

@@ -47,9 +47,9 @@ class PartTerminal : public CustomElementGraphicPart {
public:
enum { Type = UserType + 1106 };
/**
* Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartTerminal.
* @return the QGraphicsItem type
*/
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a PartTerminal.
@return the QGraphicsItem type
*/
int type() const override { return Type; }
QString name() const override { return d -> m_name; }
QString xmlName() const override { return(QString("terminal")); }