mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-16 06:49:57 +01:00
Mod doc set style de same
This commit is contained in:
@@ -20,14 +20,14 @@
|
||||
#include "partterminal.h"
|
||||
|
||||
/**
|
||||
* @brief PastePartsCommand::PastePartsCommand
|
||||
* @param view : view where this command work
|
||||
* @param content_to_paste : content to paste
|
||||
* @param parent : parent undo command
|
||||
@brief PastePartsCommand::PastePartsCommand
|
||||
@param view : view where this command work
|
||||
@param content_to_paste : content to paste
|
||||
@param parent : parent undo command
|
||||
*
|
||||
* Note : all terminal stored in @content_to_paste get a new uuid in the constructor of this class to avoid have
|
||||
* several terminal of an element with the same uuid.
|
||||
*/
|
||||
Note : all terminal stored in @content_to_paste get a new uuid in the constructor of this class to avoid have
|
||||
several terminal of an element with the same uuid.
|
||||
*/
|
||||
PastePartsCommand::PastePartsCommand(ElementView *view, const ElementContent &content_to_paste, QUndoCommand *parent) :
|
||||
ElementEditionCommand(view ? view -> scene() : nullptr, view, parent)
|
||||
{
|
||||
@@ -44,16 +44,16 @@ PastePartsCommand::PastePartsCommand(ElementView *view, const ElementContent &co
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PastePartsCommand::~PastePartsCommand
|
||||
*/
|
||||
@brief PastePartsCommand::~PastePartsCommand
|
||||
*/
|
||||
PastePartsCommand::~PastePartsCommand()
|
||||
{
|
||||
m_scene->qgiManager().release(m_pasted_content);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PastePartsCommand::undo
|
||||
*/
|
||||
@brief PastePartsCommand::undo
|
||||
*/
|
||||
void PastePartsCommand::undo()
|
||||
{
|
||||
m_scene->blockSignals(true);
|
||||
@@ -72,8 +72,8 @@ void PastePartsCommand::undo()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PastePartsCommand::redo
|
||||
*/
|
||||
@brief PastePartsCommand::redo
|
||||
*/
|
||||
void PastePartsCommand::redo()
|
||||
{
|
||||
if (m_first_redo) {
|
||||
@@ -97,13 +97,13 @@ void PastePartsCommand::redo()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PastePartsCommand::setOffset
|
||||
* Describe the offset to use with this undo command
|
||||
* @param old_offset_paste_count
|
||||
* @param old_start_top_left_corner
|
||||
* @param new_offset_paste_count
|
||||
* @param new_start_top_left_corner
|
||||
*/
|
||||
@brief PastePartsCommand::setOffset
|
||||
Describe the offset to use with this undo command
|
||||
@param old_offset_paste_count
|
||||
@param old_start_top_left_corner
|
||||
@param new_offset_paste_count
|
||||
@param new_start_top_left_corner
|
||||
*/
|
||||
void PastePartsCommand::setOffset(int old_offset_paste_count, const QPointF &old_start_top_left_corner, int new_offset_paste_count, const QPointF &new_start_top_left_corner)
|
||||
{
|
||||
m_old_offset_paste_count = old_offset_paste_count;
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
class ElementView;
|
||||
|
||||
/**
|
||||
* @brief The PastePartsCommand class
|
||||
* Undo command for paste element primitive in an element editor
|
||||
*/
|
||||
@brief The PastePartsCommand class
|
||||
Undo command for paste element primitive in an element editor
|
||||
*/
|
||||
class PastePartsCommand : public ElementEditionCommand
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -95,12 +95,12 @@ void ArcEditor::disconnectChangeConnections()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ArcEditor::setPart
|
||||
* Specifie to this editor the part to edit.
|
||||
* Note that an editor can accept or refuse to edit a part. This editor accept only partArc.
|
||||
* @param new_part
|
||||
* @return
|
||||
*/
|
||||
@brief ArcEditor::setPart
|
||||
Specifie to this editor the part to edit.
|
||||
Note that an editor can accept or refuse to edit a part. This editor accept only partArc.
|
||||
@param new_part
|
||||
@return
|
||||
*/
|
||||
bool ArcEditor::setPart(CustomElementPart *new_part)
|
||||
{
|
||||
if (!new_part)
|
||||
@@ -137,9 +137,9 @@ bool ArcEditor::setParts(QList <CustomElementPart *> parts)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ArcEditor::currentPart
|
||||
* @return the curent edited part, or 0 if there is no edited part
|
||||
*/
|
||||
@brief ArcEditor::currentPart
|
||||
@return the curent edited part, or 0 if there is no edited part
|
||||
*/
|
||||
CustomElementPart *ArcEditor::currentPart() const {
|
||||
return(part);
|
||||
}
|
||||
@@ -149,9 +149,9 @@ QList<CustomElementPart*> ArcEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ArcEditor::updateArcS
|
||||
* Update the start angle of the arc according to the edited value.
|
||||
*/
|
||||
@brief ArcEditor::updateArcS
|
||||
Update the start angle of the arc according to the edited value.
|
||||
*/
|
||||
void ArcEditor::updateArcS()
|
||||
{
|
||||
if (m_locked) return;
|
||||
@@ -175,9 +175,9 @@ void ArcEditor::updateArcS()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ArcEditor::updateArcA
|
||||
* Update the span angle of the arc according to the edited value.
|
||||
*/
|
||||
@brief ArcEditor::updateArcA
|
||||
Update the span angle of the arc according to the edited value.
|
||||
*/
|
||||
void ArcEditor::updateArcA()
|
||||
{
|
||||
if (m_locked) return;
|
||||
@@ -200,9 +200,9 @@ void ArcEditor::updateArcA()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ArcEditor::updateArcRect
|
||||
* Update the geometrie of the rect that define this arc according the the edited values
|
||||
*/
|
||||
@brief ArcEditor::updateArcRect
|
||||
Update the geometrie of the rect that define this arc according the the edited values
|
||||
*/
|
||||
void ArcEditor::updateArcRectX()
|
||||
{
|
||||
if (m_locked) return;
|
||||
@@ -300,9 +300,9 @@ void ArcEditor::updateArcRectV()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ArcEditor::updateForm
|
||||
* Update the value of the widgets
|
||||
*/
|
||||
@brief ArcEditor::updateForm
|
||||
Update the value of the widgets
|
||||
*/
|
||||
void ArcEditor::updateForm()
|
||||
{
|
||||
if (!part) return;
|
||||
@@ -318,11 +318,11 @@ void ArcEditor::updateForm()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ArcEditor::activeConnections
|
||||
* Enable/disable connection between editor widget and slot editingFinished
|
||||
* True == enable | false == disable
|
||||
* @param active
|
||||
*/
|
||||
@brief ArcEditor::activeConnections
|
||||
Enable/disable connection between editor widget and slot editingFinished
|
||||
True == enable | false == disable
|
||||
@param active
|
||||
*/
|
||||
void ArcEditor::activeConnections(bool active)
|
||||
{
|
||||
if (active)
|
||||
|
||||
@@ -67,10 +67,11 @@ class ArcEditor : public ElementItemEditor
|
||||
|
||||
private:
|
||||
void activeConnections(bool);
|
||||
/*!
|
||||
* \brief setUpChangeConnections
|
||||
* Setup the connection from the arc(s) to the widget, to update it when the arc(s) are changed (moved ...)
|
||||
*/
|
||||
/**
|
||||
@brief setUpChangeConnections
|
||||
Setup the connection from the arc(s) to the widget,
|
||||
to update it when the arc(s) are changed (moved ...)
|
||||
*/
|
||||
void setUpChangeConnections();
|
||||
void disconnectChangeConnections();
|
||||
};
|
||||
|
||||
@@ -523,13 +523,13 @@ void ScalePartsCommand::adjustText() {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @brief ChangePropertiesCommand::ChangePropertiesCommand
|
||||
* Change the properties of the drawed element
|
||||
* @param scene: scene to belong the property
|
||||
* @param type: new type of element.
|
||||
* @param context: new info about type.
|
||||
* @param parent: parent undo
|
||||
*/
|
||||
@brief ChangePropertiesCommand::ChangePropertiesCommand
|
||||
Change the properties of the drawed element
|
||||
@param scene: scene to belong the property
|
||||
@param type: new type of element.
|
||||
@param context: new info about type.
|
||||
@param parent: parent undo
|
||||
*/
|
||||
ChangePropertiesCommand::ChangePropertiesCommand(ElementScene *scene, const QString& type, const DiagramContext& info, const DiagramContext& elmt_info, QUndoCommand *parent) :
|
||||
ElementEditionCommand(scene, nullptr, parent)
|
||||
{
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
#include "qgimanager.h"
|
||||
|
||||
/**
|
||||
* @brief The ElementEditionCommand class
|
||||
* ElementEditionCommand is the base class for all commands classes involved in
|
||||
@brief The ElementEditionCommand class
|
||||
ElementEditionCommand is the base class for all commands classes involved in
|
||||
the edition of an electrical element. It provides commonly required methods
|
||||
and attributes, such as accessors to the modified scene and view.
|
||||
*/
|
||||
*/
|
||||
class ElementEditionCommand : public QUndoCommand
|
||||
{
|
||||
// constructors, destructor
|
||||
|
||||
@@ -472,8 +472,8 @@ QVector<QPointF> ElementPrimitiveDecorator::getResizingsPoints() const
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPrimitiveDecorator::adjusteHandlerPos
|
||||
*/
|
||||
@brief ElementPrimitiveDecorator::adjusteHandlerPos
|
||||
*/
|
||||
void ElementPrimitiveDecorator::adjusteHandlerPos()
|
||||
{
|
||||
QVector <QPointF> points_vector = mapToScene(getResizingsPoints());
|
||||
@@ -482,10 +482,10 @@ void ElementPrimitiveDecorator::adjusteHandlerPos()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPrimitiveDecorator::handlerMousePressEvent
|
||||
* @param qghi
|
||||
* @param event
|
||||
*/
|
||||
@brief ElementPrimitiveDecorator::handlerMousePressEvent
|
||||
@param qghi
|
||||
@param event
|
||||
*/
|
||||
void ElementPrimitiveDecorator::handlerMousePressEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
@@ -499,10 +499,10 @@ void ElementPrimitiveDecorator::handlerMousePressEvent(QetGraphicsHandlerItem *q
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPrimitiveDecorator::handlerMouseMoveEvent
|
||||
* @param qghi
|
||||
* @param event
|
||||
*/
|
||||
@brief ElementPrimitiveDecorator::handlerMouseMoveEvent
|
||||
@param qghi
|
||||
@param event
|
||||
*/
|
||||
void ElementPrimitiveDecorator::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
Q_UNUSED(qghi);
|
||||
@@ -554,10 +554,10 @@ void ElementPrimitiveDecorator::handlerMouseMoveEvent(QetGraphicsHandlerItem *qg
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPrimitiveDecorator::handlerMouseReleaseEvent
|
||||
* @param qghi
|
||||
* @param event
|
||||
*/
|
||||
@brief ElementPrimitiveDecorator::handlerMouseReleaseEvent
|
||||
@param qghi
|
||||
@param event
|
||||
*/
|
||||
void ElementPrimitiveDecorator::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
Q_UNUSED(qghi);
|
||||
@@ -585,9 +585,9 @@ void ElementPrimitiveDecorator::handlerMouseReleaseEvent(QetGraphicsHandlerItem
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPrimitiveDecorator::addHandler
|
||||
* Add handlers for this item
|
||||
*/
|
||||
@brief ElementPrimitiveDecorator::addHandler
|
||||
Add handlers for this item
|
||||
*/
|
||||
void ElementPrimitiveDecorator::addHandler()
|
||||
{
|
||||
if (m_handler_vector.isEmpty() && scene())
|
||||
@@ -605,9 +605,9 @@ void ElementPrimitiveDecorator::addHandler()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPrimitiveDecorator::removeHandler
|
||||
* Remove the handlers of this item
|
||||
*/
|
||||
@brief ElementPrimitiveDecorator::removeHandler
|
||||
Remove the handlers of this item
|
||||
*/
|
||||
void ElementPrimitiveDecorator::removeHandler()
|
||||
{
|
||||
if (!m_handler_vector.isEmpty())
|
||||
@@ -688,11 +688,11 @@ QET::ScalingMethod ElementPrimitiveDecorator::scalingMethod(QGraphicsSceneMouseE
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPrimitiveDecorator::itemChange
|
||||
* @param change
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
@brief ElementPrimitiveDecorator::itemChange
|
||||
@param change
|
||||
@param value
|
||||
@return
|
||||
*/
|
||||
QVariant ElementPrimitiveDecorator::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (change == ItemSceneHasChanged)
|
||||
@@ -718,11 +718,11 @@ QVariant ElementPrimitiveDecorator::itemChange(QGraphicsItem::GraphicsItemChange
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPrimitiveDecorator::sceneEventFilter
|
||||
* @param watched
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ElementPrimitiveDecorator::sceneEventFilter
|
||||
@param watched
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ElementPrimitiveDecorator::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
|
||||
{
|
||||
//Watched must be an handler
|
||||
|
||||
@@ -75,7 +75,7 @@ ElementScene::ElementScene(QETElementEditor *editor, QObject *parent) :
|
||||
|
||||
/**
|
||||
@brief ElementScene::~ElementScene
|
||||
*/
|
||||
*/
|
||||
ElementScene::~ElementScene()
|
||||
{
|
||||
//Disconnect to avoid crash, see bug report N° 122.
|
||||
|
||||
@@ -144,10 +144,10 @@ void ElementView::zoomReset() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementView::adjustSceneRect
|
||||
* Adjust the scenRect, so that he include all primitives of element
|
||||
* plus the viewport of the scene with a margin of 1/3 of herself
|
||||
*/
|
||||
@brief ElementView::adjustSceneRect
|
||||
Adjust the scenRect, so that he include all primitives of element
|
||||
plus the viewport of the scene with a margin of 1/3 of herself
|
||||
*/
|
||||
void ElementView::adjustSceneRect() {
|
||||
QRectF esgr = m_scene -> elementSceneGeometricRect();
|
||||
QRectF vpbr = mapToScene(this -> viewport()->rect()).boundingRect();
|
||||
@@ -156,10 +156,10 @@ void ElementView::adjustSceneRect() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementView::resetSceneRect
|
||||
* reset le sceneRect (zone du schéma visualisée par l'ElementView) afin que
|
||||
* celui-ci inclut uniquement les primitives de l'élément dessiné.
|
||||
*/
|
||||
@brief ElementView::resetSceneRect
|
||||
reset le sceneRect (zone du schéma visualisée par l'ElementView) afin que
|
||||
celui-ci inclut uniquement les primitives de l'élément dessiné.
|
||||
*/
|
||||
void ElementView::resetSceneRect() {
|
||||
setSceneRect(m_scene -> elementSceneGeometricRect());
|
||||
}
|
||||
@@ -366,9 +366,9 @@ void ElementView::mousePressEvent(QMouseEvent *e) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementView::mouseMoveEvent
|
||||
* Manage the event move mouse
|
||||
*/
|
||||
@brief ElementView::mouseMoveEvent
|
||||
Manage the event move mouse
|
||||
*/
|
||||
void ElementView::mouseMoveEvent(QMouseEvent *e) {
|
||||
if (e->buttons() == Qt::MidButton)
|
||||
{
|
||||
@@ -384,9 +384,9 @@ void ElementView::mouseMoveEvent(QMouseEvent *e) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementView::mouseReleaseEvent
|
||||
* Manage event release click mouse
|
||||
*/
|
||||
@brief ElementView::mouseReleaseEvent
|
||||
Manage event release click mouse
|
||||
*/
|
||||
void ElementView::mouseReleaseEvent(QMouseEvent *e) {
|
||||
if (e -> button() == Qt::MidButton) {
|
||||
setCursor(Qt::ArrowCursor);
|
||||
@@ -397,9 +397,9 @@ void ElementView::mouseReleaseEvent(QMouseEvent *e) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementView::gestures
|
||||
* @return
|
||||
*/
|
||||
@brief ElementView::gestures
|
||||
@return
|
||||
*/
|
||||
bool ElementView::gestures() const
|
||||
{
|
||||
QSettings settings;
|
||||
@@ -408,9 +408,9 @@ bool ElementView::gestures() const
|
||||
|
||||
|
||||
/**
|
||||
* @brief ElementView::wheelEvent
|
||||
* @param e
|
||||
*/
|
||||
@brief ElementView::wheelEvent
|
||||
@param e
|
||||
*/
|
||||
void ElementView::wheelEvent(QWheelEvent *e) {
|
||||
//Zoom and scrolling
|
||||
if ( gestures() ) {
|
||||
@@ -439,11 +439,11 @@ bool ElementView::event(QEvent *e) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Utilise le pincement du trackpad pour zoomer
|
||||
* @brief ElementView::gestureEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
Utilise le pincement du trackpad pour zoomer
|
||||
@brief ElementView::gestureEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ElementView::gestureEvent(QGestureEvent *event){
|
||||
if (QGesture *gesture = event->gesture(Qt::PinchGesture)) {
|
||||
QPinchGesture *pinch = static_cast<QPinchGesture *>(gesture);
|
||||
|
||||
@@ -62,10 +62,10 @@ class EllipseEditor : public ElementItemEditor
|
||||
|
||||
private:
|
||||
void activeConnections(bool);
|
||||
/*!
|
||||
* \brief setUpChangeConnections
|
||||
* Setup the connection from the ellipse(s) to the widget, to update it when the ellipse(s) are changed (moved ...)
|
||||
*/
|
||||
/**
|
||||
@brief setUpChangeConnections
|
||||
Setup the connection from the ellipse(s) to the widget, to update it when the ellipse(s) are changed (moved ...)
|
||||
*/
|
||||
void setUpChangeConnections();
|
||||
void disconnectChangeConnections();
|
||||
};
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
#include "eseventaddarc.h"
|
||||
|
||||
/**
|
||||
* @brief ESEventAddArc::ESEventAddArc
|
||||
* @param scene
|
||||
*/
|
||||
@brief ESEventAddArc::ESEventAddArc
|
||||
@param scene
|
||||
*/
|
||||
ESEventAddArc::ESEventAddArc(ElementScene *scene) :
|
||||
ESEventInterface(scene),
|
||||
m_arc(nullptr),
|
||||
@@ -33,18 +33,18 @@ ESEventAddArc::ESEventAddArc(ElementScene *scene) :
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddArc::~ESEventAddArc
|
||||
*/
|
||||
@brief ESEventAddArc::~ESEventAddArc
|
||||
*/
|
||||
ESEventAddArc::~ESEventAddArc() {
|
||||
if (m_running || m_abort)
|
||||
delete m_arc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddPolygon::mousePressEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddPolygon::mousePressEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddArc::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event -> button() == Qt::LeftButton)
|
||||
@@ -79,10 +79,10 @@ bool ESEventAddArc::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddArc::mouseMoveEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddArc::mouseMoveEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddArc::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
updateHelpCross(event -> scenePos());
|
||||
if (!m_arc) return false;
|
||||
@@ -94,10 +94,10 @@ bool ESEventAddArc::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddArc::mouseReleaseEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddArc::mouseReleaseEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (event -> button() == Qt::RightButton) {
|
||||
if (m_arc) {delete m_arc; m_arc = nullptr;}
|
||||
@@ -108,10 +108,10 @@ bool ESEventAddArc::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddArc::keyPressEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddArc::keyPressEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddArc::keyPressEvent(QKeyEvent *event) {
|
||||
if (m_arc && event->key() == Qt::Key_Space) {
|
||||
m_inverted = m_inverted ? false : true;
|
||||
@@ -123,9 +123,9 @@ bool ESEventAddArc::keyPressEvent(QKeyEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddArc::updateArc
|
||||
* Redraw the arc with curent value
|
||||
*/
|
||||
@brief ESEventAddArc::updateArc
|
||||
Redraw the arc with curent value
|
||||
*/
|
||||
void ESEventAddArc::updateArc()
|
||||
{
|
||||
qreal width = (m_mouse_pos.x() - m_origin.x())*2;
|
||||
|
||||
@@ -25,9 +25,9 @@ class PartArc;
|
||||
class QGraphicsSceneMouseEvent;
|
||||
|
||||
/**
|
||||
* @brief The ESEventAddArc class
|
||||
* This ESEvent manage creation of arc in an ElementScene
|
||||
*/
|
||||
@brief The ESEventAddArc class
|
||||
This ESEvent manage creation of arc in an ElementScene
|
||||
*/
|
||||
class ESEventAddArc : public ESEventInterface
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
#include <QUndoStack>
|
||||
|
||||
/**
|
||||
* @brief ESEventAddDynamicTextField::ESEventAddDynamicTextField
|
||||
* @param scene
|
||||
*/
|
||||
@brief ESEventAddDynamicTextField::ESEventAddDynamicTextField
|
||||
@param scene
|
||||
*/
|
||||
ESEventAddDynamicTextField::ESEventAddDynamicTextField(ElementScene *scene) :
|
||||
ESEventInterface(scene)
|
||||
{
|
||||
@@ -35,17 +35,17 @@ ESEventAddDynamicTextField::ESEventAddDynamicTextField(ElementScene *scene) :
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddDynamicTextField::~ESEventAddDynamicTextField
|
||||
*/
|
||||
@brief ESEventAddDynamicTextField::~ESEventAddDynamicTextField
|
||||
*/
|
||||
ESEventAddDynamicTextField::~ESEventAddDynamicTextField() {
|
||||
delete m_text;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddDynamicTextField::mouseMoveEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddDynamicTextField::mouseMoveEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddDynamicTextField::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
QPointF pos = m_scene->snapToGrid(event->scenePos());
|
||||
@@ -55,10 +55,10 @@ bool ESEventAddDynamicTextField::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddDynamicTextField::mouseReleaseEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddDynamicTextField::mouseReleaseEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddDynamicTextField::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
||||
@@ -25,9 +25,9 @@ class PartDynamicTextField;
|
||||
class QGraphicsSceneMouseEvent;
|
||||
|
||||
/**
|
||||
* @brief The ESEventAddDynamicTextField class
|
||||
* This ESEvent manage creation of dynamic text field in an ElementScene
|
||||
*/
|
||||
@brief The ESEventAddDynamicTextField class
|
||||
This ESEvent manage creation of dynamic text field in an ElementScene
|
||||
*/
|
||||
class ESEventAddDynamicTextField : public ESEventInterface
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -23,17 +23,17 @@
|
||||
#include "elementscene.h"
|
||||
|
||||
/**
|
||||
* @brief ESEventAddEllipse::ESEventAddEllipse
|
||||
* @param scene
|
||||
*/
|
||||
@brief ESEventAddEllipse::ESEventAddEllipse
|
||||
@param scene
|
||||
*/
|
||||
ESEventAddEllipse::ESEventAddEllipse(ElementScene *scene) :
|
||||
ESEventInterface(scene),
|
||||
m_ellipse(nullptr)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddEllipse::~ESEventAddEllipse
|
||||
*/
|
||||
@brief ESEventAddEllipse::~ESEventAddEllipse
|
||||
*/
|
||||
ESEventAddEllipse::~ESEventAddEllipse() {
|
||||
if (m_running || m_abort){
|
||||
delete m_ellipse;
|
||||
@@ -41,10 +41,10 @@ ESEventAddEllipse::~ESEventAddEllipse() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddEllipse::mousePressEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddEllipse::mousePressEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddEllipse::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (event -> button() == Qt::LeftButton) {
|
||||
if(!m_running) m_running = true;
|
||||
@@ -72,10 +72,10 @@ bool ESEventAddEllipse::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddRect::mouseMoveEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddRect::mouseMoveEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddEllipse::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
updateHelpCross(event -> scenePos());
|
||||
if (!m_ellipse) return false;
|
||||
@@ -94,10 +94,10 @@ bool ESEventAddEllipse::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddEllipse::mouseReleaseEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddEllipse::mouseReleaseEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddEllipse::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (event -> button() == Qt::RightButton) {
|
||||
if (m_ellipse) {delete m_ellipse; m_ellipse = nullptr;}
|
||||
|
||||
@@ -26,9 +26,9 @@ class PartEllipse;
|
||||
class QGraphicsSceneMouseEvent;
|
||||
|
||||
/**
|
||||
* @brief The ESEventAddEllipse class
|
||||
* This ESEvent manage creation of ellpise in an ElementScene
|
||||
*/
|
||||
@brief The ESEventAddEllipse class
|
||||
This ESEvent manage creation of ellpise in an ElementScene
|
||||
*/
|
||||
class ESEventAddEllipse : public ESEventInterface
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -25,29 +25,29 @@
|
||||
#include "editorcommands.h"
|
||||
|
||||
/**
|
||||
* @brief ESEventAddLine::ESEventAddLine
|
||||
* Constructor
|
||||
* @param scene : scene where we operate this action
|
||||
*/
|
||||
@brief ESEventAddLine::ESEventAddLine
|
||||
Constructor
|
||||
@param scene : scene where we operate this action
|
||||
*/
|
||||
ESEventAddLine::ESEventAddLine(ElementScene *scene) :
|
||||
ESEventInterface (scene),
|
||||
m_line (nullptr)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddLine::~ESEventAddLine
|
||||
* destructor
|
||||
*/
|
||||
@brief ESEventAddLine::~ESEventAddLine
|
||||
destructor
|
||||
*/
|
||||
ESEventAddLine::~ESEventAddLine() {
|
||||
if (m_running || m_abort)
|
||||
delete m_line;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddLine::mousePressEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddLine::mousePressEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddLine::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
|
||||
if (event -> button() == Qt::LeftButton) {
|
||||
@@ -76,10 +76,10 @@ bool ESEventAddLine::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddLine::mouseMoveEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddLine::mouseMoveEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddLine::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
updateHelpCross (event -> scenePos());
|
||||
@@ -92,10 +92,10 @@ bool ESEventAddLine::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddLine::mouseReleaseEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddLine::mouseReleaseEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddLine::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (event -> button() == Qt::RightButton) {
|
||||
if (m_line) {delete m_line; m_line = nullptr;}
|
||||
|
||||
@@ -25,9 +25,9 @@ class PartLine;
|
||||
class QGraphicsSceneMouseEvent;
|
||||
|
||||
/**
|
||||
* @brief The ESEventAddLine class
|
||||
* This ESEvent manage creation of line in a ElementScene
|
||||
*/
|
||||
@brief The ESEventAddLine class
|
||||
This ESEvent manage creation of line in a ElementScene
|
||||
*/
|
||||
class ESEventAddLine : public ESEventInterface
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -23,27 +23,27 @@
|
||||
#include "editorcommands.h"
|
||||
|
||||
/**
|
||||
* @brief ESEventAddPolygon::ESEventAddPolygon
|
||||
* @param scene
|
||||
*/
|
||||
@brief ESEventAddPolygon::ESEventAddPolygon
|
||||
@param scene
|
||||
*/
|
||||
ESEventAddPolygon::ESEventAddPolygon(ElementScene *scene) :
|
||||
ESEventInterface(scene),
|
||||
m_polygon(nullptr)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddPolygon::~ESEventAddPolygon
|
||||
*/
|
||||
@brief ESEventAddPolygon::~ESEventAddPolygon
|
||||
*/
|
||||
ESEventAddPolygon::~ESEventAddPolygon() {
|
||||
if (m_running || m_abort)
|
||||
delete m_polygon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddPolygon::mousePressEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddPolygon::mousePressEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddPolygon::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (event -> button() == Qt::LeftButton) {
|
||||
if(!m_running) m_running = true;
|
||||
@@ -63,10 +63,10 @@ bool ESEventAddPolygon::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddPolygon::mouseMoveEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddPolygon::mouseMoveEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddPolygon::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
updateHelpCross(event -> scenePos());
|
||||
if (!m_polygon) return false;
|
||||
@@ -76,10 +76,10 @@ bool ESEventAddPolygon::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddPolygon::mouseReleaseEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddPolygon::mouseReleaseEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddPolygon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (event -> button() == Qt::RightButton) {
|
||||
if (m_polygon) {
|
||||
@@ -99,10 +99,10 @@ bool ESEventAddPolygon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddPolygon::mouseDoubleClickEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddPolygon::mouseDoubleClickEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddPolygon::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event -> button() == Qt::LeftButton)
|
||||
|
||||
@@ -25,9 +25,9 @@ class PartPolygon;
|
||||
class QGraphicsSceneMouseEvent;
|
||||
|
||||
/**
|
||||
* @brief The ESEventAddPolygon class
|
||||
* This ESEvent manage creation of polygon in an ElementScene
|
||||
*/
|
||||
@brief The ESEventAddPolygon class
|
||||
This ESEvent manage creation of polygon in an ElementScene
|
||||
*/
|
||||
class ESEventAddPolygon : public ESEventInterface
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -23,27 +23,27 @@
|
||||
#include "editorcommands.h"
|
||||
|
||||
/**
|
||||
* @brief ESEventAddRect::ESEventAddRect
|
||||
* @param scene
|
||||
*/
|
||||
@brief ESEventAddRect::ESEventAddRect
|
||||
@param scene
|
||||
*/
|
||||
ESEventAddRect::ESEventAddRect(ElementScene *scene) :
|
||||
ESEventInterface(scene),
|
||||
m_rect(nullptr)
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddRect::~ESEventAddRect
|
||||
*/
|
||||
@brief ESEventAddRect::~ESEventAddRect
|
||||
*/
|
||||
ESEventAddRect::~ESEventAddRect() {
|
||||
if (m_running || m_abort)
|
||||
delete m_rect;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddRect::mousePressEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddRect::mousePressEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddRect::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event -> button() == Qt::LeftButton)
|
||||
@@ -75,10 +75,10 @@ bool ESEventAddRect::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddRect::mouseMoveEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddRect::mouseMoveEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddRect::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
updateHelpCross(event -> scenePos());
|
||||
if (!m_rect) return false;
|
||||
@@ -89,10 +89,10 @@ bool ESEventAddRect::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddRect::mouseReleaseEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddRect::mouseReleaseEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddRect::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (event -> button() == Qt::RightButton) {
|
||||
if (m_rect) {delete m_rect; m_rect = nullptr;}
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
#include "eseventaddterminal.h"
|
||||
|
||||
/**
|
||||
* @brief ESEventAddTerminal::ESEventAddTerminal
|
||||
* @param scene
|
||||
*/
|
||||
@brief ESEventAddTerminal::ESEventAddTerminal
|
||||
@param scene
|
||||
*/
|
||||
ESEventAddTerminal::ESEventAddTerminal(ElementScene *scene) :
|
||||
ESEventInterface(scene)
|
||||
{
|
||||
@@ -35,17 +35,17 @@ ESEventAddTerminal::ESEventAddTerminal(ElementScene *scene) :
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddTerminal::~ESEventAddTerminal
|
||||
*/
|
||||
@brief ESEventAddTerminal::~ESEventAddTerminal
|
||||
*/
|
||||
ESEventAddTerminal::~ESEventAddTerminal() {
|
||||
delete m_terminal;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddTerminal::mouseMoveEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddTerminal::mouseMoveEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddTerminal::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
QPointF pos = m_scene -> snapToGrid(event -> scenePos());
|
||||
updateHelpCross(pos);
|
||||
@@ -54,10 +54,10 @@ bool ESEventAddTerminal::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddTerminal::mouseReleaseEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddTerminal::mouseReleaseEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddTerminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (event -> button() == Qt::LeftButton) {
|
||||
m_scene -> undoStack().push(new AddPartCommand(QObject::tr("Borne"), m_scene, m_terminal));
|
||||
@@ -80,10 +80,10 @@ bool ESEventAddTerminal::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddTerminal::keyPressEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddTerminal::keyPressEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddTerminal::keyPressEvent(QKeyEvent *event) {
|
||||
if (event -> key() == Qt::Key_Space) {
|
||||
switch (m_terminal->orientation()) {
|
||||
|
||||
@@ -25,9 +25,9 @@ class PartTerminal;
|
||||
class QGraphicsSceneMouseEvent;
|
||||
|
||||
/**
|
||||
* @brief The ESEventAddTerminal class
|
||||
* This ESEvent manage creation of terminal in an ElementScene
|
||||
*/
|
||||
@brief The ESEventAddTerminal class
|
||||
This ESEvent manage creation of terminal in an ElementScene
|
||||
*/
|
||||
class ESEventAddTerminal : public ESEventInterface
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
#include "elementscene.h"
|
||||
|
||||
/**
|
||||
* @brief ESEventAddText::ESEventAddText
|
||||
* @param scene
|
||||
*/
|
||||
@brief ESEventAddText::ESEventAddText
|
||||
@param scene
|
||||
*/
|
||||
ESEventAddText::ESEventAddText(ElementScene *scene) :
|
||||
ESEventInterface(scene)
|
||||
{
|
||||
@@ -35,17 +35,17 @@ ESEventAddText::ESEventAddText(ElementScene *scene) :
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddText::~ESEventAddText
|
||||
*/
|
||||
@brief ESEventAddText::~ESEventAddText
|
||||
*/
|
||||
ESEventAddText::~ESEventAddText() {
|
||||
delete m_text;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddText::mouseMoveEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddText::mouseMoveEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddText::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
QPointF pos = m_scene -> snapToGrid(event -> scenePos());
|
||||
updateHelpCross(pos);
|
||||
@@ -54,10 +54,10 @@ bool ESEventAddText::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventAddText::mouseReleaseEvent
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventAddText::mouseReleaseEvent
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventAddText::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
m_scene -> undoStack().push(new AddPartCommand(QObject::tr("Texte"), m_scene, m_text));
|
||||
|
||||
@@ -25,9 +25,9 @@ class PartText;
|
||||
class QGraphicsSceneMouseEvent;
|
||||
|
||||
/**
|
||||
* @brief The ESEventAddText class
|
||||
* This ESEvent manage creation of text in an ElementScene
|
||||
*/
|
||||
@brief The ESEventAddText class
|
||||
This ESEvent manage creation of text in an ElementScene
|
||||
*/
|
||||
class ESEventAddText : public ESEventInterface
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -32,9 +32,9 @@ ESEventInterface::ESEventInterface(ElementScene *scene) :
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventInterface::init
|
||||
* Init this event interface
|
||||
*/
|
||||
@brief ESEventInterface::init
|
||||
Init this event interface
|
||||
*/
|
||||
void ESEventInterface::init()
|
||||
{
|
||||
m_scene->setBehavior(ElementScene::Behavior::AddPart);
|
||||
@@ -42,9 +42,9 @@ void ESEventInterface::init()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventInterface::~ESEventInterface
|
||||
* Destructor
|
||||
*/
|
||||
@brief ESEventInterface::~ESEventInterface
|
||||
Destructor
|
||||
*/
|
||||
ESEventInterface::~ESEventInterface()
|
||||
{
|
||||
delete m_help_horiz;
|
||||
@@ -80,11 +80,11 @@ bool ESEventInterface::wheelEvent(QGraphicsSceneWheelEvent *event) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ESEventInterface::keyPressEvent
|
||||
* By default, press escape key abort the curent action
|
||||
* @param event
|
||||
* @return
|
||||
*/
|
||||
@brief ESEventInterface::keyPressEvent
|
||||
By default, press escape key abort the curent action
|
||||
@param event
|
||||
@return
|
||||
*/
|
||||
bool ESEventInterface::keyPressEvent(QKeyEvent *event) {
|
||||
if (event->key() == Qt::Key_Escape) {
|
||||
m_running = false;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ¢er, QPainter *painter)
|
||||
{
|
||||
painter -> save();
|
||||
@@ -64,10 +64,10 @@ void CustomElementGraphicPart::drawCross(const QPointF ¢er, 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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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")); }
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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")); }
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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")); }
|
||||
|
||||
@@ -110,12 +110,12 @@ void LineEditor::disconnectChangeConnections()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LineEditor::setPart
|
||||
* Specifie to this editor the part to edit.
|
||||
* Note that an editor can accept or refuse to edit a part. This editor accept only PartLine.
|
||||
* @param new_part
|
||||
* @return
|
||||
*/
|
||||
@brief LineEditor::setPart
|
||||
Specifie to this editor the part to edit.
|
||||
Note that an editor can accept or refuse to edit a part. This editor accept only PartLine.
|
||||
@param new_part
|
||||
@return
|
||||
*/
|
||||
bool LineEditor::setPart(CustomElementPart *new_part)
|
||||
{
|
||||
if (!new_part)
|
||||
@@ -164,17 +164,17 @@ QList<CustomElementPart*> LineEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LineEditor::editedP1
|
||||
* @return The edited P1 in item coordinate
|
||||
*/
|
||||
@brief LineEditor::editedP1
|
||||
@return The edited P1 in item coordinate
|
||||
*/
|
||||
QPointF LineEditor::editedP1() const {
|
||||
return part -> mapFromScene(x1->value(), y1->value());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LineEditor::editedP2
|
||||
* @return The edited P2 in item coordinate
|
||||
*/
|
||||
@brief LineEditor::editedP2
|
||||
@return The edited P2 in item coordinate
|
||||
*/
|
||||
QPointF LineEditor::editedP2() const {
|
||||
return part -> mapFromScene(x2->value(), y2->value());
|
||||
}
|
||||
@@ -366,9 +366,9 @@ void LineEditor::lineEditingFinishedY2()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LineEditor::updateForm
|
||||
* Update the value of the widgets
|
||||
*/
|
||||
@brief LineEditor::updateForm
|
||||
Update the value of the widgets
|
||||
*/
|
||||
void LineEditor::updateForm()
|
||||
{
|
||||
if (!part) return;
|
||||
@@ -387,11 +387,11 @@ void LineEditor::updateForm()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief LineEditor::activeConnections
|
||||
* Enable/disable connection between editor widget and slot editingFinished
|
||||
* True == enable | false == disable
|
||||
* @param active
|
||||
*/
|
||||
@brief LineEditor::activeConnections
|
||||
Enable/disable connection between editor widget and slot editingFinished
|
||||
True == enable | false == disable
|
||||
@param active
|
||||
*/
|
||||
void LineEditor::activeConnections(bool active)
|
||||
{
|
||||
if (active)
|
||||
|
||||
@@ -70,10 +70,11 @@ class LineEditor : public ElementItemEditor
|
||||
|
||||
private:
|
||||
void activeConnections(bool);
|
||||
/*!
|
||||
* \brief setUpChangeConnections
|
||||
* Setup the connection from the line(s) to the widget, to update it when the line(s) are changed (moved ...)
|
||||
*/
|
||||
/**
|
||||
@brief setUpChangeConnections
|
||||
Setup the connection from the line(s) to the widget,
|
||||
to update it when the line(s) are changed (moved ...)
|
||||
*/
|
||||
void setUpChangeConnections();
|
||||
void disconnectChangeConnections();
|
||||
};
|
||||
|
||||
@@ -106,10 +106,10 @@ QETElementEditor::~QETElementEditor() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::setLocation
|
||||
* The new location to edit
|
||||
* @param el
|
||||
*/
|
||||
@brief QETElementEditor::setLocation
|
||||
The new location to edit
|
||||
@param el
|
||||
*/
|
||||
void QETElementEditor::setLocation(const ElementsLocation &el) {
|
||||
location_ = el;
|
||||
opened_from_file = false;
|
||||
@@ -132,9 +132,9 @@ void QETElementEditor::setFileName(const QString &fn) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::setupActions
|
||||
* Create action used in Element editor
|
||||
*/
|
||||
@brief QETElementEditor::setupActions
|
||||
Create action used in Element editor
|
||||
*/
|
||||
void QETElementEditor::setupActions() {
|
||||
new_element = new QAction(QET::Icons::DocumentNew, tr("&Nouveau"), this);
|
||||
open = new QAction(QET::Icons::FolderOpen, tr("&Ouvrir"), this);
|
||||
@@ -260,7 +260,7 @@ void QETElementEditor::setupActions() {
|
||||
addToolBar(Qt::TopToolBarArea, depth_toolbar);
|
||||
|
||||
/*
|
||||
* Action related to zoom
|
||||
Action related to zoom
|
||||
*/
|
||||
m_zoom_ag = new QActionGroup(this);
|
||||
|
||||
@@ -280,7 +280,7 @@ void QETElementEditor::setupActions() {
|
||||
connect(zoom_reset, SIGNAL(triggered()), m_view, SLOT(zoomReset() ));
|
||||
|
||||
/*
|
||||
* Action related to primitive creation
|
||||
Action related to primitive creation
|
||||
*/
|
||||
connect (m_elmt_scene, SIGNAL(partsAdded()), this, SLOT(UncheckAddPrimitive()));
|
||||
parts = new QActionGroup(this);
|
||||
@@ -359,8 +359,8 @@ void QETElementEditor::setupActions() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::setupMenus
|
||||
*/
|
||||
@brief QETElementEditor::setupMenus
|
||||
*/
|
||||
void QETElementEditor::setupMenus() {
|
||||
file_menu = new QMenu(tr("&Fichier"), this);
|
||||
edit_menu = new QMenu(tr("&Édition"), this);
|
||||
@@ -422,11 +422,11 @@ void QETElementEditor::setupMenus() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::contextMenu
|
||||
* Display a context menu, with all available action.
|
||||
* @param p, the pos of the menu, in screen coordinate
|
||||
* @param actions, a list of actions who can be prepended to the context menu.
|
||||
*/
|
||||
@brief QETElementEditor::contextMenu
|
||||
Display a context menu, with all available action.
|
||||
@param p, the pos of the menu, in screen coordinate
|
||||
@param actions, a list of actions who can be prepended to the context menu.
|
||||
*/
|
||||
void QETElementEditor::contextMenu(QPoint p, QList<QAction *> actions) {
|
||||
QMenu menu(this);
|
||||
menu.addActions(std::move(actions));
|
||||
@@ -511,8 +511,8 @@ void QETElementEditor::slot_updateTitle() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::setupInterface
|
||||
*/
|
||||
@brief QETElementEditor::setupInterface
|
||||
*/
|
||||
void QETElementEditor::setupInterface() {
|
||||
// editeur
|
||||
m_elmt_scene = new ElementScene(this, this);
|
||||
@@ -747,10 +747,10 @@ void QETElementEditor::slot_updateInformations() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::checkElement
|
||||
* Do several check about element.
|
||||
* If error is occurred return false
|
||||
*/
|
||||
@brief QETElementEditor::checkElement
|
||||
Do several check about element.
|
||||
If error is occurred return false
|
||||
*/
|
||||
bool QETElementEditor::checkElement() {
|
||||
//List of warning and error
|
||||
typedef QPair<QString, QString> QETWarning;
|
||||
@@ -897,11 +897,11 @@ void QETElementEditor::fromFile(const QString &filepath) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::toFile
|
||||
* Save to file the drawed element.
|
||||
* @param fn : path of the file
|
||||
* @return : true if succesfully save.
|
||||
*/
|
||||
@brief QETElementEditor::toFile
|
||||
Save to file the drawed element.
|
||||
@param fn : path of the file
|
||||
@return : true if succesfully save.
|
||||
*/
|
||||
bool QETElementEditor::toFile(const QString &fn) {
|
||||
m_elmt_scene -> clearEventInterface();
|
||||
m_elmt_scene -> clearSelection();
|
||||
@@ -920,11 +920,11 @@ bool QETElementEditor::toFile(const QString &fn) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::toLocation
|
||||
* Save the element to Location
|
||||
* @param location : location where we must save the current element
|
||||
* @return true if succesfully saved
|
||||
*/
|
||||
@brief QETElementEditor::toLocation
|
||||
Save the element to Location
|
||||
@param location : location where we must save the current element
|
||||
@return true if succesfully saved
|
||||
*/
|
||||
bool QETElementEditor::toLocation(const ElementsLocation &location) {
|
||||
m_elmt_scene -> clearEventInterface();
|
||||
m_elmt_scene -> clearSelection();
|
||||
@@ -1002,73 +1002,73 @@ bool QETElementEditor::isReadOnly() const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::addLine
|
||||
* Set line creation interface to scene
|
||||
*/
|
||||
@brief QETElementEditor::addLine
|
||||
Set line creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addLine() {
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddLine(m_elmt_scene));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::addRect
|
||||
* Set rectangle creation interface to scene
|
||||
*/
|
||||
@brief QETElementEditor::addRect
|
||||
Set rectangle creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addRect() {
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddRect(m_elmt_scene));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::addEllipse
|
||||
* Set ellipse creation interface to scene
|
||||
*/
|
||||
@brief QETElementEditor::addEllipse
|
||||
Set ellipse creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addEllipse() {
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddEllipse(m_elmt_scene));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::addPolygon
|
||||
* Set polygon creation interface to scene
|
||||
*/
|
||||
@brief QETElementEditor::addPolygon
|
||||
Set polygon creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addPolygon() {
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddPolygon(m_elmt_scene));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::addArc
|
||||
* Set arc creation interface to scene
|
||||
*/
|
||||
@brief QETElementEditor::addArc
|
||||
Set arc creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addArc() {
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddArc(m_elmt_scene));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::addText
|
||||
* Set text creation interface to scene
|
||||
*/
|
||||
@brief QETElementEditor::addText
|
||||
Set text creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addText() {
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddText(m_elmt_scene));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::addTerminal
|
||||
* Set terminal creation interface to scene
|
||||
*/
|
||||
@brief QETElementEditor::addTerminal
|
||||
Set terminal creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addTerminal() {
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddTerminal(m_elmt_scene));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::addDynamicTextField
|
||||
* Set dynamic text field creation interface to scene
|
||||
*/
|
||||
@brief QETElementEditor::addDynamicTextField
|
||||
Set dynamic text field creation interface to scene
|
||||
*/
|
||||
void QETElementEditor::addDynamicTextField() {
|
||||
m_elmt_scene -> setEventInterface(new ESEventAddDynamicTextField(m_elmt_scene));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::UncheckAddPrimitive
|
||||
* Uncheck all action related to primitive
|
||||
*/
|
||||
@brief QETElementEditor::UncheckAddPrimitive
|
||||
Uncheck all action related to primitive
|
||||
*/
|
||||
void QETElementEditor::UncheckAddPrimitive() {
|
||||
foreach(QAction *action, parts -> actions()) {
|
||||
action -> setChecked(false);
|
||||
@@ -1126,8 +1126,8 @@ void QETElementEditor::openRecentFile(const QString &filepath) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::slot_openDxf
|
||||
*/
|
||||
@brief QETElementEditor::slot_openDxf
|
||||
*/
|
||||
void QETElementEditor::slot_openDxf (){
|
||||
|
||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
|
||||
@@ -1170,9 +1170,9 @@ void QETElementEditor::openElement(const QString &filepath) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::slot_reload
|
||||
* Reload the element from the file or location
|
||||
*/
|
||||
@brief QETElementEditor::slot_reload
|
||||
Reload the element from the file or location
|
||||
*/
|
||||
void QETElementEditor::slot_reload() {
|
||||
//If user already edit the element, ask confirmation to reload
|
||||
if (!m_elmt_scene -> undoStack().isClean()) {
|
||||
@@ -1197,11 +1197,11 @@ void QETElementEditor::slot_reload() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::slot_save
|
||||
* Save the current editing element.
|
||||
* If the filepath or location is unknown, use save_as instead
|
||||
* @return true if save with success
|
||||
*/
|
||||
@brief QETElementEditor::slot_save
|
||||
Save the current editing element.
|
||||
If the filepath or location is unknown, use save_as instead
|
||||
@return true if save with success
|
||||
*/
|
||||
bool QETElementEditor::slot_save() {
|
||||
// Check element befor writing
|
||||
if (checkElement()) {
|
||||
@@ -1236,11 +1236,11 @@ bool QETElementEditor::slot_save() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::slot_saveAs
|
||||
* Ask a location to user and save the current edited element
|
||||
* to this location
|
||||
* @return true if save with success
|
||||
*/
|
||||
@brief QETElementEditor::slot_saveAs
|
||||
Ask a location to user and save the current edited element
|
||||
to this location
|
||||
@return true if save with success
|
||||
*/
|
||||
bool QETElementEditor::slot_saveAs() {
|
||||
// Check element befor writing
|
||||
if (checkElement()) {
|
||||
@@ -1264,10 +1264,10 @@ bool QETElementEditor::slot_saveAs() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::slot_saveAsFile
|
||||
* Ask a file to user and save the current edited element to this file
|
||||
* @return true if save with success
|
||||
*/
|
||||
@brief QETElementEditor::slot_saveAsFile
|
||||
Ask a file to user and save the current edited element to this file
|
||||
@return true if save with success
|
||||
*/
|
||||
bool QETElementEditor::slot_saveAsFile() {
|
||||
// Check element befor writing
|
||||
if (checkElement()) {
|
||||
@@ -1480,9 +1480,9 @@ void QETElementEditor::slot_updateSelectionFromPartsList() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::readSettings
|
||||
* Read settings
|
||||
*/
|
||||
@brief QETElementEditor::readSettings
|
||||
Read settings
|
||||
*/
|
||||
void QETElementEditor::readSettings() {
|
||||
QSettings settings;
|
||||
|
||||
@@ -1503,9 +1503,9 @@ void QETElementEditor::readSettings() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::writeSettings
|
||||
* Write the settings
|
||||
*/
|
||||
@brief QETElementEditor::writeSettings
|
||||
Write the settings
|
||||
*/
|
||||
void QETElementEditor::writeSettings() {
|
||||
QSettings settings;
|
||||
settings.setValue("elementeditor/geometry", saveGeometry());
|
||||
@@ -1547,10 +1547,10 @@ QString QETElementEditor::getOpenElementFileName(QWidget *parent, const QString
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::fromLocation
|
||||
* Location of the element to edit
|
||||
* @param location
|
||||
*/
|
||||
@brief QETElementEditor::fromLocation
|
||||
Location of the element to edit
|
||||
@param location
|
||||
*/
|
||||
void QETElementEditor::fromLocation(const ElementsLocation &location) {
|
||||
if (!location.isElement()) {
|
||||
QET::QetMessageBox::critical(this,
|
||||
@@ -1622,10 +1622,10 @@ void QETElementEditor::pasteFromFile() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETElementEditor::pasteFromElement
|
||||
* Ask an element to user, copy the xml definition of the element
|
||||
* to the clipboard and call ElementView::PasteInArea
|
||||
*/
|
||||
@brief QETElementEditor::pasteFromElement
|
||||
Ask an element to user, copy the xml definition of the element
|
||||
to the clipboard and call ElementView::PasteInArea
|
||||
*/
|
||||
void QETElementEditor::pasteFromElement() {
|
||||
//Ask for a location
|
||||
ElementsLocation location = ElementDialog::getOpenElementLocation(this);
|
||||
|
||||
@@ -432,9 +432,9 @@ void StyleEditor::updatePartFilling() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief StyleEditor::updateForm
|
||||
* Update the edition form according to the value of edited part(s)
|
||||
*/
|
||||
@brief StyleEditor::updateForm
|
||||
Update the edition form according to the value of edited part(s)
|
||||
*/
|
||||
void StyleEditor::updateForm()
|
||||
{
|
||||
if (!part && m_part_list.isEmpty()) return;
|
||||
@@ -471,12 +471,12 @@ void StyleEditor::updateForm()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief StyleEditor::setPart
|
||||
* Set the part to edit by this editor.
|
||||
* Note : editor can accept or refuse to edit a part
|
||||
* @param new_part : part to edit
|
||||
* @return true if editor accept to edit this CustomElementPart otherwise false
|
||||
*/
|
||||
@brief StyleEditor::setPart
|
||||
Set the part to edit by this editor.
|
||||
Note : editor can accept or refuse to edit a part
|
||||
@param new_part : part to edit
|
||||
@return true if editor accept to edit this CustomElementPart otherwise false
|
||||
*/
|
||||
bool StyleEditor::setPart(CustomElementPart *new_part) {
|
||||
m_part_list.clear();
|
||||
m_cep_list.clear();
|
||||
@@ -499,14 +499,14 @@ bool StyleEditor::setPart(CustomElementPart *new_part) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief StyleEditor::setParts
|
||||
* Set several parts to edit by this editor.
|
||||
* Note : editor can accept or refuse to edit several parts.
|
||||
* @param part_list
|
||||
* @return true if every customeElementPart stored in part_list can
|
||||
* be edited by this part editor, otherwise return false
|
||||
* (see StyleEditor::isStyleEditable)
|
||||
*/
|
||||
@brief StyleEditor::setParts
|
||||
Set several parts to edit by this editor.
|
||||
Note : editor can accept or refuse to edit several parts.
|
||||
@param part_list
|
||||
@return true if every customeElementPart stored in part_list can
|
||||
be edited by this part editor, otherwise return false
|
||||
(see StyleEditor::isStyleEditable)
|
||||
*/
|
||||
bool StyleEditor::setParts(QList<CustomElementPart *> part_list)
|
||||
{
|
||||
if (part_list.isEmpty()) return false;
|
||||
@@ -545,10 +545,10 @@ QList<CustomElementPart*> StyleEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief StyleEditor::isStyleEditable
|
||||
* @param cep_list
|
||||
* @return true if all of the content of cep_list can be edited by style editor, else return false.
|
||||
*/
|
||||
@brief StyleEditor::isStyleEditable
|
||||
@param cep_list
|
||||
@return true if all of the content of cep_list can be edited by style editor, else return false.
|
||||
*/
|
||||
bool StyleEditor::isStyleEditable(QList<CustomElementPart *> cep_list)
|
||||
{
|
||||
QStringList str;
|
||||
|
||||
@@ -53,11 +53,11 @@ DynamicTextFieldEditor::~DynamicTextFieldEditor() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DynamicTextFieldEditor::setPart
|
||||
* Set @part as current edited part of this widget.
|
||||
* @param part
|
||||
* @return true if @part can be edited by this widget
|
||||
*/
|
||||
@brief DynamicTextFieldEditor::setPart
|
||||
Set @part as current edited part of this widget.
|
||||
@param part
|
||||
@return true if @part can be edited by this widget
|
||||
*/
|
||||
bool DynamicTextFieldEditor::setPart(CustomElementPart *part) {
|
||||
disconnectConnections();
|
||||
|
||||
@@ -104,10 +104,10 @@ bool DynamicTextFieldEditor::setParts(QList <CustomElementPart *> parts) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DynamicTextFieldEditor::currentPart
|
||||
* @return The current edited part, note they can return nullptr if
|
||||
* there is not a currently edited part.
|
||||
*/
|
||||
@brief DynamicTextFieldEditor::currentPart
|
||||
@return The current edited part, note they can return nullptr if
|
||||
there is not a currently edited part.
|
||||
*/
|
||||
CustomElementPart *DynamicTextFieldEditor::currentPart() const {
|
||||
return m_text_field.data();
|
||||
}
|
||||
@@ -187,9 +187,9 @@ void DynamicTextFieldEditor::disconnectConnections() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief DynamicTextFieldEditor::fillInfoComboBox
|
||||
* Fill the combo box "element information"
|
||||
*/
|
||||
@brief DynamicTextFieldEditor::fillInfoComboBox
|
||||
Fill the combo box "element information"
|
||||
*/
|
||||
void DynamicTextFieldEditor::fillInfoComboBox() {
|
||||
ui -> m_elmt_info_cb -> clear();
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace Ui {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The DynamicTextFieldEditor class
|
||||
* This class provide a widget used to edit the property of a dynamic text field
|
||||
*/
|
||||
@brief The DynamicTextFieldEditor class
|
||||
This class provide a widget used to edit the property of a dynamic text field
|
||||
*/
|
||||
class DynamicTextFieldEditor : public ElementItemEditor {
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
#include <QItemDelegate>
|
||||
|
||||
/**
|
||||
* @brief The EditorDelegate class
|
||||
* This delegate is only use for disable the edition of the first
|
||||
* column of the information tree widget
|
||||
*/
|
||||
@brief The EditorDelegate class
|
||||
This delegate is only use for disable the edition of the first
|
||||
column of the information tree widget
|
||||
*/
|
||||
class EditorDelegate : public QItemDelegate
|
||||
{
|
||||
public:
|
||||
@@ -44,13 +44,13 @@ class EditorDelegate : public QItemDelegate
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief ElementPropertiesEditorWidget::ElementPropertiesEditorWidget
|
||||
* Default constructor
|
||||
* @param basic_type : QString of the drawed element
|
||||
* @param kind_info : DiagramContext to store kindInfo of drawed element
|
||||
* @param elmt_info : the information of element (label, manufacturer etc...]
|
||||
* @param parent : parent widget
|
||||
*/
|
||||
@brief ElementPropertiesEditorWidget::ElementPropertiesEditorWidget
|
||||
Default constructor
|
||||
@param basic_type : QString of the drawed element
|
||||
@param kind_info : DiagramContext to store kindInfo of drawed element
|
||||
@param elmt_info : the information of element (label, manufacturer etc...]
|
||||
@param parent : parent widget
|
||||
*/
|
||||
ElementPropertiesEditorWidget::ElementPropertiesEditorWidget(QString &basic_type, DiagramContext &kind_info, DiagramContext &elmt_info, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ElementPropertiesEditorWidget),
|
||||
@@ -64,18 +64,18 @@ ElementPropertiesEditorWidget::ElementPropertiesEditorWidget(QString &basic_type
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPropertiesEditorWidget::~ElementPropertiesEditorWidget
|
||||
* Default destructor
|
||||
*/
|
||||
@brief ElementPropertiesEditorWidget::~ElementPropertiesEditorWidget
|
||||
Default destructor
|
||||
*/
|
||||
ElementPropertiesEditorWidget::~ElementPropertiesEditorWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPropertiesEditorWidget::upDateInterface
|
||||
* Update the interface with the curent value
|
||||
*/
|
||||
@brief ElementPropertiesEditorWidget::upDateInterface
|
||||
Update the interface with the curent value
|
||||
*/
|
||||
void ElementPropertiesEditorWidget::upDateInterface()
|
||||
{
|
||||
ui->m_base_type_cb->setCurrentIndex(ui->m_base_type_cb->findData(QVariant(m_basic_type)));
|
||||
@@ -94,8 +94,8 @@ void ElementPropertiesEditorWidget::upDateInterface()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPropertiesEditorWidget::setUpInterface
|
||||
*/
|
||||
@brief ElementPropertiesEditorWidget::setUpInterface
|
||||
*/
|
||||
void ElementPropertiesEditorWidget::setUpInterface()
|
||||
{
|
||||
// Type combo box
|
||||
@@ -147,9 +147,9 @@ void ElementPropertiesEditorWidget::updateTree()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPropertiesEditorWidget::populateTree
|
||||
* Create QTreeWidgetItem of the tree widget and populate it
|
||||
*/
|
||||
@brief ElementPropertiesEditorWidget::populateTree
|
||||
Create QTreeWidgetItem of the tree widget and populate it
|
||||
*/
|
||||
void ElementPropertiesEditorWidget::populateTree()
|
||||
{
|
||||
QStringList keys{"label", "plant", "comment", "description", "designation", "manufacturer", "manufacturer_reference", "supplier", "quantity", "unity", "machine_manufacturer_reference"};
|
||||
@@ -165,9 +165,9 @@ void ElementPropertiesEditorWidget::populateTree()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPropertiesEditorWidget::on_m_buttonBox_accepted
|
||||
* Action on button accepted : the new information is set
|
||||
*/
|
||||
@brief ElementPropertiesEditorWidget::on_m_buttonBox_accepted
|
||||
Action on button accepted : the new information is set
|
||||
*/
|
||||
void ElementPropertiesEditorWidget::on_m_buttonBox_accepted()
|
||||
{
|
||||
m_basic_type = ui -> m_base_type_cb -> itemData(ui -> m_base_type_cb -> currentIndex()).toString();
|
||||
@@ -194,9 +194,9 @@ void ElementPropertiesEditorWidget::on_m_buttonBox_accepted()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged
|
||||
* @param index : Action when combo-box base type index change
|
||||
*/
|
||||
@brief ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged
|
||||
@param index : Action when combo-box base type index change
|
||||
*/
|
||||
void ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged(int index)
|
||||
{
|
||||
bool slave = false , master = false;
|
||||
|
||||
@@ -27,10 +27,10 @@ namespace Ui {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The ElementPropertiesEditorWidget class
|
||||
* This class provide a dialog for edit various property of element, like
|
||||
* the type (master, slave, report etc....) and kind info.
|
||||
*/
|
||||
@brief The ElementPropertiesEditorWidget class
|
||||
This class provide a dialog for edit various property of element, like
|
||||
the type (master, slave, report etc....) and kind info.
|
||||
*/
|
||||
class ElementPropertiesEditorWidget : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
#include "QPropertyUndoCommand/qpropertyundocommand.h"
|
||||
|
||||
/**
|
||||
* @brief PolygonEditor::PolygonEditor
|
||||
* @param editor
|
||||
* @param part
|
||||
* @param parent
|
||||
*/
|
||||
@brief PolygonEditor::PolygonEditor
|
||||
@param editor
|
||||
@param part
|
||||
@param parent
|
||||
*/
|
||||
PolygonEditor::PolygonEditor(QETElementEditor *editor, PartPolygon *part, QWidget *parent) :
|
||||
ElementItemEditor(editor, parent),
|
||||
ui(new Ui::PolygonEditor),
|
||||
@@ -44,8 +44,8 @@ PolygonEditor::PolygonEditor(QETElementEditor *editor, PartPolygon *part, QWidge
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PolygonEditor::~PolygonEditor
|
||||
*/
|
||||
@brief PolygonEditor::~PolygonEditor
|
||||
*/
|
||||
PolygonEditor::~PolygonEditor() {
|
||||
delete ui;
|
||||
}
|
||||
@@ -67,10 +67,10 @@ void PolygonEditor::disconnectChangeConnections()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PolygonEditor::setPart
|
||||
* @param new_part
|
||||
* @return
|
||||
*/
|
||||
@brief PolygonEditor::setPart
|
||||
@param new_part
|
||||
@return
|
||||
*/
|
||||
bool PolygonEditor::setPart(CustomElementPart *new_part)
|
||||
{
|
||||
if (!new_part)
|
||||
@@ -98,9 +98,9 @@ bool PolygonEditor::setPart(CustomElementPart *new_part)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PolygonEditor::currentPart
|
||||
* @return the curent edited part
|
||||
*/
|
||||
@brief PolygonEditor::currentPart
|
||||
@return the curent edited part
|
||||
*/
|
||||
CustomElementPart *PolygonEditor::currentPart() const {
|
||||
return m_part;
|
||||
}
|
||||
@@ -110,9 +110,9 @@ QList<CustomElementPart*> PolygonEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PolygonEditor::updateForm
|
||||
* Update the widget
|
||||
*/
|
||||
@brief PolygonEditor::updateForm
|
||||
Update the widget
|
||||
*/
|
||||
void PolygonEditor::updateForm()
|
||||
{
|
||||
if (!m_part) {
|
||||
@@ -135,10 +135,10 @@ void PolygonEditor::updateForm()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PolygonEditor::pointsFromTree
|
||||
* @return the point of polygon from the current value of the tree editor
|
||||
* if part coordinate.
|
||||
*/
|
||||
@brief PolygonEditor::pointsFromTree
|
||||
@return the point of polygon from the current value of the tree editor
|
||||
if part coordinate.
|
||||
*/
|
||||
QVector<QPointF> PolygonEditor::pointsFromTree()
|
||||
{
|
||||
QVector<QPointF> points;
|
||||
@@ -173,8 +173,8 @@ bool PolygonEditor::eventFilter(QObject *watched, QEvent *event)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PolygonEditor::on_m_close_polygon_cb_stateChanged
|
||||
*/
|
||||
@brief PolygonEditor::on_m_close_polygon_cb_stateChanged
|
||||
*/
|
||||
void PolygonEditor::on_m_close_polygon_cb_stateChanged(int arg1)
|
||||
{
|
||||
Q_UNUSED(arg1);
|
||||
@@ -192,9 +192,9 @@ void PolygonEditor::on_m_close_polygon_cb_stateChanged(int arg1)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PolygonEditor::on_m_points_list_tree_itemChanged
|
||||
* Update the polygon according to the current value of the tree editor
|
||||
*/
|
||||
@brief PolygonEditor::on_m_points_list_tree_itemChanged
|
||||
Update the polygon according to the current value of the tree editor
|
||||
*/
|
||||
void PolygonEditor::on_m_points_list_tree_itemChanged(QTreeWidgetItem *item, int column)
|
||||
{
|
||||
Q_UNUSED(item);
|
||||
@@ -220,9 +220,9 @@ void PolygonEditor::on_m_points_list_tree_itemChanged(QTreeWidgetItem *item, int
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief PolygonEditor::on_m_points_list_tree_itemSelectionChanged
|
||||
* Used to change the color of the current selected point.
|
||||
*/
|
||||
@brief PolygonEditor::on_m_points_list_tree_itemSelectionChanged
|
||||
Used to change the color of the current selected point.
|
||||
*/
|
||||
void PolygonEditor::on_m_points_list_tree_itemSelectionChanged()
|
||||
{
|
||||
//Prevent when selection change but the widget ins't focused
|
||||
|
||||
@@ -51,10 +51,11 @@ class PolygonEditor : public ElementItemEditor
|
||||
void on_m_remove_point_action_triggered();
|
||||
|
||||
private:
|
||||
/*!
|
||||
* \brief setUpChangeConnections
|
||||
* Setup the connection from the line(s) to the widget, to update it when the line(s) are changed (moved ...)
|
||||
*/
|
||||
/**
|
||||
@brief setUpChangeConnections
|
||||
Setup the connection from the line(s) to the widget,
|
||||
to update it when the line(s) are changed (moved ...)
|
||||
*/
|
||||
void setUpChangeConnections();
|
||||
void disconnectChangeConnections();
|
||||
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
#include "qeticons.h"
|
||||
|
||||
/**
|
||||
* @brief RectangleEditor::RectangleEditor
|
||||
* @param editor
|
||||
* @param rect
|
||||
* @param parent
|
||||
*/
|
||||
@brief RectangleEditor::RectangleEditor
|
||||
@param editor
|
||||
@param rect
|
||||
@param parent
|
||||
*/
|
||||
RectangleEditor::RectangleEditor(QETElementEditor *editor, PartRectangle *rect, QWidget *parent) :
|
||||
ElementItemEditor(editor, parent),
|
||||
m_part(rect),
|
||||
@@ -40,8 +40,8 @@ RectangleEditor::RectangleEditor(QETElementEditor *editor, PartRectangle *rect,
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief RectangleEditor::~RectangleEditor
|
||||
*/
|
||||
@brief RectangleEditor::~RectangleEditor
|
||||
*/
|
||||
RectangleEditor::~RectangleEditor() {
|
||||
delete ui;
|
||||
}
|
||||
@@ -64,10 +64,10 @@ void RectangleEditor::disconnectChangeConnections()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief RectangleEditor::setPart
|
||||
* @param part
|
||||
* @return
|
||||
*/
|
||||
@brief RectangleEditor::setPart
|
||||
@param part
|
||||
@return
|
||||
*/
|
||||
bool RectangleEditor::setPart(CustomElementPart *part)
|
||||
{
|
||||
if (!part)
|
||||
@@ -109,9 +109,9 @@ bool RectangleEditor::setParts(QList <CustomElementPart *> parts)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief RectangleEditor::currentPart
|
||||
* @return
|
||||
*/
|
||||
@brief RectangleEditor::currentPart
|
||||
@return
|
||||
*/
|
||||
CustomElementPart *RectangleEditor::currentPart() const {
|
||||
return m_part;
|
||||
}
|
||||
@@ -121,16 +121,16 @@ QList<CustomElementPart*> RectangleEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief RectangleEditor::topLeft
|
||||
* @return The edited topLeft already mapped to part coordinate
|
||||
*/
|
||||
@brief RectangleEditor::topLeft
|
||||
@return The edited topLeft already mapped to part coordinate
|
||||
*/
|
||||
QPointF RectangleEditor::editedTopLeft() const {
|
||||
return m_part->mapFromScene(ui->m_x_sb->value(), ui->m_y_sb->value());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief RectangleEditor::updateForm
|
||||
*/
|
||||
@brief RectangleEditor::updateForm
|
||||
*/
|
||||
void RectangleEditor::updateForm()
|
||||
{
|
||||
if (!m_part) {
|
||||
@@ -153,10 +153,10 @@ void RectangleEditor::updateForm()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief RectangleEditor::editingFinished
|
||||
* Slot called when a editor widget is finish to be edited
|
||||
* Update the geometry of the rectangle according to value of editing widget.
|
||||
*/
|
||||
@brief RectangleEditor::editingFinished
|
||||
Slot called when a editor widget is finish to be edited
|
||||
Update the geometry of the rectangle according to value of editing widget.
|
||||
*/
|
||||
void RectangleEditor::editingFinished()
|
||||
{
|
||||
if (m_locked) {
|
||||
@@ -340,11 +340,11 @@ void RectangleEditor::yRadiusChanged()
|
||||
|
||||
|
||||
/**
|
||||
* @brief RectangleEditor::activeConnections
|
||||
* Enable/disable connection between editor widget and slot editingFinished
|
||||
* True == enable | false == disable
|
||||
* @param active
|
||||
*/
|
||||
@brief RectangleEditor::activeConnections
|
||||
Enable/disable connection between editor widget and slot editingFinished
|
||||
True == enable | false == disable
|
||||
@param active
|
||||
*/
|
||||
void RectangleEditor::activeConnections(bool active)
|
||||
{
|
||||
if (active)
|
||||
|
||||
@@ -29,9 +29,9 @@ namespace Ui {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The RectangleEditor class
|
||||
* This class provides a widget to edit rectangles within the element editor.
|
||||
*/
|
||||
@brief The RectangleEditor class
|
||||
This class provides a widget to edit rectangles within the element editor.
|
||||
*/
|
||||
class RectangleEditor : public ElementItemEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -58,9 +58,9 @@ class RectangleEditor : public ElementItemEditor
|
||||
void xRadiusChanged();
|
||||
void yRadiusChanged();
|
||||
/*!
|
||||
* \brief setUpChangeConnections
|
||||
* Setup the connection from the rectangles(s) to the widget, to update it when the rectangles(s) are changed (moved ...)
|
||||
*/
|
||||
\brief setUpChangeConnections
|
||||
Setup the connection from the rectangles(s) to the widget, to update it when the rectangles(s) are changed (moved ...)
|
||||
*/
|
||||
void setUpChangeConnections();
|
||||
void disconnectChangeConnections();
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
#include <cassert>
|
||||
|
||||
/**
|
||||
* @brief TextEditor::TextEditor
|
||||
* Default constructor
|
||||
* @param editor : the element editor who use this editor
|
||||
* @param text : the text to edit
|
||||
* @param parent : the parent widget
|
||||
*/
|
||||
@brief TextEditor::TextEditor
|
||||
Default constructor
|
||||
@param editor : the element editor who use this editor
|
||||
@param text : the text to edit
|
||||
@param parent : the parent widget
|
||||
*/
|
||||
TextEditor::TextEditor(QETElementEditor *editor, PartText *text, QWidget *parent) :
|
||||
ElementItemEditor(editor, parent),
|
||||
ui(new Ui::TextEditor) {
|
||||
@@ -40,16 +40,16 @@ TextEditor::TextEditor(QETElementEditor *editor, PartText *text, QWidget *paren
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TextEditor::~TextEditor
|
||||
*/
|
||||
@brief TextEditor::~TextEditor
|
||||
*/
|
||||
TextEditor::~TextEditor() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TextEditor::updateForm
|
||||
* Update the gui
|
||||
*/
|
||||
@brief TextEditor::updateForm
|
||||
Update the gui
|
||||
*/
|
||||
void TextEditor::updateForm()
|
||||
{
|
||||
if (m_text.isNull()) {
|
||||
@@ -94,12 +94,12 @@ void TextEditor::disconnectEditConnection() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TextEditor::setPart
|
||||
* Set the current text to edit.
|
||||
* Set @part to nullptr to clear the current text.
|
||||
* @param part : part to edit
|
||||
* @return : return if @part is a partext or nullptr, else return false
|
||||
*/
|
||||
@brief TextEditor::setPart
|
||||
Set the current text to edit.
|
||||
Set @part to nullptr to clear the current text.
|
||||
@param part : part to edit
|
||||
@return : return if @part is a partext or nullptr, else return false
|
||||
*/
|
||||
bool TextEditor::setPart(CustomElementPart *part) {
|
||||
if (!part) {
|
||||
m_text = nullptr;
|
||||
@@ -147,9 +147,9 @@ bool TextEditor::setParts(QList <CustomElementPart *> parts) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TextEditor::currentPart
|
||||
* @return The current part
|
||||
*/
|
||||
@brief TextEditor::currentPart
|
||||
@return The current part
|
||||
*/
|
||||
CustomElementPart *TextEditor::currentPart() const {
|
||||
return m_text;
|
||||
}
|
||||
@@ -163,10 +163,10 @@ QList<CustomElementPart*> TextEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TextEditor::setUpEditConnection
|
||||
* Setup the connection between the widgets of this editor and the undo command
|
||||
* use to apply the change to the edited text.
|
||||
*/
|
||||
@brief TextEditor::setUpEditConnection
|
||||
Setup the connection between the widgets of this editor and the undo command
|
||||
use to apply the change to the edited text.
|
||||
*/
|
||||
void TextEditor::setUpEditConnection() {
|
||||
disconnectEditConnection();
|
||||
|
||||
@@ -234,8 +234,8 @@ void TextEditor::setUpEditConnection() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TextEditor::on_m_font_pb_clicked
|
||||
*/
|
||||
@brief TextEditor::on_m_font_pb_clicked
|
||||
*/
|
||||
void TextEditor::on_m_font_pb_clicked() {
|
||||
bool ok;
|
||||
QFont font_ = QFontDialog::getFont(&ok, m_text -> font(), this);
|
||||
@@ -259,9 +259,9 @@ void TextEditor::on_m_font_pb_clicked() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TextEditor::on_m_color_pb_changed
|
||||
* @param newColor
|
||||
*/
|
||||
@brief TextEditor::on_m_color_pb_changed
|
||||
@param newColor
|
||||
*/
|
||||
void TextEditor::on_m_color_pb_changed(const QColor &newColor) {
|
||||
for (int i=0; i < m_parts.length(); i++) {
|
||||
PartText* partText = m_parts[i];
|
||||
|
||||
Reference in New Issue
Block a user