move keyboardInputLocale and keyboardInputDirection into QGuiApplication

This commit is contained in:
Lars Knoll 2011-05-04 09:31:54 +02:00
parent 526bc2bf78
commit 2e9fd1325f
7 changed files with 32 additions and 32 deletions

View File

@ -5363,30 +5363,6 @@ bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event)
}
/*!
\since 4.2
Returns the current keyboard input locale.
*/
QLocale QApplication::keyboardInputLocale()
{
if (!QApplicationPrivate::checkInstance("keyboardInputLocale"))
return QLocale::c();
return qt_keymapper_private()->keyboardInputLocale;
}
/*!
\since 4.2
Returns the current keyboard input direction.
*/
Qt::LayoutDirection QApplication::keyboardInputDirection()
{
if (!QApplicationPrivate::checkInstance("keyboardInputDirection"))
return Qt::LeftToRight;
return qt_keymapper_private()->keyboardInputDirection;
}
void QApplicationPrivate::giveFocusAccordingToFocusPolicy(QWidget *widget,
Qt::FocusPolicy focusPolicy,
Qt::FocusReason focusReason)

View File

@ -281,9 +281,6 @@ public:
QInputContext *inputContext() const;
#endif
static QLocale keyboardInputLocale();
static Qt::LayoutDirection keyboardInputDirection();
static int exec();
bool notify(QObject *, QEvent *);

View File

@ -62,6 +62,7 @@
#include <QWindowSystemInterface>
#include "private/qwindowsysteminterface_qpa_p.h"
#include "private/qwindow_p.h"
#include "private/qkeymapper_p.h"
#ifndef QT_NO_CLIPBOARD
#include <QtGui/QClipboard>
@ -884,6 +885,30 @@ Qt::LayoutDirection QGuiApplication::layoutDirection()
return layout_direction;
}
/*!
\since 4.2
Returns the current keyboard input locale.
*/
QLocale QGuiApplication::keyboardInputLocale()
{
if (!QGuiApplicationPrivate::checkInstance("keyboardInputLocale"))
return QLocale::c();
return qt_keymapper_private()->keyboardInputLocale;
}
/*!
\since 4.2
Returns the current keyboard input direction.
*/
Qt::LayoutDirection QGuiApplication::keyboardInputDirection()
{
if (!QGuiApplicationPrivate::checkInstance("keyboardInputDirection"))
return Qt::LeftToRight;
return qt_keymapper_private()->keyboardInputDirection;
}
/*!
\since 4.5
\fn void QGuiApplication::fontDatabaseChanged()

View File

@ -98,6 +98,9 @@ public:
static inline bool isRightToLeft() { return layoutDirection() == Qt::RightToLeft; }
static inline bool isLeftToRight() { return layoutDirection() == Qt::LeftToRight; }
static QLocale keyboardInputLocale();
static Qt::LayoutDirection keyboardInputDirection();
static QPlatformNativeInterface *platformNativeInterface();
static int exec();

View File

@ -53,7 +53,7 @@
#include "qstring.h"
#include <private/qunicodetables_p.h>
#include "qtextdocument_p.h"
#include <qapplication.h>
#include <qguiapplication.h>
#include <stdlib.h>
@ -1567,7 +1567,7 @@ bool QTextEngine::isRightToLeft() const
}
// this places the cursor in the right position depending on the keyboard layout
if (layoutData->string.isEmpty())
return QApplication::keyboardInputDirection() == Qt::RightToLeft;
return QGuiApplication::keyboardInputDirection() == Qt::RightToLeft;
return layoutData->string.isRightToLeft();
}

View File

@ -43,7 +43,6 @@
#include "qtextengine_p.h"
#include <qfont.h>
#include <qapplication.h>
#include <qpainter.h>
#include <qvarlengtharray.h>
#include <qtextformat.h>

View File

@ -40,7 +40,7 @@
****************************************************************************/
#include "qtextoption.h"
#include "qapplication.h"
#include "qguiapplication.h"
#include "qlist.h"
QT_BEGIN_NAMESPACE
@ -82,7 +82,7 @@ QTextOption::QTextOption(Qt::Alignment alignment)
tab(-1),
d(0)
{
direction = QApplication::layoutDirection();
direction = QGuiApplication::layoutDirection();
}
/*!