[qet] qet/qet: [5085] Backport fix made in commit 5073, 5077, 5079 in branch 0.6 |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5085
Author: blacksun
Date: 2017-10-23 14:53:00 +0200 (Mon, 23 Oct 2017)
Log Message:
-----------
Backport fix made in commit 5073, 5077, 5079 in branch 0.6
Modified Paths:
--------------
branches/0.60/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp
branches/0.60/sources/QetGraphicsItemModeler/qetgraphicshandleritem.h
branches/0.60/sources/diagram.cpp
branches/0.60/sources/editor/elementscene.cpp
Modified: branches/0.60/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp
===================================================================
--- branches/0.60/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp 2017-10-21 12:05:57 UTC (rev 5084)
+++ branches/0.60/sources/QetGraphicsItemModeler/qetgraphicshandleritem.cpp 2017-10-23 12:53:00 UTC (rev 5085)
@@ -35,7 +35,7 @@
{
qreal rect_size = m_size * m_previous_zoom_factor;
QRectF rect(0-rect_size/2, 0-rect_size/2, rect_size, rect_size);
- rect.adjust(-2, -2, 2, 2);
+ rect.adjust(-0.1, -0.1, 0.1, 0.1);
return rect;
}
Modified: branches/0.60/sources/QetGraphicsItemModeler/qetgraphicshandleritem.h
===================================================================
--- branches/0.60/sources/QetGraphicsItemModeler/qetgraphicshandleritem.h 2017-10-21 12:05:57 UTC (rev 5084)
+++ branches/0.60/sources/QetGraphicsItemModeler/qetgraphicshandleritem.h 2017-10-23 12:53:00 UTC (rev 5085)
@@ -30,7 +30,7 @@
class QetGraphicsHandlerItem : public QGraphicsItem
{
public:
- QetGraphicsHandlerItem(qreal size = 15);
+ QetGraphicsHandlerItem(qreal size = 10);
virtual QRectF boundingRect() const;
enum { Type = UserType + 1200};
@@ -47,7 +47,7 @@
QColor m_color;
public:
- static QVector<QetGraphicsHandlerItem *> handlerForPoint(const QVector<QPointF> &points, int size = 15);
+ static QVector<QetGraphicsHandlerItem *> handlerForPoint(const QVector<QPointF> &points, int size = 10);
};
#endif // QETGRAPHICSHANDLERITEM_H
Modified: branches/0.60/sources/diagram.cpp
===================================================================
--- branches/0.60/sources/diagram.cpp 2017-10-21 12:05:57 UTC (rev 5084)
+++ branches/0.60/sources/diagram.cpp 2017-10-23 12:53:00 UTC (rev 5085)
@@ -63,6 +63,15 @@
m_freeze_new_elements (false),
m_freeze_new_conductors_ (false)
{
+
+ setItemIndexMethod(QGraphicsScene::NoIndex);
+ //Set to no index, because they can be the source of the crash with conductor and shape ghost.
+ //https://forum.qt.io/topic/71316/qgraphicsscenefinditembsptreevisitor-visit-crashes-due-to-an-obsolete-paintevent-after-qgraphicsscene-removeitem
+ //https://stackoverflow.com/questions/38458830/crash-after-qgraphicssceneremoveitem-with-custom-item-class
+ //http://www.qtcentre.org/archive/index.php/t-33730.html
+ //http://tech-artists.org/t/qt-properly-removing-qgraphicitems/3063
+
+
setProject(project);
qgi_manager_ = new QGIManager(this);
setBackgroundBrush(Qt::white);
Modified: branches/0.60/sources/editor/elementscene.cpp
===================================================================
--- branches/0.60/sources/editor/elementscene.cpp 2017-10-21 12:05:57 UTC (rev 5084)
+++ branches/0.60/sources/editor/elementscene.cpp 2017-10-23 12:53:00 UTC (rev 5085)
@@ -48,6 +48,14 @@
m_qgi_manager(this),
m_element_editor(editor)
{
+
+ setItemIndexMethod(QGraphicsScene::NoIndex);
+ //Set to no index, because they can be the source of the crash with conductor and shape ghost.
+ //https://forum.qt.io/topic/71316/qgraphicsscenefinditembsptreevisitor-visit-crashes-due-to-an-obsolete-paintevent-after-qgraphicsscene-removeitem
+ //https://stackoverflow.com/questions/38458830/crash-after-qgraphicssceneremoveitem-with-custom-item-class
+ //http://www.qtcentre.org/archive/index.php/t-33730.html
+ //http://tech-artists.org/t/qt-properly-removing-qgraphicitems/3063
+
m_behavior = Normal;
setItemIndexMethod(NoIndex);
setGrid(1, 1);