summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-14 08:29:02 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-14 08:29:02 (GMT)
commit61d21436d5627dc42506bdb257e107d6a4ffd498 (patch)
tree6f78b5c3fda711921a3f164b09e7a2471623b833 /src/gui
parentb915d0aa46599f707df4db6eb33965602a2d7422 (diff)
parentd64bd955c26af3b204df567245429ddd3f32bcb8 (diff)
downloadQt-61d21436d5627dc42506bdb257e107d6a4ffd498.zip
Qt-61d21436d5627dc42506bdb257e107d6a4ffd498.tar.gz
Qt-61d21436d5627dc42506bdb257e107d6a4ffd498.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public: Update Symbian DEF files for WINSCW and EABI Fix spurious mouse click when dismissing a native menu Add 'runonphone' target for symbian / makefile Double-click support for virtual cursor in Symbian
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp22
-rw-r--r--src/gui/kernel/qt_s60_p.h2
2 files changed, 19 insertions, 5 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index f4c7304..ea5c14c 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -364,6 +364,7 @@ void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop)
SetFocusing(true);
m_longTapDetector = QLongTapTimer::NewL(this);
+ m_doubleClickTimer.invalidate();
DrawableWindow()->SetPointerGrab(ETrue);
}
@@ -642,10 +643,13 @@ TKeyResponse QSymbianControl::OfferKeyEvent(const TKeyEvent& keyEvent, TEventCod
QPoint pos = QCursor::pos();
TPointerEvent fakeEvent;
+ fakeEvent.iType = (TPointerEvent::TType)(-1);
+ fakeEvent.iModifiers = keyEvent.iModifiers;
TInt x = pos.x();
TInt y = pos.y();
if (type == EEventKeyUp) {
- if (keyCode == Qt::Key_Select)
+ if (keyCode == Qt::Key_Select &&
+ (S60->virtualMousePressedKeys & QS60Data::Select))
fakeEvent.iType = TPointerEvent::EButton1Up;
S60->virtualMouseAccel = 1;
S60->virtualMouseLastKey = 0;
@@ -668,6 +672,8 @@ TKeyResponse QSymbianControl::OfferKeyEvent(const TKeyEvent& keyEvent, TEventCod
}
}
else if (type == EEventKey) {
+ if (keyCode != Qt::Key_Select)
+ m_doubleClickTimer.invalidate();
switch (keyCode) {
case Qt::Key_Left:
S60->virtualMousePressedKeys |= QS60Data::Left;
@@ -694,12 +700,18 @@ TKeyResponse QSymbianControl::OfferKeyEvent(const TKeyEvent& keyEvent, TEventCod
// example for drag'n'drop), Symbian starts producing spurious up and
// down messages for some keys. Therefore, make sure we have a clean slate
// of pressed keys before starting a new button press.
- if (S60->virtualMousePressedKeys != 0) {
- S60->virtualMousePressedKeys |= QS60Data::Select;
+ if (S60->virtualMousePressedKeys & QS60Data::Select) {
return EKeyWasConsumed;
} else {
S60->virtualMousePressedKeys |= QS60Data::Select;
fakeEvent.iType = TPointerEvent::EButton1Down;
+ if (m_doubleClickTimer.isValid()
+ && !m_doubleClickTimer.hasExpired(QApplication::doubleClickInterval())) {
+ fakeEvent.iModifiers |= EModifierDoubleClick;
+ m_doubleClickTimer.invalidate();
+ } else {
+ m_doubleClickTimer.start();
+ }
}
break;
}
@@ -715,10 +727,10 @@ TKeyResponse QSymbianControl::OfferKeyEvent(const TKeyEvent& keyEvent, TEventCod
y = S60->screenHeightInPixels - 1;
TPoint epos(x, y);
TPoint cpos = epos - PositionRelativeToScreen();
- fakeEvent.iModifiers = keyEvent.iModifiers;
fakeEvent.iPosition = cpos;
fakeEvent.iParentPosition = epos;
- HandlePointerEvent(fakeEvent);
+ if(fakeEvent.iType != -1)
+ HandlePointerEvent(fakeEvent);
return EKeyWasConsumed;
}
else {
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 58da302..1af8eeb 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -62,6 +62,7 @@
#include "QtGui/qevent.h"
#include "qpointer.h"
#include "qapplication.h"
+#include "qelapsedtimer.h"
#include <w32std.h>
#include <coecntrl.h>
#include <eikenv.h>
@@ -222,6 +223,7 @@ private:
private:
QWidget *qwidget;
QLongTapTimer* m_longTapDetector;
+ QElapsedTimer m_doubleClickTimer;
bool m_ignoreFocusChanged : 1;
bool m_symbianPopupIsOpen : 1;