move keyboardInputLocale and keyboardInputDirection into QGuiApplication
This commit is contained in:
parent
526bc2bf78
commit
2e9fd1325f
@ -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,
|
void QApplicationPrivate::giveFocusAccordingToFocusPolicy(QWidget *widget,
|
||||||
Qt::FocusPolicy focusPolicy,
|
Qt::FocusPolicy focusPolicy,
|
||||||
Qt::FocusReason focusReason)
|
Qt::FocusReason focusReason)
|
||||||
|
@ -281,9 +281,6 @@ public:
|
|||||||
QInputContext *inputContext() const;
|
QInputContext *inputContext() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static QLocale keyboardInputLocale();
|
|
||||||
static Qt::LayoutDirection keyboardInputDirection();
|
|
||||||
|
|
||||||
static int exec();
|
static int exec();
|
||||||
bool notify(QObject *, QEvent *);
|
bool notify(QObject *, QEvent *);
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@
|
|||||||
#include <QWindowSystemInterface>
|
#include <QWindowSystemInterface>
|
||||||
#include "private/qwindowsysteminterface_qpa_p.h"
|
#include "private/qwindowsysteminterface_qpa_p.h"
|
||||||
#include "private/qwindow_p.h"
|
#include "private/qwindow_p.h"
|
||||||
|
#include "private/qkeymapper_p.h"
|
||||||
|
|
||||||
#ifndef QT_NO_CLIPBOARD
|
#ifndef QT_NO_CLIPBOARD
|
||||||
#include <QtGui/QClipboard>
|
#include <QtGui/QClipboard>
|
||||||
@ -884,6 +885,30 @@ Qt::LayoutDirection QGuiApplication::layoutDirection()
|
|||||||
return layout_direction;
|
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
|
\since 4.5
|
||||||
\fn void QGuiApplication::fontDatabaseChanged()
|
\fn void QGuiApplication::fontDatabaseChanged()
|
||||||
|
@ -98,6 +98,9 @@ public:
|
|||||||
static inline bool isRightToLeft() { return layoutDirection() == Qt::RightToLeft; }
|
static inline bool isRightToLeft() { return layoutDirection() == Qt::RightToLeft; }
|
||||||
static inline bool isLeftToRight() { return layoutDirection() == Qt::LeftToRight; }
|
static inline bool isLeftToRight() { return layoutDirection() == Qt::LeftToRight; }
|
||||||
|
|
||||||
|
static QLocale keyboardInputLocale();
|
||||||
|
static Qt::LayoutDirection keyboardInputDirection();
|
||||||
|
|
||||||
static QPlatformNativeInterface *platformNativeInterface();
|
static QPlatformNativeInterface *platformNativeInterface();
|
||||||
|
|
||||||
static int exec();
|
static int exec();
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
#include "qstring.h"
|
#include "qstring.h"
|
||||||
#include <private/qunicodetables_p.h>
|
#include <private/qunicodetables_p.h>
|
||||||
#include "qtextdocument_p.h"
|
#include "qtextdocument_p.h"
|
||||||
#include <qapplication.h>
|
#include <qguiapplication.h>
|
||||||
#include <stdlib.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
|
// this places the cursor in the right position depending on the keyboard layout
|
||||||
if (layoutData->string.isEmpty())
|
if (layoutData->string.isEmpty())
|
||||||
return QApplication::keyboardInputDirection() == Qt::RightToLeft;
|
return QGuiApplication::keyboardInputDirection() == Qt::RightToLeft;
|
||||||
return layoutData->string.isRightToLeft();
|
return layoutData->string.isRightToLeft();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,6 @@
|
|||||||
#include "qtextengine_p.h"
|
#include "qtextengine_p.h"
|
||||||
|
|
||||||
#include <qfont.h>
|
#include <qfont.h>
|
||||||
#include <qapplication.h>
|
|
||||||
#include <qpainter.h>
|
#include <qpainter.h>
|
||||||
#include <qvarlengtharray.h>
|
#include <qvarlengtharray.h>
|
||||||
#include <qtextformat.h>
|
#include <qtextformat.h>
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "qtextoption.h"
|
#include "qtextoption.h"
|
||||||
#include "qapplication.h"
|
#include "qguiapplication.h"
|
||||||
#include "qlist.h"
|
#include "qlist.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -82,7 +82,7 @@ QTextOption::QTextOption(Qt::Alignment alignment)
|
|||||||
tab(-1),
|
tab(-1),
|
||||||
d(0)
|
d(0)
|
||||||
{
|
{
|
||||||
direction = QApplication::layoutDirection();
|
direction = QGuiApplication::layoutDirection();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
Reference in New Issue
Block a user