diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/gui/kernel/qplatformintegration.cpp | 2 | ||||
| -rw-r--r-- | src/gui/kernel/qplatformintegration.h | 3 | ||||
| -rw-r--r-- | src/gui/kernel/qstylehints.cpp | 5 | ||||
| -rw-r--r-- | src/gui/kernel/qstylehints.h | 1 | ||||
| -rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.cpp | 5 | ||||
| -rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.h | 2 | ||||
| -rw-r--r-- | src/plugins/platforms/windows/qwindowsintegration.cpp | 2 | ||||
| -rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 11 | ||||
| -rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 13 |
9 files changed, 23 insertions, 21 deletions
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 3021f6373e2..d9e9c75920e 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -298,6 +298,8 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const return qreal(1.7); case StartDragVelocity: return 0; // no limit + case UseRtlExtensions: + return QVariant(false); } return 0; diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h index ea13a25bab0..8ed48b268a2 100644 --- a/src/gui/kernel/qplatformintegration.h +++ b/src/gui/kernel/qplatformintegration.h @@ -133,7 +133,8 @@ public: ShowIsFullScreen, PasswordMaskDelay, FontSmoothingGamma, - StartDragVelocity + StartDragVelocity, + UseRtlExtensions }; virtual QVariant styleHint(StyleHint hint) const; diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index 194b5d3f71a..99e37e4a418 100644 --- a/src/gui/kernel/qstylehints.cpp +++ b/src/gui/kernel/qstylehints.cpp @@ -112,4 +112,9 @@ qreal QStyleHints::fontSmoothingGamma() const return hint(QPlatformIntegration::FontSmoothingGamma).toReal(); } +bool QStyleHints::useRtlExtensions() const +{ + return hint(QPlatformIntegration::UseRtlExtensions).toBool(); +} + QT_END_NAMESPACE diff --git a/src/gui/kernel/qstylehints.h b/src/gui/kernel/qstylehints.h index f15679b7d64..a82af89789f 100644 --- a/src/gui/kernel/qstylehints.h +++ b/src/gui/kernel/qstylehints.h @@ -65,6 +65,7 @@ public: bool showIsFullScreen() const; int passwordMaskDelay() const; qreal fontSmoothingGamma() const; + bool useRtlExtensions() const; private: friend class QGuiApplication; diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index a988aef5890..7da9ae14947 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -335,6 +335,11 @@ unsigned QWindowsContext::systemInfo() const return d->m_systemInfo; } +bool QWindowsContext::useRTLExtensions() const +{ + return d->m_keyMapper.useRTLExtensions(); +} + void QWindowsContext::setWindowCreationContext(const QSharedPointer<QWindowCreationContext> &ctx) { d->m_creationContext = ctx; diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h index e95ea7f3f44..0b18196abe6 100644 --- a/src/plugins/platforms/windows/qwindowscontext.h +++ b/src/plugins/platforms/windows/qwindowscontext.h @@ -172,6 +172,8 @@ public: // Returns a combination of SystemInfoFlags unsigned systemInfo() const; + bool useRTLExtensions() const; + QWindowsMimeConverter &mimeConverter() const; QWindowsScreenManager &screenManager(); #ifndef Q_OS_WINCE diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index fea7fec1af1..55662e1fe2a 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -408,6 +408,8 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co if (const int ms = GetDoubleClickTime()) return QVariant(ms); break; + case QPlatformIntegration::UseRtlExtensions: + return QVariant(d->m_context.useRTLExtensions()); } return QPlatformIntegration::styleHint(hint); } diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index fc37501ba31..590a006badb 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -50,6 +50,7 @@ #include "qdrawutil.h" #include "qevent.h" #include "qfontmetrics.h" +#include "qstylehints.h" #include "qmenu.h" #include "qpainter.h" #include "qpixmap.h" @@ -1992,10 +1993,6 @@ void QLineEdit::contextMenuEvent(QContextMenuEvent *event) } } -#if defined(Q_WS_WIN) || defined(Q_WS_X11) - extern bool qt_use_rtl_extensions; -#endif - /*! This function creates the standard context menu which is shown when the user clicks on the line edit with the right mouse button. It is called from the default contextMenuEvent() handler. @@ -2055,11 +2052,7 @@ QMenu *QLineEdit::createStandardContextMenu() d->selectAllAction = action; connect(action, SIGNAL(triggered()), SLOT(selectAll())); -#if defined(Q_WS_WIN) || defined(Q_WS_X11) - if (!d->control->isReadOnly() && qt_use_rtl_extensions) { -#else - if (!d->control->isReadOnly()) { -#endif + if (!d->control->isReadOnly() && qApp->styleHints()->useRtlExtensions()) { popup->addSeparator(); QUnicodeControlCharacterMenu *ctrlCharacterMenu = new QUnicodeControlCharacterMenu(this, popup); popup->addMenu(ctrlCharacterMenu); diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 3448bf82280..b21d7b837e3 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -64,6 +64,7 @@ #include "qpagedpaintdevice.h" #include "private/qpagedpaintdevice_p.h" #include "qtextdocumentwriter.h" +#include "qstylehints.h" #include "private/qtextcursor_p.h" #include <qtextformat.h> @@ -95,12 +96,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_CONTEXTMENU -#if defined(Q_WS_WIN) || defined(Q_WS_X11) -extern bool qt_use_rtl_extensions; -#endif -#endif - // could go into QTextCursor... static QTextLine currentTextLine(const QTextCursor &cursor) { @@ -2181,11 +2176,7 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget a->setEnabled(!d->doc->isEmpty()); } -#if defined(Q_WS_WIN) || defined(Q_WS_X11) - if ((d->interactionFlags & Qt::TextEditable) && qt_use_rtl_extensions) { -#else - if (d->interactionFlags & Qt::TextEditable) { -#endif + if ((d->interactionFlags & Qt::TextEditable) && qApp->styleHints()->useRtlExtensions()) { menu->addSeparator(); QUnicodeControlCharacterMenu *ctrlCharacterMenu = new QUnicodeControlCharacterMenu(this, menu); menu->addMenu(ctrlCharacterMenu); |
