summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-04-07 14:26:37 (GMT)
committeraxis <qt-info@nokia.com>2009-05-04 13:22:21 (GMT)
commit8d08c42c6a5478e8890d59f58483f4eff3d286ca (patch)
tree6ca7be5a50290b8c9161f1bf37ab82847cba2725
parent9e838079f5f8d62aebb542f2415cd77ef9d71df2 (diff)
downloadQt-8d08c42c6a5478e8890d59f58483f4eff3d286ca.zip
Qt-8d08c42c6a5478e8890d59f58483f4eff3d286ca.tar.gz
Qt-8d08c42c6a5478e8890d59f58483f4eff3d286ca.tar.bz2
Added QApplication::autoSipOnMouseFocus.
RevBy: denis
-rw-r--r--src/gui/kernel/qapplication.cpp33
-rw-r--r--src/gui/kernel/qapplication.h5
-rw-r--r--src/gui/kernel/qapplication_p.h1
3 files changed, 39 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 6f0a4e6..28e152a 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -449,6 +449,7 @@ bool QApplicationPrivate::animate_tooltip = false;
bool QApplicationPrivate::fade_tooltip = false;
bool QApplicationPrivate::animate_toolbox = false;
bool QApplicationPrivate::widgetCount = false;
+bool QApplicationPrivate::auto_sip_on_mouse_focus = false;
QString* QApplicationPrivate::styleOverride = 0;
#if defined(Q_WS_WIN) && !defined(Q_OS_WINCE)
bool QApplicationPrivate::inSizeMove = false;
@@ -1080,6 +1081,7 @@ QApplication::~QApplication()
QApplicationPrivate::animate_tooltip = false;
QApplicationPrivate::fade_tooltip = false;
QApplicationPrivate::widgetCount = false;
+ QApplicationPrivate::auto_sip_on_mouse_focus = false;
// trigger unregistering of QVariant's GUI types
extern int qUnregisterGuiVariant();
@@ -3447,6 +3449,37 @@ Qt::LayoutDirection QApplication::layoutDirection()
return layout_direction;
}
+/*!
+ \property autoSipOnMouseFocus
+
+ This property holds whether widgets should request a software input
+ panel when it is focused with the mouse. This is typically used to
+ launch a virtual keyboard on devices which have very few or no keys.
+
+ If the property is set to true, the widget asks for an input panel
+ on the mouse click which causes the widget to be focused. If the
+ property is set to false, the user must click a second time before
+ the widget asks for an input panel.
+
+ \note If the widget is focused by other means than a mouse click,
+ the next click is will trigger an input panel request,
+ regardless of the value of this property.
+
+ The default is platform dependent.
+
+ \sa QEvent::RequestSoftwareInputPanel, QInputContext
+*/
+
+void QApplication::setAutoSipOnMouseFocus(bool enable)
+{
+ QApplicationPrivate::auto_sip_on_mouse_focus = enable;
+}
+
+bool QApplication::autoSipOnMouseFocus()
+{
+ return QApplicationPrivate::auto_sip_on_mouse_focus;
+}
+
/*!
\obsolete
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index 807d347..64b33bf 100644
--- a/src/gui/kernel/qapplication.h
+++ b/src/gui/kernel/qapplication.h
@@ -96,6 +96,8 @@ class Q_GUI_EXPORT QApplication : public QCoreApplication
Q_PROPERTY(int cursorFlashTime READ cursorFlashTime WRITE setCursorFlashTime)
Q_PROPERTY(int doubleClickInterval READ doubleClickInterval WRITE setDoubleClickInterval)
Q_PROPERTY(int keyboardInputInterval READ keyboardInputInterval WRITE setKeyboardInputInterval)
+ Q_PROPERTY(bool autoSipOnMouseFocus READ autoSipOnMouseFocus
+ WRITE setAutoSipOnMouseFocus)
#ifndef QT_NO_WHEELEVENT
Q_PROPERTY(int wheelScrollLines READ wheelScrollLines WRITE setWheelScrollLines)
#endif
@@ -198,6 +200,9 @@ public:
static void setKeyboardInputInterval(int);
static int keyboardInputInterval();
+ static void setAutoSipOnMouseFocus(bool);
+ static bool autoSipOnMouseFocus();
+
#ifndef QT_NO_WHEELEVENT
static void setWheelScrollLines(int);
static int wheelScrollLines();
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index 553efbe..bfc5652 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -354,6 +354,7 @@ public:
static bool fade_tooltip;
static bool animate_toolbox;
static bool widgetCount; // Coupled with -widgetcount switch
+ static bool auto_sip_on_mouse_focus;
#ifdef Q_WS_MAC
static bool native_modal_dialog_active;
#endif