return qreal(1.7);
case StartDragVelocity:
return 0; // no limit
+ case UseRtlExtensions:
+ return QVariant(false);
}
return 0;
ShowIsFullScreen,
PasswordMaskDelay,
FontSmoothingGamma,
- StartDragVelocity
+ StartDragVelocity,
+ UseRtlExtensions
};
virtual QVariant styleHint(StyleHint hint) const;
return hint(QPlatformIntegration::FontSmoothingGamma).toReal();
}
+bool QStyleHints::useRtlExtensions() const
+{
+ return hint(QPlatformIntegration::UseRtlExtensions).toBool();
+}
+
QT_END_NAMESPACE
bool showIsFullScreen() const;
int passwordMaskDelay() const;
qreal fontSmoothingGamma() const;
+ bool useRtlExtensions() const;
private:
friend class QGuiApplication;
return d->m_systemInfo;
}
+bool QWindowsContext::useRTLExtensions() const
+{
+ return d->m_keyMapper.useRTLExtensions();
+}
+
void QWindowsContext::setWindowCreationContext(const QSharedPointer<QWindowCreationContext> &ctx)
{
d->m_creationContext = ctx;
// Returns a combination of SystemInfoFlags
unsigned systemInfo() const;
+ bool useRTLExtensions() const;
+
QWindowsMimeConverter &mimeConverter() const;
QWindowsScreenManager &screenManager();
#ifndef Q_OS_WINCE
if (const int ms = GetDoubleClickTime())
return QVariant(ms);
break;
+ case QPlatformIntegration::UseRtlExtensions:
+ return QVariant(d->m_context.useRTLExtensions());
}
return QPlatformIntegration::styleHint(hint);
}
#include "qdrawutil.h"
#include "qevent.h"
#include "qfontmetrics.h"
+#include "qstylehints.h"
#include "qmenu.h"
#include "qpainter.h"
#include "qpixmap.h"
}
}
-#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.
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);
#include "qpagedpaintdevice.h"
#include "private/qpagedpaintdevice_p.h"
#include "qtextdocumentwriter.h"
+#include "qstylehints.h"
#include "private/qtextcursor_p.h"
#include <qtextformat.h>
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)
{
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);