summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShane Kearns <shane.kearns@sosco.com>2009-09-17 07:45:52 (GMT)
committerShane Kearns <shane.kearns@sosco.com>2009-09-17 12:32:48 (GMT)
commit00d172411920920fa3cb120506a898889e724148 (patch)
treec190002f5907d9a6ecab6ce7596431d722ac1226 /src
parent992f1b36dc7c246bb978c9c60b11369e3d1cce9d (diff)
downloadQt-00d172411920920fa3cb120506a898889e724148.zip
Qt-00d172411920920fa3cb120506a898889e724148.tar.gz
Qt-00d172411920920fa3cb120506a898889e724148.tar.bz2
Enable compiling Symbian port with QT_NO_CURSOR
Added some missing #ifdef QT_NO_CURSOR, so the symbian port still compiles if this feature is configured out. Reviewed-by: Jason Barron
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp10
-rw-r--r--src/gui/kernel/qcursor_s60.cpp4
-rw-r--r--src/gui/kernel/qdnd_s60.cpp10
-rw-r--r--src/gui/kernel/qt_s60_p.h2
-rw-r--r--src/gui/kernel/qwidget_s60.cpp3
5 files changed, 24 insertions, 5 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index fd889fc..c7cba2b 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -439,7 +439,7 @@ void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent)
}
}
S60->lastCursorPos = globalPos;
-#ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS
+#if !defined(QT_NO_CURSOR) && !defined(Q_SYMBIAN_FIXED_POINTER_CURSORS)
if (S60->brokenPointerCursors)
qt_symbian_move_cursor_sprite();
#endif
@@ -888,6 +888,7 @@ void qt_init(QApplicationPrivate * /* priv */, int)
QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadDirectional;
}
+#ifndef QT_NO_CURSOR
//Check if window server pointer cursors are supported or not
#ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS
//In generic binary, use the HAL and OS version
@@ -912,6 +913,7 @@ void qt_init(QApplicationPrivate * /* priv */, int)
#endif
S60->wsSession().SetPointerCursorMode(EPointerCursorNormal);
}
+#endif
/*
### Commented out for now as parameter handling not needed in SOS(yet). Code below will break testlib with -o flag
@@ -1275,7 +1277,7 @@ int QApplication::s60ProcessEvent(TWsEvent *event)
}
break;
case EEventFocusGained:
- RDebug::Printf("focus gained %x", control);
+#ifndef QT_NO_CURSOR
//re-enable mouse interaction
if (S60->mouseInteractionEnabled) {
#ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS
@@ -1285,9 +1287,10 @@ int QApplication::s60ProcessEvent(TWsEvent *event)
#endif
S60->wsSession().SetPointerCursorMode(EPointerCursorNormal);
}
+#endif
break;
case EEventFocusLost:
- RDebug::Printf("focus lost %x", control);
+#ifndef QT_NO_CURSOR
//disable mouse as may be moving to application that does not support it
if (S60->mouseInteractionEnabled) {
#ifndef Q_SYMBIAN_FIXED_POINTER_CURSORS
@@ -1297,6 +1300,7 @@ int QApplication::s60ProcessEvent(TWsEvent *event)
#endif
S60->wsSession().SetPointerCursorMode(EPointerCursorNone);
}
+#endif
break;
default:
break;
diff --git a/src/gui/kernel/qcursor_s60.cpp b/src/gui/kernel/qcursor_s60.cpp
index 757eaa8..b50eb71 100644
--- a/src/gui/kernel/qcursor_s60.cpp
+++ b/src/gui/kernel/qcursor_s60.cpp
@@ -52,8 +52,10 @@
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_CURSOR
static QCursor cursorSprite;
-static int cursorSpriteVisible;
+static int cursorSpriteVisible;
+#endif
//pos and setpos are required whether cursors are configured or not.
QPoint QCursor::pos()
diff --git a/src/gui/kernel/qdnd_s60.cpp b/src/gui/kernel/qdnd_s60.cpp
index 2456185..3d6ecd2 100644
--- a/src/gui/kernel/qdnd_s60.cpp
+++ b/src/gui/kernel/qdnd_s60.cpp
@@ -214,11 +214,13 @@ bool QDragManager::eventFilter(QObject *o, QEvent *e)
case QEvent::MouseButtonRelease:
{
qApp->removeEventFilter(this);
+#ifndef QT_NO_CURSOR
if (restoreCursor) {
QApplication::restoreOverrideCursor();
willDrop = false;
restoreCursor = false;
}
+#endif
if (object && object->target()) {
QMouseEvent *me = (QMouseEvent *)e;
@@ -267,7 +269,9 @@ Qt::DropAction QDragManager::drag(QDrag *o)
updatePixmap();
updateCursor();
+#ifndef QT_NO_CURSOR
qt_symbian_set_cursor_visible(true); //force cursor on even for touch phone
+#endif
object->d_func()->target = 0;
@@ -282,10 +286,12 @@ Qt::DropAction QDragManager::drag(QDrag *o)
delete eventLoop;
eventLoop = 0;
+#ifndef QT_NO_CURSOR
qt_symbian_set_cursor_visible(false);
overrideCursor = QCursor(); //deref the cursor data
qt_symbian_dnd_dragging = false;
+#endif
return global_accepted_action;
}
@@ -306,10 +312,12 @@ void QDragManager::cancel(bool deleteSource)
drag_object = object = 0;
}
+#ifndef QT_NO_CURSOR
if (restoreCursor) {
QApplication::restoreOverrideCursor();
restoreCursor = false;
}
+#endif
global_accepted_action = Qt::IgnoreAction;
}
@@ -317,10 +325,12 @@ void QDragManager::cancel(bool deleteSource)
void QDragManager::drop()
{
+#ifndef QT_NO_CURSOR
if (restoreCursor) {
QApplication::restoreOverrideCursor();
restoreCursor = false;
}
+#endif
}
QVariant QDropData::retrieveData_sys(const QString &mimetype, QVariant::Type type) const
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 794d15a..67084c4 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -304,11 +304,13 @@ static inline QImage::Format qt_TDisplayMode2Format(TDisplayMode mode)
return format;
}
+#ifndef QT_NO_CURSOR
void qt_symbian_setWindowCursor(const QCursor &cursor, const CCoeControl* wid);
void qt_symbian_setWindowGroupCursor(const QCursor &cursor, RWindowTreeNode &node);
void qt_symbian_setGlobalCursor(const QCursor &cursor);
void qt_symbian_set_cursor_visible(bool visible);
bool qt_symbian_is_cursor_visible();
+#endif
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 522ce33..3744377 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1222,8 +1222,9 @@ void QWidget::releaseMouse()
WId id = effectiveWinId();
id->SetPointerCapture(false);
QWidgetPrivate::mouseGrabber = 0;
-
+#ifndef QT_NO_CURSOR
QApplication::restoreOverrideCursor();
+#endif
}
}