diff options
author | Shane Kearns <shane.kearns@sosco.com> | 2009-09-15 12:12:08 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@sosco.com> | 2009-09-15 14:05:53 (GMT) |
commit | 56cec4cf9a8b04c979ced28cab89ce6232d4184a (patch) | |
tree | a9701f13161810d1e9bfbf7ef9cd8430a77580be /src/gui/kernel/qapplication.cpp | |
parent | f42f5c457b3368adb4c92e521dc56969f138bdd3 (diff) | |
download | Qt-56cec4cf9a8b04c979ced28cab89ce6232d4184a.zip Qt-56cec4cf9a8b04c979ced28cab89ce6232d4184a.tar.gz Qt-56cec4cf9a8b04c979ced28cab89ce6232d4184a.tar.bz2 |
QCursor support for Symbian OS
Reviewed-By: Jason Barron
Reviewed-By: Alessandro Portale
Summary:
QT_NO_CURSOR is now not defined for symbian builds
Existing QCursor APIs are all supported
New public API, QApplication::setNavigationMode, to allow the navigation
mode to be set. I.E. on an S60 3.2 phone, some applications will want a
virtual mouse cursor (web browser), while others are designed for keypad
navigation.
Symbian HAL is used for detecting input capabilities.
Fix DND, code cleanup & comment
QCursor visibility now uses a refcount, and is called from DND and the
setNavigationMode so they are both simpler and don't interfere with each
other.
QApplication::setNavigationMode
New public API for configuring cursor/keypad navi style.
This links in with ongoing work on the 4-way keypad navi branch, but
2-way and 4-way modes both act as 2-way mode until that is integrated
Some of the demos/examples have cursor switched on (those that were not
usable with keypad)
Virtual mouse support for non touch, non mouse phones (tested on N78)
add *.d and .metadata (carbide debug file / workspace dir) to .gitignore
System pointers are unavailable when using sprite workaround, so the
system cursor shapes are compiled into qtgui as resources.
MAC port does this also for shapes that aren't standard on the MAC.
Refactor Drag'n'Drop to use QCursor
Add test case to check all system cursor shapes
Simply a mainwindow containing a label widget for each cursor shape,
with the cursor property set appropriately
QCursor(QBitmap,QBitmap) supported
Fixed problem with the image & mask being inverted when using the
QCursor constructor that takes two mono bitmaps.
add .make.cache files to .gitignore
Correct implementation of QApplication::setOverrideCursor
QApplication::restoreOverrideCursor and QApplication::setOverrideCursor
are now working correctly on Symbian platform.
Performance will be slower compared with other platforms, because the
Symbian window server has a cursor associated with each native window.
Add test case for custom cursors
Create a pixmap cursor and associate it with a widget.
No changes to production code, since test passed 1st time ;)
Add manual test for QCursor
Make cursor independent of construction order
Updated to work around window server issue where contruction order
affects what cursor is displayed in child windows.
Also changed to effectiveWinId following review comments
Also fixed a problem which would make qcursor not link if configured
with QT_NO_CURSOR
Moved some multiply declared extern functions from cpp to _p.h files
Implemented Symbian versions of the cursor functions.
Merged in work I'd done based on tower.
Fill in bits of stub functions based on windows port
Removed QT_NO_CURSOR from list of config options forced on symbian
Recompiled configure.exe
Added stub functions for the missing functions in s60 port
Diffstat (limited to 'src/gui/kernel/qapplication.cpp')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 90 |
1 files changed, 75 insertions, 15 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index a19e022..1fd2d39 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -458,10 +458,10 @@ bool QApplicationPrivate::widgetCount = false; bool QApplicationPrivate::inSizeMove = false; #endif #ifdef QT_KEYPAD_NAVIGATION -# if defined(Q_OS_SYMBIAN) -bool QApplicationPrivate::keypadNavigation = true; +# ifdef Q_OS_SYMBIAN +Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadDirectional; # else -bool QApplicationPrivate::keypadNavigation = false; +Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadTabOrder; # endif QWidget *QApplicationPrivate::oldEditFocus = 0; #endif @@ -2521,12 +2521,6 @@ QWidget *QApplicationPrivate::focusNextPrevChild_helper(QWidget *toplevel, bool Creates the proper Enter/Leave event when widget \a enter is entered and widget \a leave is left. */ -#if defined(Q_WS_WIN) - extern void qt_win_set_cursor(QWidget *, bool); -#elif defined(Q_WS_X11) - extern void qt_x11_enforce_cursor(QWidget *, bool); -#endif - void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) { #if 0 if (leave) { @@ -2676,6 +2670,8 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) { qt_win_set_cursor(cursorWidget, true); #elif defined(Q_WS_X11) qt_x11_enforce_cursor(cursorWidget, true); +#elif defined(Q_WS_S60) + qt_symbian_set_cursor(cursorWidget, true); #endif } } @@ -4777,10 +4773,36 @@ void QApplicationPrivate::emitLastWindowClosed() #ifdef QT_KEYPAD_NAVIGATION /*! - Sets whether Qt should use focus navigation suitable for use with a - minimal keypad. + Sets what kind of focus navigation Qt should use. + + This feature is available in Qt for Embedded Linux, Symbian and Windows CE + only. + + \note On Windows CE this feature is disabled by default for touch device + mkspecs. To enable keypad navigation, build Qt with + QT_KEYPAD_NAVIGATION defined. + + \note On Symbian, setting the mode to Qt::NavigationModeCursorAuto will enable a + virtual mouse cursor on non touchscreen devices, which is controlled + by the cursor keys if there is no analog pointer device. + On other platforms and on touchscreen devices, it has the same + meaning as Qt::NavigationModeNone. + + \since 4.6 + + \sa keypadNavigationEnabled() +*/ +void QApplication::setNavigationMode(Qt::NavigationMode mode) +{ +#ifdef Q_OS_SYMBIAN + QApplicationPrivate::setNavigationMode(mode); +#else + QApplicationPrivate::navigationMode = mode; +#endif +} - If \a enable is true, Qt::Key_Up and Qt::Key_Down are used to change focus. +/*! + Returns what kind of focus navigation Qt is using. This feature is available in Qt for Embedded Linux, Symbian and Windows CE only. @@ -4788,12 +4810,47 @@ void QApplicationPrivate::emitLastWindowClosed() \note On Windows CE this feature is disabled by default for touch device mkspecs. To enable keypad navigation, build Qt with QT_KEYPAD_NAVIGATION defined. + + \note On Symbian, the default mode is Qt::NavigationModeNone for touch + devices, and Qt::NavigationModeKeypadDirectional. + + \since 4.6 \sa keypadNavigationEnabled() */ +Qt::NavigationMode QApplication::navigationMode() +{ + return QApplicationPrivate::navigationMode; +} + +/*! + Sets whether Qt should use focus navigation suitable for use with a + minimal keypad. + + This feature is available in Qt for Embedded Linux, Symbian and Windows CE + only. + + + \note On Windows CE this feature is disabled by default for touch device + mkspecs. To enable keypad navigation, build Qt with + QT_KEYPAD_NAVIGATION defined. + + \deprecated + + \sa setNavigationMode() +*/ void QApplication::setKeypadNavigationEnabled(bool enable) { - QApplicationPrivate::keypadNavigation = enable; + if (enable) { +#ifdef Q_OS_SYMBIAN + QApplication::setNavigationMode(Qt::NavigationModeKeypadDirectional); +#else + QApplication::setNavigationMode(Qt::NavigationModeKeypadTabOrder); +#endif + } + else { + QApplication::setNavigationMode(Qt::NavigationModeNone); + } } /*! @@ -4806,12 +4863,15 @@ void QApplication::setKeypadNavigationEnabled(bool enable) \note On Windows CE this feature is disabled by default for touch device mkspecs. To enable keypad navigation, build Qt with QT_KEYPAD_NAVIGATION defined. + + \deprecated - \sa setKeypadNavigationEnabled() + \sa navigationMode() */ bool QApplication::keypadNavigationEnabled() { - return QApplicationPrivate::keypadNavigation; + return QApplicationPrivate::navigationMode == Qt::NavigationModeKeypadTabOrder || + QApplicationPrivate::navigationMode == Qt::NavigationModeKeypadDirectional; } #endif |