diff options
author | axis <qt-info@nokia.com> | 2009-08-12 13:20:08 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-08-12 15:05:52 (GMT) |
commit | ecb4110040218fafaad8717c7c58de1086d3590d (patch) | |
tree | 3d803129114440896ef702c397342e5af77663b6 /src/gui/styles | |
parent | 9bba7e42a2988967507d536c497c54efc791eb67 (diff) | |
download | Qt-ecb4110040218fafaad8717c7c58de1086d3590d.zip Qt-ecb4110040218fafaad8717c7c58de1086d3590d.tar.gz Qt-ecb4110040218fafaad8717c7c58de1086d3590d.tar.bz2 |
Revised SIP API.
After discussions with Matthias, several things were changed:
- the autoSipOnMouseFocus property was removed and replaced with a
new style hint, SH_RequestSoftwareInputPanel. This means the style
can define when the input panel is launched.
- The code which sends RequestSoftwareInputPanel events was moved
into its own function, and the widgets call that function.
AutoTest: Included and passed
RevBy: mae
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qcommonstyle.cpp | 3 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 3 | ||||
-rw-r--r-- | src/gui/styles/qstyle.cpp | 17 | ||||
-rw-r--r-- | src/gui/styles/qstyle.h | 6 | ||||
-rw-r--r-- | src/gui/styles/qwindowscestyle.cpp | 3 | ||||
-rw-r--r-- | src/gui/styles/qwindowsmobilestyle.cpp | 3 |
6 files changed, 35 insertions, 0 deletions
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index 3420ad1..1d1144e 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -5356,6 +5356,9 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget } #endif break; + case SH_RequestSoftwareInputPanel: + ret = RSIP_OnMouseClickAndAlreadyFocused; + break; default: ret = 0; break; diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 8128482..42be962 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2312,6 +2312,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_UnderlineShortcut: retValue = 0; break; + case SH_RequestSoftwareInputPanel: + retValue = RSIP_OnMouseClickAndAlreadyFocused; + break; default: break; } diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp index 598fe6b..f930107 100644 --- a/src/gui/styles/qstyle.cpp +++ b/src/gui/styles/qstyle.cpp @@ -1586,6 +1586,20 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, */ /*! + \enum QStyle::RequestSoftwareInputPanel + + This enum describes under what circumstances a software input panel will be + requested by input capable widgets. + + \value RSIP_OnMouseClickAndAlreadyFocused Requests an input panel if the user + clicks on the widget, but only if it is already focused. + \value RSIP_OnMouseClick Requests an input panel if the user clicks on the + widget. + + \sa QEvent::RequestSoftwareInputPanel, QInputContext +*/ + +/*! \enum QStyle::StyleHint This enum describes the available style hints. A style hint is a general look @@ -1868,6 +1882,9 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, \value SH_ToolButtonStyle Determines the default system style for tool buttons that uses Qt::ToolButtonFollowStyle. + \value SH_RequestSoftwareInputPanel Determines when a software input panel should + be requested by input widgets. Returns an enum of type QStyle::RequestSoftwareInputPanel. + \omitvalue SH_UnderlineAccelerator \sa styleHint() diff --git a/src/gui/styles/qstyle.h b/src/gui/styles/qstyle.h index f22bf55..4d17934 100644 --- a/src/gui/styles/qstyle.h +++ b/src/gui/styles/qstyle.h @@ -632,6 +632,11 @@ public: virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w = 0) const = 0; + enum RequestSoftwareInputPanel { + RSIP_OnMouseClickAndAlreadyFocused, + RSIP_OnMouseClick + }; + enum StyleHint { SH_EtchDisabledText, SH_DitherDisabledText, @@ -731,6 +736,7 @@ public: SH_TabBar_CloseButtonPosition, SH_DockWidget_ButtonsHaveFrame, SH_ToolButtonStyle, + SH_RequestSoftwareInputPanel, // Add new style hint values here #ifdef QT3_SUPPORT diff --git a/src/gui/styles/qwindowscestyle.cpp b/src/gui/styles/qwindowscestyle.cpp index 997fc72..0572ba1 100644 --- a/src/gui/styles/qwindowscestyle.cpp +++ b/src/gui/styles/qwindowscestyle.cpp @@ -2291,6 +2291,9 @@ int QWindowsCEStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QW break; case SH_EtchDisabledText: ret = false; + case SH_RequestSoftwareInputPanel: + ret = RSIP_OnMouseClick; + break; default: ret = QWindowsStyle::styleHint(hint, opt, widget, returnData); break; diff --git a/src/gui/styles/qwindowsmobilestyle.cpp b/src/gui/styles/qwindowsmobilestyle.cpp index c70b4c8..18d733a 100644 --- a/src/gui/styles/qwindowsmobilestyle.cpp +++ b/src/gui/styles/qwindowsmobilestyle.cpp @@ -3404,6 +3404,9 @@ int QWindowsMobileStyle::styleHint(StyleHint hint, const QStyleOption *opt, cons case SH_MenuBar_AltKeyNavigation: ret = false; break; + case SH_RequestSoftwareInputPanel: + ret = RSIP_OnMouseClick; + break; default: ret = QWindowsStyle::styleHint(hint, opt, widget, returnData); break; |