Skip to content
Snippets Groups Projects
Commit 066f9881 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

added signal mouseReleased. it is emitted when the nibble is released.

parent cda6e922
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,7 @@ namespace armarx
void JoystickControlWidgetQGraphicsView::mouseReleaseEvent(QMouseEvent*)
{
emit positionChanged({0,0});
emit released();
}
JoystickControlWidget::JoystickControlWidget(bool useQuadrant3and4, QWidget *parent) :
......@@ -95,6 +96,7 @@ namespace armarx
//connect
connect(viewPtr.get(), SIGNAL(positionChanged(QPointF)), this, SLOT(setNibble(QPointF)));
connect(viewPtr.get(), SIGNAL(released()), this, SLOT(mouseReleased()));
//set gui
std::unique_ptr<QVBoxLayout> layout{new QVBoxLayout{}};
......@@ -135,6 +137,12 @@ namespace armarx
}
}
void JoystickControlWidget::mouseReleased()
{
setNibble({0,0});
emit released();
}
void JoystickControlWidget::setNibble(QPointF pos)
{
if(onlyQuadrant2and1 && (pos.y()>0))
......
......@@ -75,6 +75,11 @@ namespace armarx
* On mouse release (0;0) is send.
*/
void positionChanged(QPointF);
/**
* @brief Emitted when the mouse was released.
*/
void released();
};//JoystickControlWidgetQGraphicsView
/**
......@@ -158,6 +163,11 @@ namespace armarx
*/
void rotationChanged(double);
/**
* @brief Emitted when the nibble was released.
*/
void released();
protected:
virtual void resizeEvent(QResizeEvent * event);
......@@ -168,6 +178,12 @@ namespace armarx
*/
void setNibble(QPointF pos);
/**
* @brief Called when the nibble is released.
* Emits released() and sets the Position to 0.
*/
void mouseReleased();
private:
/**
* @brief The view containing the scene.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment