Propagate QTest::mouseEvent keyboard modifiers.

The QWindowSystemInterface mouse functions now have keyboard
modifiers parameter, make use of them.

Task-number: QTBUG-21743
Change-Id: I65ba1095825b81d575d314c1de2a45cef28e697a
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
This commit is contained in:
Andrew den Exter 2011-11-09 16:19:54 +10:00 committed by Qt by Nokia
parent b36e6c4319
commit 7125dd7186

View File

@ -98,24 +98,24 @@ namespace QTest
switch (action)
{
case MousePress:
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),button);
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
lastButton = button;
break;
case MouseRelease:
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton);
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
lastButton = Qt::NoButton;
break;
case MouseDClick:
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),button);
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
qWait(10);
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton);
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
qWait(20);
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),button);
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),button,stateKey);
qWait(10);
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton);
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),Qt::NoButton,stateKey);
break;
case MouseMove:
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),lastButton);
QWindowSystemInterface::handleMouseEvent(window,pos,window->mapToGlobal(pos),lastButton,stateKey);
//QCursor::setPos(window->mapToGlobal(pos));
#ifdef Q_OS_MAC
QTest::qWait(20);