diff --git a/sources/PropertiesEditor/propertieseditordockwidget.cpp b/sources/PropertiesEditor/propertieseditordockwidget.cpp index 497eebefb..5ac7cac25 100644 --- a/sources/PropertiesEditor/propertieseditordockwidget.cpp +++ b/sources/PropertiesEditor/propertieseditordockwidget.cpp @@ -52,7 +52,7 @@ void PropertiesEditorDockWidget::clear() { m_editor_list.removeOne(editor); ui->m_main_vlayout->removeWidget(editor); - delete editor; + delete editor; } m_editor_list.clear(); diff --git a/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp b/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp index 8f1bfe79a..db25f8dab 100644 --- a/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp +++ b/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp @@ -57,18 +57,24 @@ void QetGraphicsHandlerItem::setColor(QColor color) @param option @param widget */ -void QetGraphicsHandlerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +void QetGraphicsHandlerItem::paint(QPainter *painter, + const QStyleOptionGraphicsItem *option, + QWidget *widget) { Q_UNUSED(option) Q_UNUSED(widget) - painter->save(); - painter->setBrush(QBrush(m_color)); - QPen pen(QBrush(m_color), 2, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin); + painter->save(); + painter->setBrush(QBrush(m_color)); + QPen pen(QBrush(m_color), + 2, + Qt::SolidLine, + Qt::SquareCap, + Qt::MiterJoin); pen.setCosmetic(true); - painter->setPen(pen); + painter->setPen(pen); painter->setRenderHint(QPainter::Antialiasing, true); - painter->drawEllipse(m_handler_rect); + painter->drawEllipse(m_handler_rect); painter->restore(); } @@ -77,15 +83,17 @@ void QetGraphicsHandlerItem::paint(QPainter *painter, const QStyleOptionGraphics @param points @return A list of handler with pos at point */ -QVector QetGraphicsHandlerItem::handlerForPoint(const QVector &points, int size) +QVector QetGraphicsHandlerItem::handlerForPoint( + const QVector &points, + int size) { - QVector list_; - for (QPointF point : points) - { - QetGraphicsHandlerItem *qghi = new QetGraphicsHandlerItem(size); - qghi->setPos(point); - list_ << qghi; - } + QVector list_; + for (QPointF point : points) + { + QetGraphicsHandlerItem *qghi = new QetGraphicsHandlerItem(size); + qghi->setPos(point); + list_ << qghi; + } return list_; } diff --git a/sources/QetGraphicsItemModeler/qetgraphicshandleritem.h b/sources/QetGraphicsItemModeler/qetgraphicshandleritem.h index c1a6c2760..270b30123 100644 --- a/sources/QetGraphicsItemModeler/qetgraphicshandleritem.h +++ b/sources/QetGraphicsItemModeler/qetgraphicshandleritem.h @@ -23,34 +23,42 @@ /** @brief The QetGraphicsHandlerItem class - This graphics item represents a point, destined to be used as an handler, + This graphics item represents a point, + destined to be used as an handler, for modifie the geometrie of a another graphics item (like shapes). - The graphics item to be modified, must call "installSceneEventFilter" of this item with itself for argument,. - The ghraphics item to be modified, need to reimplement "sceneEventFilter" for create the modification behavior. + The graphics item to be modified, + must call "installSceneEventFilter" + of this item with itself for argument,. + The ghraphics item to be modified, + need to reimplement "sceneEventFilter" + for create the modification behavior. */ class QetGraphicsHandlerItem : public QGraphicsItem { - public: - QetGraphicsHandlerItem(qreal size = 10); - QRectF boundingRect() const override; + public: + QetGraphicsHandlerItem(qreal size = 10); + QRectF boundingRect() const override; enum { Type = UserType + 1200}; int type() const override {return Type;} void setColor(QColor color); - protected: - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; + protected: + void paint(QPainter *painter, + const QStyleOptionGraphicsItem *option, + QWidget *widget) override; - private: + private: QRectF m_handler_rect, m_br; - qreal m_size; + qreal m_size; QColor m_color; QPen m_pen; public: - static QVector handlerForPoint(const QVector &points, int size = 10); + static QVector handlerForPoint( + const QVector &points, int size = 10); }; #endif // QETGRAPHICSHANDLERITEM_H