api: QGuiApplication::inputMethod should be static

Pretty much all methods in QGuiApplication are static.

Also adds documentation.

Change-Id: I96808dd266922432b92fe3962292e4d5b6a8ab46
Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com>
This commit is contained in:
Girish Ramakrishnan 2012-04-17 17:33:40 -07:00 committed by Qt by Nokia
parent 9ecce11261
commit 21102a71ff
2 changed files with 14 additions and 6 deletions

View File

@ -2166,12 +2166,20 @@ bool QGuiApplication::desktopSettingsAware()
return QGuiApplicationPrivate::obey_desktop_settings;
}
QInputMethod *QGuiApplication::inputMethod() const
/*!
returns the input method.
The input method returns properties about the state and position of
the virtual keyboard. It also provides information about the position of the
current focused input element.
\sa QInputPanel
*/
QInputMethod *QGuiApplication::inputMethod()
{
Q_D(const QGuiApplication);
if (!d->inputMethod)
const_cast<QGuiApplicationPrivate *>(d)->inputMethod = new QInputMethod();
return d->inputMethod;
if (!qGuiApp->d_func()->inputMethod)
qGuiApp->d_func()->inputMethod = new QInputMethod();
return qGuiApp->d_func()->inputMethod;
}
/*!

View File

@ -131,7 +131,7 @@ public:
static bool desktopSettingsAware();
QT_DEPRECATED QInputPanel *inputPanel() const;
QInputMethod *inputMethod() const;
static QInputMethod *inputMethod();
static QPlatformNativeInterface *platformNativeInterface();