Commit c1852bbf authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE]

parents 4ba41ae3 0c99ef50
......@@ -51,7 +51,6 @@ WQtNetworkArrow::~WQtNetworkArrow()
{
m_startPort->removeArrow( this );
m_endPort->removeArrow( this );
this->hide();
}
int WQtNetworkArrow::type() const
......@@ -63,8 +62,8 @@ void WQtNetworkArrow::updatePosition()
{
QRectF sRect = m_startPort->rect();
QRectF eRect = m_startPort->rect();
QLineF tmpLine( mapFromItem( m_startPort, sRect.bottomRight()/2 ),
mapFromItem( m_endPort, eRect.bottomRight()/2 ) );
QLineF tmpLine( mapFromItem( m_startPort, sRect.bottomRight() * 0.5 ),
mapFromItem( m_endPort, eRect.bottomRight() * 0.5 ) );
QLineF line( tmpLine.x1(), tmpLine.y1()+5, tmpLine.x2(), tmpLine.y2()-5 );
setLine( line );
}
......@@ -88,6 +87,7 @@ QVariant WQtNetworkArrow::itemChange( GraphicsItemChange change,
}
return value;
}
void WQtNetworkArrow::paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* w )
{
if( isSelected() &&
......
......@@ -162,6 +162,7 @@ void WQtNetworkEditor::deleteSelectedItems()
if( it != 0 )
{
WKernel::getRunningKernel()->getRootContainer()->remove( it->getModule() );
m_scene->removeItem( it );
}
}
itemList.clear();
......@@ -389,7 +390,10 @@ bool WQtNetworkEditor::event( QEvent* event )
{
op->removeArrow( ar );
ip->removeArrow( ar );
m_scene->removeItem( ar );
if( ar->scene() != NULL )
{
m_scene->removeItem( ar );
}
delete ar;
}
else
......@@ -446,7 +450,10 @@ bool WQtNetworkEditor::event( QEvent* event )
if( item != 0 )
{
m_scene->removeItem( item );
if( item->scene() != NULL )
{
m_scene->removeItem( item );
}
m_items.removeAll( item );
delete item;
}
......@@ -504,3 +511,4 @@ void WQtNetworkEditor::timerEvent( QTimerEvent *event )
timerId = 0;
}
}
......@@ -59,3 +59,4 @@ boost::shared_ptr<WModuleInputConnector> WQtNetworkInputPort::getConnector()
{
return m_connector;
}
......@@ -41,6 +41,7 @@ public:
/**
* Constructor
*
* \param connector the related WModuleInputConnector
*/
explicit WQtNetworkInputPort( boost::shared_ptr<WModuleInputConnector> connector );
......
......@@ -82,6 +82,8 @@ WQtNetworkItem::~WQtNetworkItem()
{
delete port;
}
delete m_text;
//delete m_subtitle;
}
int WQtNetworkItem::type() const
......
......@@ -38,10 +38,12 @@ WQtNetworkPort::WQtNetworkPort()
setPen( QPen( Qt::red, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin ) );
setAcceptsHoverEvents( true );
m_line = NULL;
}
WQtNetworkPort::~WQtNetworkPort()
{
removeArrows();
}
void WQtNetworkPort::mousePressEvent( QGraphicsSceneMouseEvent *mouseEvent )
......@@ -67,7 +69,7 @@ void WQtNetworkPort::mousePressEvent( QGraphicsSceneMouseEvent *mouseEvent )
void WQtNetworkPort::mouseMoveEvent( QGraphicsSceneMouseEvent *mouseEvent )
{
if( m_line != 0 )
if( m_line )
{
QLineF newLine( m_line->line().p1(), mouseEvent->scenePos() );
......
......@@ -40,6 +40,9 @@
WQtNetworkScene::WQtNetworkScene()
: QGraphicsScene()
{
setItemIndexMethod( NoIndex );
// this takes care of the segfault: QGraphicsSceneFindItemBspTreeVisitor::visit
// seems to be a Qt bug, testet with qt4 4.7.0
}
WQtNetworkScene::~WQtNetworkScene()
......@@ -66,3 +69,4 @@ QGraphicsItem* WQtNetworkScene::getFakeItem()
{
return m_fakeItem;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment