Re: Suggestions to improve code in WidgetBase.h / .cpp

Robert Hairgrove <[email protected]>
Newsgroups gmane.linux.umbrello.devel
Message-ID <[email protected]>
On 2021-12-31 05:51, Robert Hairgrove wrote:
>   WidgetBase& operator=(const WidgetBase& other)...

I believe that the assignment operators for WidgetBase, 
DiagramProxyWidget, and UmlWidget can all be removed. I did this and was 
still able to compile everything, so I think they must not be used by 
any other code. The implementation of UmlWidget::operator= DOES use the 
other two, since it inherits both of them, but its own assignment 
operator is not used, AFAICT.

Might also be a good idea to use Q_DISABLE_COPY(...) on these classes.

In diagramproxywidget.h/.cpp the following functions should be declared 
const:

     const QRectF &clientRect();
     const QRectF &sceneRect();
     UMLWidget *DiagramProxyWidget::getProxiedWidget(const QPointF &p);
     bool DiagramProxyWidget::isProxyWidget();
     UMLWidget *DiagramProxyWidget::getProxiedWidget(const QPointF &p);
     QPointF DiagramProxyWidget::mapFromClient(const QPointF &pos);
     QRectF DiagramProxyWidget::mapFromClient(const QRectF &r);
     QPointF DiagramProxyWidget::mapToClient(const QPointF &pos);
     void DiagramProxyWidget::setupEvent(QGraphicsSceneMouseEvent &e, 
QGraphicsSceneMouseEvent *event, const QPointF & pos);
     void DiagramProxyWidget::setupEvent(QGraphicsSceneContextMenuEvent 
&e, QGraphicsSceneContextMenuEvent *event, const QPointF & pos);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.