summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-06-29 12:38:53 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-11 14:52:17 +0200
commite8aa56b74b1a63a185ef71b9818ba8b0f9fe9040 (patch)
tree50a71ef0a0dc9e6ca15816995a77bf2cba818147 /src/widgets
parentcf2b5a7722e2d919f57f7094124dbcf52ae79b68 (diff)
Add stylehint to use querying RTL keyboard support.
Change-Id: Ic58ed7cb64cc7fe60b4d431e9f29e389c62265fc Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/widgets/qlineedit.cpp11
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp13
2 files changed, 4 insertions, 20 deletions
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index fc37501ba3..590a006bad 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 3448bf8228..b21d7b837e 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);