Mod doc set style de same

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

View File

@@ -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();