forked from qt-creator/qt-creator
Make the html5applicationviewer class much less cluttered by splitting out all the touch navigation classes into separate files in a subdirectory. This should make it much more maintainable.
54 lines
2.0 KiB
C++
54 lines
2.0 KiB
C++
/*
|
|
This file was generated by the Html5 Application wizard of Qt Creator.
|
|
Html5ApplicationViewer is a convenience class containing mobile device specific
|
|
code such as screen orientation handling.
|
|
It is recommended not to modify this file, since newer versions of Qt Creator
|
|
may offer an updated version of it.
|
|
*/
|
|
|
|
#include "webtouchevent.h"
|
|
|
|
WebTouchEvent::WebTouchEvent()
|
|
: m_type(QEvent::None)
|
|
, m_button(Qt::NoButton)
|
|
, m_buttons(Qt::NoButton)
|
|
, m_graphicsSceneEvent(false)
|
|
, m_fired(false)
|
|
, m_editable(false)
|
|
, m_modifier(Qt::NoModifier)
|
|
{}
|
|
|
|
WebTouchEvent::WebTouchEvent(const QMouseEvent *mouseEvent)
|
|
{
|
|
Q_ASSERT(mouseEvent != 0);
|
|
m_type = mouseEvent->type();
|
|
m_pos = mouseEvent->pos();
|
|
m_button = mouseEvent->button();
|
|
m_buttons = mouseEvent->buttons();
|
|
m_modifier = mouseEvent->modifiers();
|
|
m_fired = false;
|
|
m_editable = false;
|
|
m_graphicsSceneEvent = false;
|
|
}
|
|
|
|
WebTouchEvent::WebTouchEvent(const QGraphicsSceneMouseEvent *graphicsSceneMouseEvent)
|
|
{
|
|
Q_ASSERT(graphicsSceneMouseEvent != 0);
|
|
m_type = graphicsSceneMouseEvent->type();
|
|
m_pos = graphicsSceneMouseEvent->pos().toPoint();
|
|
m_button = graphicsSceneMouseEvent->button();
|
|
m_buttons = graphicsSceneMouseEvent->buttons();
|
|
m_modifier = graphicsSceneMouseEvent->modifiers();
|
|
m_scenePos = graphicsSceneMouseEvent->scenePos();
|
|
m_screenPos = graphicsSceneMouseEvent->screenPos();
|
|
m_buttonDownPos = graphicsSceneMouseEvent->buttonDownPos(graphicsSceneMouseEvent->button());
|
|
m_buttonDownScenePos = graphicsSceneMouseEvent->buttonDownScenePos(graphicsSceneMouseEvent->button());
|
|
m_buttonDownScreenPos = graphicsSceneMouseEvent->buttonDownScreenPos(graphicsSceneMouseEvent->button());
|
|
m_lastPos = graphicsSceneMouseEvent->lastPos();
|
|
m_lastScenePos = graphicsSceneMouseEvent->lastScenePos();
|
|
m_lastScreenPos = graphicsSceneMouseEvent->lastScreenPos();
|
|
m_fired = false;
|
|
m_editable = false;
|
|
m_graphicsSceneEvent = true;
|
|
}
|