Ejemplo n.º 1
0
void AnalogPad::mouseReleaseEvent(QMouseEvent *)
{
    // Return if mouse was not pressed inside the pad area
    if(!m_MouseDown) return;

    m_MouseDown = false;
    m_LimitReached = false;
    
    if (m_MouseClick)
    {
        emit padClicked();
        startClickAnimation();
    }
    m_MouseClick = false;
    emitValueChanged();
}
Ejemplo n.º 2
0
bool Button::onTouch(TouchEvent &event) {
	if (!clickable || !visible) {
		return false;
	}
	
	switch (event.type) {
	case touchDown:
		if (!isClickAnimation() && isBound(event.x, event.y)) {
			startClickAnimation();
			if (listener) {
				listener->onButtonTouchStart(this);
			}
			return true;
		}
		break;
	}
	return isClickAnimation();
}