Commit 84ac70ac authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[ADD] - double click into the empty space of the network editor now opens the load dialog

parent 0f1c869a
......@@ -71,6 +71,7 @@ WQtNetworkEditor::WQtNetworkEditor( WMainWindow* parent )
this->setFeatures( QDockWidget::DockWidgetClosable |QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable );
setWidget( m_view );
connect( m_scene, SIGNAL( selectionChanged() ), this, SLOT( selectItem() ) );
connect( m_view, SIGNAL( loadAction() ), m_mainWindow, SLOT( openLoadDialog() ) );
m_layout = new WNetworkLayout();
......@@ -489,3 +490,4 @@ WQtNetworkScene* WQtNetworkEditor::getScene()
{
return m_scene;
}
......@@ -65,6 +65,18 @@ void WQtNetworkEditorView::leaveEvent( QEvent* event )
QGraphicsView::leaveEvent( event );
}
void WQtNetworkEditorView::mouseDoubleClickEvent( QMouseEvent* event )
{
// only apply if no item is hit
if( items( event->pos() ).size() != 0 )
{
QGraphicsView::mouseDoubleClickEvent( event );
return;
}
emit loadAction();
}
void WQtNetworkEditorView::mousePressEvent( QMouseEvent* event )
{
// only pan if no element is hit
......
......@@ -42,6 +42,12 @@ public:
*/
explicit WQtNetworkEditorView( QWidget* parent = NULL );
signals:
/**
* Emitted whenever the user caused a load event.
*/
void loadAction();
protected:
/**
* Sets the current centerpoint. Also updates the scene's center point.
......@@ -61,6 +67,13 @@ protected:
*/
QPointF getCenter();
/**
* Double clicked into the view
*
* \param event contains event information.
*/
virtual void mouseDoubleClickEvent( QMouseEvent* event );
/**
* Mouse button pressed.
*
......
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