ElementEditor: partterminal.cpp code style

This commit is contained in:
damianCaceres
2020-08-13 11:39:07 +01:00
committed by Laurent Trinques
parent ac5ec020a6
commit 3b4237f21f

View File

@@ -96,8 +96,7 @@ void PartTerminal::paint(QPainter *p, const QStyleOptionGraphicsItem *options, Q
* @brief PartTerminal::shape * @brief PartTerminal::shape
* @return the shape of this item * @return the shape of this item
*/ */
QPainterPath PartTerminal::shape() const QPainterPath PartTerminal::shape() const {
{
QPainterPath shape; QPainterPath shape;
shape.lineTo(d -> second_point); shape.lineTo(d -> second_point);
@@ -111,8 +110,7 @@ QPainterPath PartTerminal::shape() const
* @brief PartTerminal::boundingRect * @brief PartTerminal::boundingRect
* @return the bounding rect of this item * @return the bounding rect of this item
*/ */
QRectF PartTerminal::boundingRect() const QRectF PartTerminal::boundingRect() const {
{
QRectF br(QPointF(0, 0), d -> second_point); QRectF br(QPointF(0, 0), d -> second_point);
br = br.normalized(); br = br.normalized();
@@ -125,8 +123,7 @@ QRectF PartTerminal::boundingRect() const
Definit l'orientation de la borne Definit l'orientation de la borne
@param ori la nouvelle orientation de la borne @param ori la nouvelle orientation de la borne
*/ */
void PartTerminal::setOrientation(Qet::Orientation ori) void PartTerminal::setOrientation(Qet::Orientation ori) {
{
if (d -> m_orientation == ori) return; if (d -> m_orientation == ori) return;
prepareGeometryChange(); prepareGeometryChange();
d -> m_orientation = ori; d -> m_orientation = ori;
@@ -137,15 +134,13 @@ void PartTerminal::setOrientation(Qet::Orientation ori)
@brief PartTerminal::setName @brief PartTerminal::setName
@param name @param name
*/ */
void PartTerminal::setName(QString& name) void PartTerminal::setName(QString& name) {
{
if (d -> m_name == name) return; if (d -> m_name == name) return;
d -> m_name = name; d -> m_name = name;
emit nameChanged(); emit nameChanged();
} }
void PartTerminal::setNewUuid() void PartTerminal::setNewUuid() {
{
d -> m_uuid = QUuid::createUuid(); d -> m_uuid = QUuid::createUuid();
} }
@@ -196,6 +191,7 @@ void PartTerminal::startUserTransformation(const QRectF &initial_selection_rect)
Handle the user-induced transformation from \a initial_selection_rect to \a new_selection_rect Handle the user-induced transformation from \a initial_selection_rect to \a new_selection_rect
*/ */
void PartTerminal::handleUserTransformation(const QRectF &initial_selection_rect, const QRectF &new_selection_rect) { void PartTerminal::handleUserTransformation(const QRectF &initial_selection_rect, const QRectF &new_selection_rect) {
QPointF mapped_point = mapPoints(initial_selection_rect, new_selection_rect, QList<QPointF>() << saved_position_).first(); QPointF mapped_point = mapPoints(
initial_selection_rect, new_selection_rect, QList<QPointF>() << saved_position_).first();
setPos(mapped_point); setPos(mapped_point);
} }