summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/qaccessible_win.cpp113
-rw-r--r--src/gui/dialogs/qfiledialog_symbian.cpp6
-rw-r--r--src/gui/dialogs/qfiledialog_win_p.h2
-rw-r--r--src/gui/egl/qegl.cpp21
-rw-r--r--src/gui/egl/qeglcontext_p.h1
-rw-r--r--src/gui/embedded/qscreen_qws.cpp1
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp34
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm26
-rw-r--r--src/gui/kernel/qcursor_win.cpp1
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp18
-rw-r--r--src/gui/kernel/qsoftkeymanager_common_p.h2
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp4
-rw-r--r--src/gui/kernel/qt_s60_p.h2
-rw-r--r--src/gui/kernel/qwidget_s60.cpp2
-rw-r--r--src/gui/painting/qpainter.cpp17
-rw-r--r--src/gui/styles/qmacstyle_mac.mm2
-rw-r--r--src/gui/text/qfont.cpp5
-rw-r--r--src/gui/text/qfontdatabase.cpp10
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp2
-rw-r--r--src/gui/text/qfontmetrics.cpp3
-rw-r--r--src/gui/text/qglyphrun.cpp3
-rw-r--r--src/gui/text/qplatformfontdatabase_qpa.cpp28
-rw-r--r--src/gui/text/qrawfont.cpp3
-rw-r--r--src/gui/text/qtextcontrol.cpp8
-rw-r--r--src/gui/text/qtextdocument_p.cpp1
-rw-r--r--src/gui/text/qtextengine.cpp44
-rw-r--r--src/gui/widgets/qlinecontrol.cpp10
28 files changed, 252 insertions, 119 deletions
diff --git a/src/gui/accessible/qaccessible_win.cpp b/src/gui/accessible/qaccessible_win.cpp
index 79ac442..caabae5 100644
--- a/src/gui/accessible/qaccessible_win.cpp
+++ b/src/gui/accessible/qaccessible_win.cpp
@@ -600,6 +600,35 @@ HRESULT STDMETHODCALLTYPE QWindowsEnumerate::Skip(unsigned long celt)
return S_OK;
}
+struct AccessibleElement {
+ AccessibleElement(int entryId, QAccessibleInterface *accessible) {
+ if (entryId < 0) {
+ QPair<QObject*, int> ref = qAccessibleRecentSentEvents()->value(entryId);
+ iface = QAccessible::queryAccessibleInterface(ref.first);
+ entry = ref.second;
+ cleanupInterface = true;
+ } else {
+ iface = accessible;
+ entry = entryId;
+ cleanupInterface = false;
+ }
+ }
+
+ QString text(QAccessible::Text t) const {
+ return iface ? iface->text(t, entry) : QString();
+ }
+
+ ~AccessibleElement() {
+ if (cleanupInterface)
+ delete iface;
+ }
+
+ QAccessibleInterface *iface;
+ int entry;
+private:
+ bool cleanupInterface;
+};
+
/*
*/
class QWindowsAccessible : public IAccessible, IOleWindow, QAccessible
@@ -998,7 +1027,8 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::accLocation(long *pxLeft, long *py
if (!accessible->isValid())
return E_FAIL;
- QRect rect = accessible->rect(varID.lVal);
+ AccessibleElement elem(varID.lVal, accessible);
+ QRect rect = elem.iface ? elem.iface->rect(elem.entry) : QRect();
if (rect.isValid()) {
*pxLeft = rect.x();
*pyTop = rect.y();
@@ -1101,25 +1131,12 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accChild(VARIANT varChildID, I
int childIndex = varChildID.lVal;
QAccessibleInterface *acc = 0;
- if (childIndex < 0) {
- const int entry = childIndex;
- QPair<QObject*, int> ref = qAccessibleRecentSentEvents()->value(entry);
- if (ref.first) {
- acc = queryAccessibleInterface(ref.first);
- if (acc && ref.second) {
- if (ref.second) {
- QAccessibleInterface *res;
- int index = acc->navigate(Child, ref.second, &res);
- delete acc;
- if (index == -1)
- return E_INVALIDARG;
- acc = res;
- }
- }
- }
- } else {
- RelationFlag rel = childIndex ? Child : Self;
- accessible->navigate(rel, childIndex, &acc);
+ AccessibleElement elem(childIndex, accessible);
+ if (elem.iface) {
+ RelationFlag rel = elem.entry ? Child : Self;
+ int index = elem.iface->navigate(rel, elem.entry, &acc);
+ if (index == -1)
+ return E_INVALIDARG;
}
if (acc) {
@@ -1171,7 +1188,9 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::accDoDefaultAction(VARIANT varID)
if (!accessible->isValid())
return E_FAIL;
- return accessible->doAction(DefaultAction, varID.lVal, QVariantList()) ? S_OK : S_FALSE;
+ AccessibleElement elem(varID.lVal, accessible);
+ const bool res = elem.iface ? elem.iface->doAction(DefaultAction, elem.entry, QVariantList()) : false;
+ return res ? S_OK : S_FALSE;
}
HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accDefaultAction(VARIANT varID, BSTR* pszDefaultAction)
@@ -1180,7 +1199,8 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accDefaultAction(VARIANT varID
if (!accessible->isValid())
return E_FAIL;
- QString def = accessible->actionText(DefaultAction, Name, varID.lVal);
+ AccessibleElement elem(varID.lVal, accessible);
+ QString def = elem.iface ? elem.iface->actionText(DefaultAction, Name, elem.entry) : QString();
if (def.isEmpty()) {
*pszDefaultAction = 0;
return S_FALSE;
@@ -1196,7 +1216,8 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accDescription(VARIANT varID,
if (!accessible->isValid())
return E_FAIL;
- QString descr = accessible->text(Description, varID.lVal);
+ AccessibleElement elem(varID.lVal, accessible);
+ QString descr = elem.text(Description);
if (descr.size()) {
*pszDescription = QStringToBSTR(descr);
return S_OK;
@@ -1212,7 +1233,8 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accHelp(VARIANT varID, BSTR *p
if (!accessible->isValid())
return E_FAIL;
- QString help = accessible->text(Help, varID.lVal);
+ AccessibleElement elem(varID.lVal, accessible);
+ QString help = elem.text(Help);
if (help.size()) {
*pszHelp = QStringToBSTR(help);
return S_OK;
@@ -1233,7 +1255,8 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accKeyboardShortcut(VARIANT va
if (!accessible->isValid())
return E_FAIL;
- QString sc = accessible->text(Accelerator, varID.lVal);
+ AccessibleElement elem(varID.lVal, accessible);
+ QString sc = elem.text(Accelerator);
if (sc.size()) {
*pszKeyboardShortcut = QStringToBSTR(sc);
return S_OK;
@@ -1249,7 +1272,8 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accName(VARIANT varID, BSTR* p
if (!accessible->isValid())
return E_FAIL;
- QString n = accessible->text(Name, varID.lVal);
+ AccessibleElement elem(varID.lVal, accessible);
+ QString n = elem.text(Name);
if (n.size()) {
*pszName = QStringToBSTR(n);
return S_OK;
@@ -1271,7 +1295,8 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accRole(VARIANT varID, VARIANT
if (!accessible->isValid())
return E_FAIL;
- Role role = accessible->role(varID.lVal);
+ AccessibleElement elem(varID.lVal, accessible);
+ Role role = elem.iface ? elem.iface->role(elem.entry) : NoRole;
if (role != NoRole) {
if (role == LayeredPane)
role = QAccessible::Pane;
@@ -1290,7 +1315,8 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accState(VARIANT varID, VARIAN
return E_FAIL;
(*pvarState).vt = VT_I4;
- (*pvarState).lVal = accessible->state(varID.lVal);
+ AccessibleElement elem(varID.lVal, accessible);
+ (*pvarState).lVal = elem.iface ? elem.iface->state(elem.entry) : 0;
return S_OK;
}
@@ -1300,7 +1326,8 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::get_accValue(VARIANT varID, BSTR*
if (!accessible->isValid())
return E_FAIL;
- QString value = accessible->text(Value, varID.lVal);
+ AccessibleElement elem(varID.lVal, accessible);
+ QString value = elem.text(Value);
if (!value.isNull()) {
*pszValue = QStringToBSTR(value);
return S_OK;
@@ -1324,19 +1351,23 @@ HRESULT STDMETHODCALLTYPE QWindowsAccessible::accSelect(long flagsSelect, VARIAN
bool res = false;
- if (flagsSelect & SELFLAG_TAKEFOCUS)
- res = accessible->doAction(SetFocus, varID.lVal, QVariantList());
- if (flagsSelect & SELFLAG_TAKESELECTION) {
- accessible->doAction(ClearSelection, 0, QVariantList());
- res = accessible->doAction(AddToSelection, varID.lVal, QVariantList());
+ AccessibleElement elem(varID.lVal, accessible);
+ QAccessibleInterface *acc = elem.iface;
+ if (acc) {
+ const int entry = elem.entry;
+ if (flagsSelect & SELFLAG_TAKEFOCUS)
+ res = acc->doAction(SetFocus, entry, QVariantList());
+ if (flagsSelect & SELFLAG_TAKESELECTION) {
+ acc->doAction(ClearSelection, 0, QVariantList()); //### bug, 0 should be entry??
+ res = acc->doAction(AddToSelection, entry, QVariantList());
+ }
+ if (flagsSelect & SELFLAG_EXTENDSELECTION)
+ res = acc->doAction(ExtendSelection, entry, QVariantList());
+ if (flagsSelect & SELFLAG_ADDSELECTION)
+ res = acc->doAction(AddToSelection, entry, QVariantList());
+ if (flagsSelect & SELFLAG_REMOVESELECTION)
+ res = acc->doAction(RemoveSelection, entry, QVariantList());
}
- if (flagsSelect & SELFLAG_EXTENDSELECTION)
- res = accessible->doAction(ExtendSelection, varID.lVal, QVariantList());
- if (flagsSelect & SELFLAG_ADDSELECTION)
- res = accessible->doAction(AddToSelection, varID.lVal, QVariantList());
- if (flagsSelect & SELFLAG_REMOVESELECTION)
- res = accessible->doAction(RemoveSelection, varID.lVal, QVariantList());
-
return res ? S_OK : S_FALSE;
}
diff --git a/src/gui/dialogs/qfiledialog_symbian.cpp b/src/gui/dialogs/qfiledialog_symbian.cpp
index cd020f6..1ffbf1d 100644
--- a/src/gui/dialogs/qfiledialog_symbian.cpp
+++ b/src/gui/dialogs/qfiledialog_symbian.cpp
@@ -44,7 +44,7 @@
#ifndef QT_NO_FILEDIALOG
#include <private/qfiledialog_p.h>
-#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
#include <driveinfo.h>
#include <AknCommonDialogsDynMem.h>
#include <CAknMemorySelectionDialogMultiDrive.h>
@@ -58,7 +58,7 @@ extern QStringList qt_make_filter_list(const QString &filter); // defined in qfi
extern QStringList qt_clean_filter_list(const QString &filter); // defined in qfiledialog.cpp
enum DialogMode { DialogOpen, DialogSave, DialogFolder };
-#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
class CExtensionFilter : public CBase, public MAknFileFilter
{
public:
@@ -104,7 +104,7 @@ static QString launchSymbianDialog(const QString dialogCaption, const QString st
const QString filter, DialogMode dialogMode)
{
QString selection;
-#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
TFileName startFolder;
if (!startDirectory.isEmpty()) {
QString dir = QDir::toNativeSeparators(QFileDialogPrivate::workingDirectory(startDirectory));
diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h
index 1ff29d2..1408057 100644
--- a/src/gui/dialogs/qfiledialog_win_p.h
+++ b/src/gui/dialogs/qfiledialog_win_p.h
@@ -240,4 +240,4 @@ DECLARE_INTERFACE_(IFileOpenDialog, IFileDialog)
STDMETHOD(GetResults)(THIS_ IShellItemArray **ppenum) PURE;
STDMETHOD(GetSelectedItems)(THIS_ IShellItemArray **ppsai) PURE;
};
-#endif \ No newline at end of file
+#endif
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp
index 2f2f772..2a37d45 100644
--- a/src/gui/egl/qegl.cpp
+++ b/src/gui/egl/qegl.cpp
@@ -94,6 +94,7 @@ QEglContext::QEglContext()
, current(false)
, ownsContext(true)
, sharing(false)
+ , apiChanged(false)
{
QEglContextTracker::ref();
}
@@ -435,9 +436,20 @@ bool QEglContext::makeCurrent(EGLSurface surface)
return false;
}
+#ifdef Q_OS_SYMBIAN
+ apiChanged = false;
+ if (currentContext(apiType)
+ && currentContext(apiType)->ctx != eglGetCurrentContext()) {
+ // some other EGL based API active. Complete its rendering
+ eglWaitClient();
+ apiChanged = true;
+ }
+#endif
+
// If lazyDoneCurrent() was called on the surface, then we may be able
// to assume that it is still current within the thread.
- if (surface == currentSurface && currentContext(apiType) == this) {
+ if (surface == currentSurface && currentContext(apiType) == this
+ && !apiChanged) {
current = true;
return true;
}
@@ -512,6 +524,13 @@ bool QEglContext::swapBuffers(EGLSurface surface)
bool ok = eglSwapBuffers(QEgl::display(), surface);
if (!ok)
qWarning() << "QEglContext::swapBuffers():" << QEgl::errorString();
+
+#ifdef Q_OS_SYMBIAN
+ if (apiChanged) {
+ eglWaitClient();
+ apiChanged = false;
+ }
+#endif
return ok;
}
diff --git a/src/gui/egl/qeglcontext_p.h b/src/gui/egl/qeglcontext_p.h
index 6cd76b3..0cdaae7 100644
--- a/src/gui/egl/qeglcontext_p.h
+++ b/src/gui/egl/qeglcontext_p.h
@@ -104,6 +104,7 @@ private:
bool current;
bool ownsContext;
bool sharing;
+ bool apiChanged;
static QEglContext *currentContext(QEgl::API api);
static void setCurrentContext(QEgl::API api, QEglContext *context);
diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp
index 2c10357..b17ade0 100644
--- a/src/gui/embedded/qscreen_qws.cpp
+++ b/src/gui/embedded/qscreen_qws.cpp
@@ -1545,6 +1545,7 @@ QImage::Format QScreenPrivate::preferredImageFormat() const
\value SvgalibClass QSvgalibScreen
\value ProxyClass QProxyScreen
\value GLClass QGLScreen
+ \value IntfbClass QIntfbScreen
\value CustomClass Unknown QScreen subclass
\sa classId()
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index ef53963..2ac2bdf 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -3297,7 +3297,7 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim
}
if (climb) {
- while (f->d_ptr->focusScopeItem && f->d_ptr->focusScopeItem->isVisible())
+ while (f->d_ptr->focusScopeItem && f->d_ptr->focusScopeItem->isVisible() && f->d_ptr->focusScopeItem != f)
f = f->d_ptr->focusScopeItem;
}
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 5ddd53f..899b792 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -64,6 +64,8 @@
#define QT_EAknCursorPositionChanged MAknEdStateObserver::EAknEdwinStateEvent(6)
// MAknEdStateObserver::EAknActivatePenInputRequest
#define QT_EAknActivatePenInputRequest MAknEdStateObserver::EAknEdwinStateEvent(7)
+// MAknEdStateObserver::EAknClosePenInputRequest
+#define QT_EAknClosePenInputRequest MAknEdStateObserver::EAknEdwinStateEvent(10)
// EAknEditorFlagSelectionVisible is only valid from 3.2 onwards.
// Sym^3 AVKON FEP manager expects that this flag is used for FEP-aware editors
@@ -252,9 +254,6 @@ bool QCoeFepInputContext::needsInputPanel()
bool QCoeFepInputContext::filterEvent(const QEvent *event)
{
- // The CloseSoftwareInputPanel event is not handled here, because the VK will automatically
- // close when it discovers that the underlying widget does not have input capabilities.
-
if (!focusWidget())
return false;
@@ -318,6 +317,12 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
if (!needsInputPanel())
return false;
+ if ((event->type() == QEvent::CloseSoftwareInputPanel)
+ && (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)) {
+ m_fepState->ReportAknEdStateEventL(QT_EAknClosePenInputRequest);
+ return false;
+ }
+
if (event->type() == QEvent::RequestSoftwareInputPanel) {
// Only request virtual keyboard if it is not yet active or if this is the first time
// panel is requested for this application.
@@ -474,7 +479,7 @@ void QCoeFepInputContext::resetSplitViewWidget(bool keepInputWidget)
if (!alwaysResize) {
if (gv->scene()) {
- if (gv->scene()->focusItem()) {
+ if (gv->scene()->focusItem() && S60->partial_keyboardAutoTranslation) {
// Check if the widget contains cursorPositionChanged signal and disconnect from it.
QByteArray signal = QMetaObject::normalizedSignature(SIGNAL(cursorPositionChanged()));
int index = gv->scene()->focusItem()->toGraphicsObject()->metaObject()->indexOfSignal(signal.right(signal.length() - 1));
@@ -580,7 +585,7 @@ void QCoeFepInputContext::ensureFocusWidgetVisible(QWidget *widget)
if (!moveWithinVisibleArea) {
// Check if the widget contains cursorPositionChanged signal and connect to it.
QByteArray signal = QMetaObject::normalizedSignature(SIGNAL(cursorPositionChanged()));
- if (gv->scene() && gv->scene()->focusItem()) {
+ if (gv->scene() && gv->scene()->focusItem() && S60->partial_keyboardAutoTranslation) {
int index = gv->scene()->focusItem()->toGraphicsObject()->metaObject()->indexOfSignal(signal.right(signal.length() - 1));
if (index != -1)
connect(gv->scene()->focusItem()->toGraphicsObject(), SIGNAL(cursorPositionChanged()), this, SLOT(translateInputWidget()));
@@ -1080,7 +1085,18 @@ TInt QCoeFepInputContext::DocumentLengthForFep() const
return 0;
QVariant variant = w->inputMethodQuery(Qt::ImSurroundingText);
- return variant.value<QString>().size() + m_preeditString.size();
+
+ int size = variant.value<QString>().size() + m_preeditString.size();
+
+ // To fix an issue with backspaces not being generated if document size is zero,
+ // fake document length to be at least one always, except when dealing with
+ // hidden text widgets, where this faking would generate extra asterisk. Since the
+ // primary use of hidden text widgets is password fields, they are unlikely to
+ // support multiple lines anyway.
+ if (size == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText))
+ size = 1;
+
+ return size;
}
TInt QCoeFepInputContext::DocumentMaximumLengthForFep() const
@@ -1163,6 +1179,12 @@ void QCoeFepInputContext::GetEditorContentForFep(TDes& aEditorContent, TInt aDoc
// FEP expects the preedit string to be part of the editor content, so let's mix it in.
int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt();
text.insert(cursor, m_preeditString);
+
+ // Add additional space to empty non-password text to compensate
+ // for the fake length we specified in DocumentLengthForFep().
+ if (text.size() == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText))
+ text += QChar(0x20);
+
aEditorContent.Copy(qt_QString2TPtrC(text.mid(aDocumentPosition, aLengthToRetrieve)));
}
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index e32fdeb..0fbae59 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -66,9 +66,14 @@
#include <qdebug.h>
@interface NSEvent (Qt_Compile_Leopard_DeviceDelta)
+ // SnowLeopard:
- (CGFloat)deviceDeltaX;
- (CGFloat)deviceDeltaY;
- (CGFloat)deviceDeltaZ;
+ // Lion:
+ - (CGFloat)scrollingDeltaX;
+ - (CGFloat)scrollingDeltaY;
+ - (CGFloat)scrollingDeltaZ;
@end
@interface NSEvent (Qt_Compile_Leopard_Gestures)
@@ -614,7 +619,6 @@ static int qCocoaViewCount = 0;
int deltaX = 0;
int deltaY = 0;
- int deltaZ = 0;
const EventRef carbonEvent = (EventRef)[theEvent eventRef];
const UInt32 carbonEventKind = carbonEvent ? ::GetEventKind(carbonEvent) : 0;
@@ -627,15 +631,20 @@ static int qCocoaViewCount = 0;
// It looks like 1/4 degrees per pixel behaves most native.
// (NB: Qt expects the unit for delta to be 8 per degree):
const int pixelsToDegrees = 2; // 8 * 1/4
- deltaX = [theEvent deviceDeltaX] * pixelsToDegrees;
- deltaY = [theEvent deviceDeltaY] * pixelsToDegrees;
- deltaZ = [theEvent deviceDeltaZ] * pixelsToDegrees;
+ if (QSysInfo::MacintoshVersion <= QSysInfo::MV_10_6) {
+ // Mac OS 10.6
+ deltaX = [theEvent deviceDeltaX] * pixelsToDegrees;
+ deltaY = [theEvent deviceDeltaY] * pixelsToDegrees;
+ } else {
+ // Mac OS 10.7+
+ deltaX = [theEvent scrollingDeltaX] * pixelsToDegrees;
+ deltaY = [theEvent scrollingDeltaY] * pixelsToDegrees;
+ }
} else {
// carbonEventKind == kEventMouseWheelMoved
// Remove acceleration, and use either -120 or 120 as delta:
deltaX = qBound(-120, int([theEvent deltaX] * 10000), 120);
deltaY = qBound(-120, int([theEvent deltaY] * 10000), 120);
- deltaZ = qBound(-120, int([theEvent deltaZ] * 10000), 120);
}
#ifndef QT_NO_WHEELEVENT
@@ -654,13 +663,6 @@ static int qCocoaViewCount = 0;
qt_sendSpontaneousEvent(widgetToGetMouse, &qwe);
}
- if (deltaZ != 0) {
- // Qt doesn't explicitly support wheels with a Z component. In a misguided attempt to
- // try to be ahead of the pack, I'm adding this extra value.
- QWheelEvent qwe(qlocal, qglobal, deltaZ, buttons, keyMods, (Qt::Orientation)3);
- qt_sendSpontaneousEvent(widgetToGetMouse, &qwe);
- }
-
if (deltaX != 0 && deltaY != 0)
QMacScrollOptimization::performDelayedScroll();
#endif //QT_NO_WHEELEVENT
diff --git a/src/gui/kernel/qcursor_win.cpp b/src/gui/kernel/qcursor_win.cpp
index 9f0c516..cef83f5 100644
--- a/src/gui/kernel/qcursor_win.cpp
+++ b/src/gui/kernel/qcursor_win.cpp
@@ -477,6 +477,7 @@ void QCursorData::update()
QPixmap pixmap = QApplicationPrivate::instance()->getPixmapCursor(cshape);
hcurs = create32BitCursor(pixmap, hx, hy);
}
+ break;
default:
qWarning("QCursor::update: Invalid cursor shape %d", cshape);
return;
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 500bcff..9caa37e 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -102,7 +102,7 @@ QSoftKeyManager::QSoftKeyManager() :
QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget)
{
QAction *action = new QAction(standardSoftKeyText(standardKey), actionWidget);
-#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
int key = 0;
switch (standardKey) {
case OkSoftKey:
@@ -123,8 +123,10 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act
default:
break;
};
- if (key != 0)
+ if (key != 0) {
QSoftKeyManager::instance()->d_func()->softKeyCommandActions.insert(action, key);
+ connect(action, SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*)));
+ }
#endif
QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey;
switch (standardKey) {
@@ -157,7 +159,13 @@ QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key
QScopedPointer<QAction> action(createAction(standardKey, actionWidget));
connect(action.data(), SIGNAL(triggered()), QSoftKeyManager::instance(), SLOT(sendKeyEvent()));
+
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
+ // Don't connect destroyed slot if is was already connected in createAction
+ if (!(QSoftKeyManager::instance()->d_func()->softKeyCommandActions.contains(action.data())))
+#endif
connect(action.data(), SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*)));
+
QSoftKeyManager::instance()->d_func()->keyedActions.insert(action.data(), key);
return action.take();
#endif //QT_NO_ACTION
@@ -166,9 +174,11 @@ QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key
void QSoftKeyManager::cleanupHash(QObject *obj)
{
Q_D(QSoftKeyManager);
- QAction *action = qobject_cast<QAction*>(obj);
+ // Can't use qobject_cast in destroyed() signal handler as that'll return NULL,
+ // so use static_cast instead. Since the pointer is only used as a hash key, it is safe.
+ QAction *action = static_cast<QAction *>(obj);
d->keyedActions.remove(action);
-#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
d->softKeyCommandActions.remove(action);
#endif
}
diff --git a/src/gui/kernel/qsoftkeymanager_common_p.h b/src/gui/kernel/qsoftkeymanager_common_p.h
index e9cbd7d..9a11eec 100644
--- a/src/gui/kernel/qsoftkeymanager_common_p.h
+++ b/src/gui/kernel/qsoftkeymanager_common_p.h
@@ -72,7 +72,7 @@ protected:
QMultiHash<int, QAction*> requestedSoftKeyActions;
QWidget *initialSoftKeySource;
bool pendingUpdate;
-#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
QHash<QAction*, int> softKeyCommandActions;
#endif
};
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index b5d0101..999fccc 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -117,7 +117,7 @@ void QSoftKeyManagerPrivateS60::ensureCbaVisibilityAndResponsiviness(CEikButtonG
void QSoftKeyManagerPrivateS60::clearSoftkeys(CEikButtonGroupContainer &cba)
{
-#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
QT_TRAP_THROWING(
//EAknSoftkeyEmpty is used, because using -1 adds softkeys without actions on Symbian3
cba.SetCommandL(0, EAknSoftkeyEmpty, KNullDesC);
@@ -317,7 +317,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba,
QString text = softkeyText(*action);
TPtrC nativeText = qt_QString2TPtrC(text);
int command = S60_COMMAND_START + position;
-#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4)
+#if defined(Q_WS_S60) && !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
if (softKeyCommandActions.contains(action))
command = softKeyCommandActions.value(action);
#endif
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index c429b04..3ec4052 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -77,8 +77,8 @@
#include <akncontext.h> // CAknContextPane
#include <eikspane.h> // CEikStatusPane
#include <AknPopupFader.h> // MAknFadedComponent and TAknPopupFader
-#include <gfxtranseffect/gfxtranseffect.h> // BeginFullScreen
#ifdef QT_SYMBIAN_HAVE_AKNTRANSEFFECT_H
+#include <gfxtranseffect/gfxtranseffect.h> // BeginFullScreen
#include <akntranseffect.h> // BeginFullScreen
#endif
#endif
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index d6aaa3f..807f68e 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -238,7 +238,7 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
bool checkExtra = true;
if (q->isWindow() && (data.window_state & (Qt::WindowFullScreen | Qt::WindowMaximized))) {
// Do not allow fullscreen/maximized windows to expand beyond client rect
- TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ TRect r = S60->clientRect();
w = qMin(w, r.Width());
h = qMin(h, r.Height());
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 8e64f3b..efb016e 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5792,16 +5792,19 @@ void QPainter::drawImage(const QRectF &targetRect, const QImage &image, const QR
d->engine->drawImage(QRectF(x, y, w, h), image, QRectF(sx, sy, sw, sh), flags);
}
+#if !defined(QT_NO_RAWFONT)
/*!
- Draws the glyphs represented by \a glyphs at \a position. The \a position gives the
- edge of the baseline for the string of glyphs. The glyphs will be retrieved from the font
- selected on \a glyphs and at offsets given by the positions in \a glyphs.
+ \fn void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphs)
+
+ Draws the specified \a glyphs at the given \a position.
+ The \a position gives the edge of the baseline for the string of glyphs.
+ The glyphs will be retrieved from the font selected by \a glyphs and at
+ offsets given by the positions in \a glyphs.
\since 4.8
\sa QGlyphRun::setRawFont(), QGlyphRun::setPositions(), QGlyphRun::setGlyphIndexes()
*/
-#if !defined(QT_NO_RAWFONT)
void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun)
{
Q_D(QPainter);
@@ -9251,9 +9254,9 @@ void QPainter::drawPixmapFragments(const PixmapFragment *fragments, int fragment
\since 4.8
This function is used to draw the same \a pixmap with multiple target
- and source rectangles. If \a sourceRects is 0, the whole pixmap will be
- rendered at each of the target rectangles. The \a hints parameter can be
- used to pass in drawing hints.
+ and source rectangles specified by \a targetRects. If \a sourceRects is 0,
+ the whole pixmap will be rendered at each of the target rectangles.
+ The \a hints parameter can be used to pass in drawing hints.
This function is potentially faster than multiple calls to drawPixmap(),
since the backend can optimize state changes.
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm
index 8436856..1c1713c 100644
--- a/src/gui/styles/qmacstyle_mac.mm
+++ b/src/gui/styles/qmacstyle_mac.mm
@@ -1063,7 +1063,7 @@ bool qt_mac_buttonIsRenderedFlat(const QPushButton *pushButton, const QStyleOpti
{
QMacStyle *macStyle = qobject_cast<QMacStyle *>(pushButton->style());
if (!macStyle)
- return false;
+ return true; // revert to 'flat' behavior if not Mac style
HIThemeButtonDrawInfo bdi;
macStyle->d->initHIThemePushButton(option, pushButton, kThemeStateActive, &bdi);
return bdi.kind == kThemeBevelButton;
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 2d6af3b..2df88e2 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -919,8 +919,9 @@ QString QFont::styleName() const
/*!
\since 4.8
- Sets the style name of the font. When set, other style properties
- like \a style() and \a weight() will be ignored for font matching.
+ Sets the style name of the font to the given \a styleName.
+ When set, other style properties like style() and weight() will be ignored
+ for font matching.
\sa styleName()
*/
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 79503f9..1d463c4 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -1943,8 +1943,9 @@ bool QFontDatabase::isScalable(const QString &family,
/*!
- Returns a list of the point sizes available for the font that has
- family \a family and style \a style. The list may be empty.
+ \fn QList<int> QFontDatabase::pointSizes(const QString &family, const QString &style)
+ Returns a list of the point sizes available for the font with the
+ given \a family and \a style. The list may be empty.
\sa smoothSizes(), standardSizes()
*/
@@ -2052,8 +2053,9 @@ QFont QFontDatabase::font(const QString &family, const QString &style,
/*!
- Returns the point sizes of a font that has family \a family and
- style \a style that will look attractive. The list may be empty.
+ \fn QList<int> QFontDatabase::smoothSizes(const QString &family, const QString &style)
+ Returns the point sizes of a font with the given \a family and \a style
+ that will look attractive. The list may be empty.
For non-scalable fonts and bitmap scalable fonts, this function
is equivalent to pointSizes().
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index cf96733..ffa4e59 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -58,7 +58,7 @@
#endif // SYMBIAN_ENABLE_SPLIT_HEADERS
#endif // QT_NO_FREETYPE
-#ifndef SYMBIAN_VERSION_9_4
+#if !defined(SYMBIAN_VERSION_9_4) && !defined(SYMBIAN_VERSION_9_3) && !defined(SYMBIAN_VERSION_9_2)
#define SYMBIAN_LINKEDFONTS_SUPPORTED
#endif // !SYMBIAN_VERSION_9_4
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index f3d4107..1d93d54 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -442,9 +442,10 @@ bool QFontMetrics::inFont(QChar ch) const
}
/*!
+ \fn bool QFontMetrics::inFontUcs4(uint character) const
\since 4.8
- Returns true if the character encoded in UCS-4/UTF-32 is a valid
+ Returns true if the given \a character encoded in UCS-4/UTF-32 is a valid
character in the font; otherwise returns false.
*/
bool QFontMetrics::inFontUcs4(uint ucs4) const
diff --git a/src/gui/text/qglyphrun.cpp b/src/gui/text/qglyphrun.cpp
index 2865d91..442f7cc 100644
--- a/src/gui/text/qglyphrun.cpp
+++ b/src/gui/text/qglyphrun.cpp
@@ -175,7 +175,8 @@ QRawFont QGlyphRun::rawFont() const
}
/*!
- Sets the font in which to look up the glyph indexes to \a font.
+ Sets the font specified by \a rawFont to be the font used to look up the
+ glyph indexes.
\sa rawFont(), setGlyphIndexes()
*/
diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp
index d1d1f94..e3eeca5 100644
--- a/src/gui/text/qplatformfontdatabase_qpa.cpp
+++ b/src/gui/text/qplatformfontdatabase_qpa.cpp
@@ -160,6 +160,9 @@ QSupportedWritingSystems::QSupportedWritingSystems(const QSupportedWritingSystem
d->ref.ref();
}
+/*!
+ Assigns the \a other supported writing systems object to this object.
+*/
QSupportedWritingSystems &QSupportedWritingSystems::operator=(const QSupportedWritingSystems &other)
{
if (d != other.d) {
@@ -171,6 +174,9 @@ QSupportedWritingSystems &QSupportedWritingSystems::operator=(const QSupportedWr
return *this;
}
+/*!
+ Destroys the object.
+*/
QSupportedWritingSystems::~QSupportedWritingSystems()
{
if (!d->ref.deref())
@@ -187,12 +193,26 @@ void QSupportedWritingSystems::detach()
}
}
+/*!
+ Sets the supported state of the writing system given by \a writingSystem to
+ the value specified by \a support. A value of true indicates that the
+ writing system is supported; a value of false indicates that it is
+ unsupported.
+
+ \sa supported()
+*/
void QSupportedWritingSystems::setSupported(QFontDatabase::WritingSystem writingSystem, bool support)
{
detach();
d->vector[writingSystem] = support;
}
+/*!
+ Returns true if the writing system given by \a writingSystem is supported;
+ otherwise returns false.
+
+ \sa setSupported()
+*/
bool QSupportedWritingSystems::supported(QFontDatabase::WritingSystem writingSystem) const
{
return d->vector.at(writingSystem);
@@ -295,7 +315,7 @@ QStringList QPlatformFontDatabase::addApplicationFont(const QByteArray &fontData
}
/*!
-
+ Releases the font handle and deletes any associated data loaded from a file.
*/
void QPlatformFontDatabase::releaseHandle(void *handle)
{
@@ -304,7 +324,13 @@ void QPlatformFontDatabase::releaseHandle(void *handle)
}
/*!
+ Returns the path to the font directory.
+
+ The font directory is stored in the general Qt settings unless it has been
+ overridden by the \c QT_QPA_FONTDIR environment variable.
+ When using builds of Qt that do not support settings, the \c QT_QPA_FONTDIR
+ environment variable is the only way to specify the font directory.
*/
QString QPlatformFontDatabase::fontDir() const
{
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index e3e5c57..60a6cb3 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -485,7 +485,8 @@ QVector<quint32> QRawFont::glyphIndexesForString(const QString &text) const
must be at least \a numChars, if that's still not enough, this function will return
false, then you can resize \a glyphIndexes from the size returned in \a numGlyphs.
- \sa glyphIndexesForString(), advancesForGlyphIndexes(), QGlyphs, QTextLayout::glyphs(), QTextFragment::glyphs()
+ \sa glyphIndexesForString(), advancesForGlyphIndexes(), QGlyphRun,
+ QTextLayout::glyphRuns(), QTextFragment::glyphRuns()
*/
bool QRawFont::glyphIndexesForChars(const QChar *chars, int numChars, quint32 *glyphIndexes, int *numGlyphs) const
{
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index aacac04..e32e112 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1665,8 +1665,10 @@ void QTextControlPrivate::mouseMoveEvent(QEvent *e, Qt::MouseButton button, cons
#endif //QT_NO_IM
} else {
//emit q->visibilityRequest(QRectF(mousePos, QSizeF(1, 1)));
- if (cursor.position() != oldCursorPos)
+ if (cursor.position() != oldCursorPos) {
emit q->cursorPositionChanged();
+ emit q->microFocusChanged();
+ }
}
selectionChanged(true);
repaintOldAndNewSelection(oldSelection);
@@ -1710,8 +1712,10 @@ void QTextControlPrivate::mouseReleaseEvent(QEvent *e, Qt::MouseButton button, c
repaintOldAndNewSelection(oldSelection);
- if (cursor.position() != oldCursorPos)
+ if (cursor.position() != oldCursorPos) {
emit q->cursorPositionChanged();
+ emit q->microFocusChanged();
+ }
if (interactionFlags & Qt::LinksAccessibleByMouse) {
if (!(button & Qt::LeftButton))
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp
index f4cb742..39d0e6c 100644
--- a/src/gui/text/qtextdocument_p.cpp
+++ b/src/gui/text/qtextdocument_p.cpp
@@ -540,6 +540,7 @@ int QTextDocumentPrivate::remove_block(int pos, int *blockFormat, int command, Q
int n = blocks.next(b);
Q_ASSERT((int)blocks.position(n) == pos + 1);
blocks.setSize(b, blocks.size(b) + blocks.size(n) - 1);
+ blocks.fragment(b)->userState = blocks.fragment(n)->userState;
b = n;
}
*blockFormat = blocks.fragment(b)->format;
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 093b43d..9f148ee 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1532,33 +1532,38 @@ void QTextEngine::itemize() const
const ushort *e = uc + length;
int lastScript = QUnicodeTables::Common;
while (uc < e) {
- int script = QUnicodeTables::script(*uc);
- if (script == QUnicodeTables::Inherited)
- script = lastScript;
- analysis->flags = QScriptAnalysis::None;
- if (*uc == QChar::ObjectReplacementCharacter) {
- if (analysis->bidiLevel % 2)
- --analysis->bidiLevel;
+ switch (*uc) {
+ case QChar::ObjectReplacementCharacter:
analysis->script = QUnicodeTables::Common;
analysis->flags = QScriptAnalysis::Object;
- } else if (*uc == QChar::LineSeparator) {
+ break;
+ case QChar::LineSeparator:
if (analysis->bidiLevel % 2)
--analysis->bidiLevel;
analysis->script = QUnicodeTables::Common;
analysis->flags = QScriptAnalysis::LineOrParagraphSeparator;
if (option.flags() & QTextOption::ShowLineAndParagraphSeparators)
*const_cast<ushort*>(uc) = 0x21B5; // visual line separator
- } else if (*uc == 9) {
+ break;
+ case 9: // Tab
analysis->script = QUnicodeTables::Common;
analysis->flags = QScriptAnalysis::Tab;
analysis->bidiLevel = control.baseLevel();
- } else if ((*uc == 32 || *uc == QChar::Nbsp)
- && (option.flags() & QTextOption::ShowTabsAndSpaces)) {
- analysis->script = QUnicodeTables::Common;
- analysis->flags = QScriptAnalysis::Space;
- analysis->bidiLevel = control.baseLevel();
- } else {
- analysis->script = script;
+ break;
+ case 32: // Space
+ case QChar::Nbsp:
+ if (option.flags() & QTextOption::ShowTabsAndSpaces) {
+ analysis->script = QUnicodeTables::Common;
+ analysis->flags = QScriptAnalysis::Space;
+ analysis->bidiLevel = control.baseLevel();
+ break;
+ }
+ // fall through
+ default:
+ int script = QUnicodeTables::script(*uc);
+ analysis->script = script == QUnicodeTables::Inherited ? lastScript : script;
+ analysis->flags = QScriptAnalysis::None;
+ break;
}
lastScript = analysis->script;
++uc;
@@ -2426,7 +2431,7 @@ void QTextEngine::indexAdditionalFormats()
between the text that gets truncated and the ellipsis. This is important to get
correctly shaped results for arabic text.
*/
-static bool nextCharJoins(const QString &string, int pos)
+static inline bool nextCharJoins(const QString &string, int pos)
{
while (pos < string.length() && string.at(pos).category() == QChar::Mark_NonSpacing)
++pos;
@@ -2435,13 +2440,14 @@ static bool nextCharJoins(const QString &string, int pos)
return string.at(pos).joining() != QChar::OtherJoining;
}
-static bool prevCharJoins(const QString &string, int pos)
+static inline bool prevCharJoins(const QString &string, int pos)
{
while (pos > 0 && string.at(pos - 1).category() == QChar::Mark_NonSpacing)
--pos;
if (pos == 0)
return false;
- return (string.at(pos - 1).joining() == QChar::Dual || string.at(pos - 1).joining() == QChar::Center);
+ QChar::Joining joining = string.at(pos - 1).joining();
+ return (joining == QChar::Dual || joining == QChar::Center);
}
QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int flags) const
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 84674a5..a8031e7 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -60,7 +60,7 @@
QT_BEGIN_NAMESPACE
#ifdef QT_GUI_PASSWORD_ECHO_DELAY
-static int qt_passwordEchoDelay = QT_GUI_PASSWORD_ECHO_DELAY;
+static const int qt_passwordEchoDelay = QT_GUI_PASSWORD_ECHO_DELAY;
#endif
/*!
@@ -93,8 +93,8 @@ void QLineControl::updateDisplayText(bool forceUpdate)
if (m_echoMode == QLineEdit::Password) {
str.fill(m_passwordCharacter);
#ifdef QT_GUI_PASSWORD_ECHO_DELAY
- if (m_passwordEchoTimer != 0 && !str.isEmpty()) {
- int cursor = m_text.length() - 1;
+ if (m_passwordEchoTimer != 0 && m_cursor > 0 && m_cursor <= m_text.length()) {
+ int cursor = m_cursor - 1;
QChar uc = m_text.at(cursor);
str[cursor] = uc;
if (cursor > 0 && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) {
@@ -1442,9 +1442,9 @@ bool QLineControl::processEvent(QEvent* ev)
case QEvent::GraphicsSceneMouseRelease:
case QEvent::GraphicsSceneMousePress:{
QGraphicsSceneMouseEvent *gvEv = static_cast<QGraphicsSceneMouseEvent*>(ev);
- QMouseEvent* mouse = new QMouseEvent(ev->type(),
+ QMouseEvent mouse(ev->type(),
gvEv->pos().toPoint(), gvEv->button(), gvEv->buttons(), gvEv->modifiers());
- processMouseEvent(mouse); break;
+ processMouseEvent(&mouse); break;
}
#endif
case QEvent::MouseButtonPress: