summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-28 20:16:34 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-28 20:16:34 (GMT)
commit917e4e3284a568eecfca26365cc0a545d0f4eb70 (patch)
tree247bbe996467199c011a348658d62844206336e0 /src/gui
parent0599478b270ae277121a55c6040acc15edd4d6eb (diff)
parent8d84ef130ca8dc3d6a7c0b6e7408ad2db6874e75 (diff)
downloadQt-917e4e3284a568eecfca26365cc0a545d0f4eb70.zip
Qt-917e4e3284a568eecfca26365cc0a545d0f4eb70.tar.gz
Qt-917e4e3284a568eecfca26365cc0a545d0f4eb70.tar.bz2
Merge branch 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration into 4.7-integration
* 'qt-4.7-from-4.6' of scm.dev.nokia.troll.no:qt/qt-integration: (73 commits) Apply Rhys's fix to qpaintengine_vg.cpp to make it compile Attempt again at fixing the OpenVG paint engine build Revert "Attempt at fixing compile failure introduced by 4.6 merge in qpaintengine_vg.cpp" Attempt at fixing compile failure introduced by 4.6 merge in qpaintengine_vg.cpp Fixing the wrong QUrl usage When on Symbian use smaller files. correctly position glyphs for complex languages Removed inneccessary QGlyphLayout::offsets initialization. Fix mirrored characters for RTL text in Symbian QNAM: Add a code comment related to the cache tst_QSystemSemaphore::processes fixed for WinCE tst_qsystemsemaphore: fix deployment of lackey.exe for WinCE tst_qsharedmemory: create multiple instances of lackey.exe on WinCE tst_qsharedmemory: fix deployment of lackey.exe for WinCE fix compilation of tst_sharedmemory on Windows CE QtScript: regression with instanceof operator for QMetaObject wrappers examples/widgets/stylesheet fix mainwindow.ui QStyleSheetStyle: fix memory leak on base style change QNAM HTTP: Fixed a bug when getting empty files with pipelining Fix window transparency on Symbian. ...
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h7
-rw-r--r--src/gui/graphicsview/qgraphicsview_p.h8
-rw-r--r--src/gui/kernel/qapplication_s60.cpp9
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp2
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm11
-rw-r--r--src/gui/kernel/qt_s60_p.h3
-rw-r--r--src/gui/kernel/qwidget_s60.cpp82
-rw-r--r--src/gui/painting/qprintengine_win.cpp7
-rw-r--r--src/gui/s60framework/qs60mainappui.cpp12
-rw-r--r--src/gui/styles/qs60style.cpp12
-rw-r--r--src/gui/styles/qs60style_s60.cpp8
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp9
-rw-r--r--src/gui/styles/qstylesheetstyle_p.h1
-rw-r--r--src/gui/text/qfontengine_s60.cpp8
-rw-r--r--src/gui/widgets/qmenu.cpp4
15 files changed, 142 insertions, 41 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 6b22607..569a329 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -845,6 +845,13 @@ inline bool QGraphicsItemPrivate::insertionOrder(QGraphicsItem *a, QGraphicsItem
inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect)
{
QGraphicsItemPrivate *parentp = this;
+#ifndef QT_NO_GRAPHICSEFFECT
+ if (updateBoundingRect && parentp->graphicsEffect && !parentp->inSetPosHelper) {
+ parentp->notifyInvalidated = 1;
+ static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
+ ->source->d_func())->invalidateCache();
+ }
+#endif
while (parentp->parent) {
parentp = parentp->parent->d_ptr.data();
parentp->dirtyChildren = 1;
diff --git a/src/gui/graphicsview/qgraphicsview_p.h b/src/gui/graphicsview/qgraphicsview_p.h
index 729837a..80e3ec1 100644
--- a/src/gui/graphicsview/qgraphicsview_p.h
+++ b/src/gui/graphicsview/qgraphicsview_p.h
@@ -183,8 +183,12 @@ public:
else
QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest);
#else
- QCoreApplication::processEvents(QEventLoop::AllEvents | QEventLoop::ExcludeSocketNotifiers
- | QEventLoop::ExcludeUserInputEvents);
+ // At this point either HIViewSetNeedsDisplay (Carbon) or setNeedsDisplay: YES (Cocoa)
+ // is called, which means there's a pending update request. We want to dispatch it
+ // now because otherwise graphics view updates would require two
+ // round-trips in the event loop before the item is painted.
+ extern void qt_mac_dispatchPendingUpdateRequests(QWidget *);
+ qt_mac_dispatchPendingUpdateRequests(viewport->window());
#endif
}
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index c735d1f..c9a79eb 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -73,6 +73,7 @@
# endif
# include <private/qs60mainapplication_p.h>
# include <centralrepository.h>
+# include "qs60mainappui.h"
#endif
#include "private/qstylesheetstyle_p.h"
@@ -539,6 +540,14 @@ void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent)
sendMouseEvent(receiver, type, globalPos, button, modifiers);
}
+#ifdef Q_WS_S60
+void QSymbianControl::HandleStatusPaneSizeChange()
+{
+ QS60MainAppUi *s60AppUi = static_cast<QS60MainAppUi *>(S60->appUi());
+ s60AppUi->HandleStatusPaneSizeChange();
+}
+#endif
+
void QSymbianControl::sendMouseEvent(
QWidget *receiver,
QEvent::Type type,
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index e4990b1..6325d95 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -79,6 +79,8 @@ bool QSoftKeyManagerPrivateS60::skipCbaUpdate()
// Note: Cannot use IsDisplayingMenuOrDialog since CBA update can be triggered before
// menu/dialog CBA is actually displayed i.e. it is being costructed.
CEikButtonGroupContainer *appUiCba = S60->buttonGroupContainer();
+ if (!appUiCba)
+ return true;
// CEikButtonGroupContainer::Current returns 0 if CBA is not visible at all
CEikButtonGroupContainer *currentCba = CEikButtonGroupContainer::Current();
// Check if softkey need to be update even they are not visible
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index 024c1fc..8cef03c 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -1299,6 +1299,17 @@ CGContextRef qt_mac_graphicsContextFor(QWidget *widget)
return context;
}
+void qt_mac_dispatchPendingUpdateRequests(QWidget *widget)
+{
+ if (!widget)
+ return;
+#ifndef QT_MAC_USE_COCOA
+ HIViewRender(qt_mac_nativeview_for(widget));
+#else
+ [qt_mac_nativeview_for(widget) displayIfNeeded];
+#endif
+}
+
CGFloat qt_mac_get_scalefactor()
{
#ifndef QT_MAC_USE_COCOA
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index a714221..58da302 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -155,7 +155,7 @@ class QLongTapTimer;
class QSymbianControl : public CCoeControl, public QAbstractLongTapObserver
#ifdef Q_WS_S60
-, public MAknFadedComponent
+, public MAknFadedComponent, public MEikStatusPaneObserver
#endif
{
public:
@@ -183,6 +183,7 @@ public:
#ifdef Q_WS_S60
void FadeBehindPopup(bool fade){ popupFader.FadeBehindPopup( this, this, fade); }
+ void HandleStatusPaneSizeChange();
protected: // from MAknFadedComponent
TInt CountFadedComponents() {return 1;}
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index bfa7050..c30814b 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -387,16 +387,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
| EPointerFilterMove | EPointerFilterDrag, 0);
drawableWindow->EnableVisibilityChangeEvents();
- if (!isOpaque) {
- RWindow *const window = static_cast<RWindow *>(drawableWindow);
-#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
- window->SetSurfaceTransparency(true);
-#else
- const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
- if (window->SetTransparencyAlphaChannel() == KErrNone)
- window->SetBackgroundColor(TRgb(255, 255, 255, 0));
-#endif
- }
+ s60UpdateIsOpaque();
}
q->setAttribute(Qt::WA_WState_Created);
@@ -488,6 +479,47 @@ void QWidgetPrivate::show_sys()
QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId());
+#ifdef Q_WS_S60
+ // Lazily initialize the S60 screen furniture when the first window is shown.
+ if (!QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)
+ && !S60->buttonGroupContainer() && !S60->statusPane()) {
+
+ bool isFullscreen = q->windowState() & Qt::WindowFullScreen;
+ bool cbaRequested = q->windowFlags() & Qt::WindowSoftkeysVisibleHint;
+
+ // If the window is fullscreen and has not explicitly requested that the CBA be visible
+ // we delay the creation even more.
+ if ((!isFullscreen || cbaRequested) && !q->testAttribute(Qt::WA_DontShowOnScreen)) {
+
+ // Create the status pane and CBA here
+ CEikAppUi *ui = static_cast<CEikAppUi *>(S60->appUi());
+ MEikAppUiFactory *factory = CEikonEnv::Static()->AppUiFactory();
+ TRAP_IGNORE(factory->ReadAppInfoResourceL(0, ui));
+ if (S60->buttonGroupContainer())
+ S60->buttonGroupContainer()->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
+
+ if (S60->statusPane()) {
+ // Use QDesktopWidget as the status pane observer to proxy for the AppUi.
+ // Can't use AppUi directly because it privately inherits from MEikStatusPaneObserver.
+ QSymbianControl *desktopControl = static_cast<QSymbianControl *>(QApplication::desktop()->winId());
+ S60->statusPane()->SetObserver(desktopControl);
+
+ // Hide the status pane if fullscreen OR
+ // Fill client area if maximized OR
+ // Put window below status pane unless the window has an explicit position.
+ if (isFullscreen) {
+ S60->statusPane()->MakeVisible(false);
+ } else if (q->windowState() & Qt::WindowMaximized) {
+ TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ id->SetExtent(r.iTl, r.Size());
+ } else if (!q->testAttribute(Qt::WA_Moved)) {
+ id->SetPosition(static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl);
+ }
+ }
+ }
+ }
+#endif
+
id->MakeVisible(true);
if(q->isWindow())
@@ -1063,6 +1095,9 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
return;
if (isWindow()) {
+ createWinId();
+ Q_ASSERT(testAttribute(Qt::WA_WState_Created));
+
const bool wasResized = testAttribute(Qt::WA_Resized);
const bool wasMoved = testAttribute(Qt::WA_Moved);
@@ -1100,23 +1135,32 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
}
#endif // Q_WS_S60
- createWinId();
- Q_ASSERT(testAttribute(Qt::WA_WState_Created));
// Ensure the initial size is valid, since we store it as normalGeometry below.
if (!wasResized && !isVisible())
adjustSize();
QTLWExtra *top = d->topData();
- const QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry;
-
+ QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry;
const bool cbaVisibilityHint = windowFlags() & Qt::WindowSoftkeysVisibleHint;
- if (newstate & Qt::WindowFullScreen && !cbaVisibilityHint)
- setGeometry(qApp->desktop()->screenGeometry(this));
- else if (newstate & Qt::WindowMaximized || ((newstate & Qt::WindowFullScreen) && cbaVisibilityHint))
- setGeometry(qApp->desktop()->availableGeometry(this));
- else
+ if (newstate & Qt::WindowFullScreen && !cbaVisibilityHint) {
+ window->SetExtentToWholeScreen();
+ } else if (newstate & Qt::WindowMaximized || ((newstate & Qt::WindowFullScreen) && cbaVisibilityHint)) {
+ TRect maxExtent = qt_QRect2TRect(qApp->desktop()->availableGeometry(this));
+ window->SetExtent(maxExtent.iTl, maxExtent.Size());
+ } else {
+#ifdef Q_WS_S60
+ // With delayed creation of S60 app panes, the normalGeometry calculated above is not
+ // accurate because it did not consider the status pane. This means that when returning
+ // normal mode after showing the status pane, the geometry would overlap so we should
+ // move it if it never had an explicit position.
+ if (!wasMoved && statusPane && visible) {
+ TPoint tl = static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl;
+ normalGeometry.setTopLeft(QPoint(tl.iX, tl.iY));
+ }
+#endif
setGeometry(normalGeometry);
+ }
//restore normal geometry
top->normalGeometry = normalGeometry;
diff --git a/src/gui/painting/qprintengine_win.cpp b/src/gui/painting/qprintengine_win.cpp
index ea9dc5d..dd4de99 100644
--- a/src/gui/painting/qprintengine_win.cpp
+++ b/src/gui/painting/qprintengine_win.cpp
@@ -965,12 +965,13 @@ void QWin32PrintEnginePrivate::queryDefault()
return;
QStringList info = output.split(QLatin1Char(','));
- if (info.size() > 0) {
+ int infoSize = info.size();
+ if (infoSize > 0) {
if (name.isEmpty())
name = info.at(0);
- if (program.isEmpty())
+ if (program.isEmpty() && infoSize > 1)
program = info.at(1);
- if (port.isEmpty())
+ if (port.isEmpty() && infoSize > 2)
port = info.at(2);
}
}
diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp
index 3b5b9d3..feffc9f 100644
--- a/src/gui/s60framework/qs60mainappui.cpp
+++ b/src/gui/s60framework/qs60mainappui.cpp
@@ -112,16 +112,10 @@ void QS60MainAppUi::ConstructL()
// ENoAppResourceFile and ENonStandardResourceFile makes UI to work without
// resource files in most SDKs. S60 3rd FP1 public seems to require resource file
// even these flags are defined
- TInt flags = CAknAppUi::EAknEnableSkin;
- if (QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)) {
- flags |= CAknAppUi::ENoScreenFurniture | CAknAppUi::ENonStandardResourceFile;
- }
+ TInt flags = CAknAppUi::EAknEnableSkin
+ | CAknAppUi::ENoScreenFurniture
+ | CAknAppUi::ENonStandardResourceFile;
BaseConstructL(flags);
-
- if (!QApplication::testAttribute(Qt::AA_S60DontConstructApplicationPanes)) {
- CEikButtonGroupContainer* nativeContainer = Cba();
- nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
- }
}
/*!
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 7587343..6f05908 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -651,6 +651,8 @@ void QS60StylePrivate::setFont(QWidget *widget) const
fontCategory = QS60StyleEnums::FC_Title;
} else if (qobject_cast<QMessageBox *>(widget)){
fontCategory = QS60StyleEnums::FC_Primary;
+ } else if (qobject_cast<QMenu *>(widget)){
+ fontCategory = QS60StyleEnums::FC_Primary;
}
if (fontCategory != QS60StyleEnums::FC_Undefined) {
const bool resolveFontSize = widget->testAttribute(Qt::WA_SetFont)
@@ -1744,6 +1746,9 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
optionCheckBox.QStyleOptionMenuItem::operator=(*menuItem);
optionCheckBox.rect.setWidth(pixelMetric(PM_IndicatorWidth));
optionCheckBox.rect.setHeight(pixelMetric(PM_IndicatorHeight));
+ optionCheckBox.rect.moveCenter(QPoint(
+ optionCheckBox.rect.center().x(),
+ menuItem->rect.center().y()));
const int moveByX = optionCheckBox.rect.width() + vSpacing;
if (optionMenuItem.direction == Qt::LeftToRight) {
textRect.translate(moveByX, 0);
@@ -2483,6 +2488,7 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz.setHeight(naviPaneSize.height());
}
break;
+ case CT_MenuItem:
case CT_ItemViewItem:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
if (QS60StylePrivate::isTouchSupported())
@@ -3150,6 +3156,12 @@ bool QS60Style::event(QEvent *e)
#ifdef QT_KEYPAD_NAVIGATION
case QEvent::FocusIn:
if (QWidget *focusWidget = QApplication::focusWidget()) {
+
+ // Menus and combobox popups do not draw focus frame around them
+ if (qobject_cast<QComboBoxListView *>(focusWidget) ||
+ qobject_cast<QMenu *>(focusWidget))
+ break;
+
if (!d->m_focusFrame)
d->m_focusFrame = new QFocusFrame(focusWidget);
d->m_focusFrame->setWidget(focusWidget);
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 58a7159..55aa6b0 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -310,7 +310,7 @@ const partMapEntry QS60StyleModeSpecifics::m_partMap[] = {
/* SP_QsnFrPopupSideB */ {KAknsIIDQsnFrPopupSideB, ENoDraw, ES60_All, -1,-1},
/* SP_QsnFrPopupSideL */ {KAknsIIDQsnFrPopupSideL, ENoDraw, ES60_All, -1,-1},
/* SP_QsnFrPopupSideR */ {KAknsIIDQsnFrPopupSideR, ENoDraw, ES60_All, -1,-1},
- /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenter, ENoDraw, ES60_All, -1,-1},
+ /* SP_QsnFrPopupCenter */ {KAknsIIDQsnFrPopupCenterSubmenu, ENoDraw, ES60_All, -1,-1},
// ToolTip graphics different in 3.1 vs. 3.2+.
/* SP_QsnFrPopupPreviewCornerTl */ {KAknsIIDQsnFrPopupCornerTl, ENoDraw, ES60_3_1, EAknsMajorSkin, 0x19c5}, /* KAknsIIDQsnFrPopupPreviewCornerTl */
@@ -919,7 +919,7 @@ QPixmap QS60StyleModeSpecifics::createSkinnedGraphicsLX(QS60StylePrivate::SkinFr
result = fromFbsBitmap(frame, NULL, flags, targetSize);
}
} else {
- TDisplayMode maskDepth = EGray2;
+ TDisplayMode maskDepth = EGray256;
// Query the skin item for possible frame graphics mask details.
if (skinInstance) {
CAknsMaskedBitmapItemData* skinMaskedBmp = static_cast<CAknsMaskedBitmapItemData*>(
@@ -983,6 +983,10 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme
frameId.Set(KAknsIIDQsnFrPopupSub);
}
break;
+ case QS60StylePrivate::SF_PopupBackground:
+ centerId.Set(KAknsIIDQsnFrPopupCenterSubmenu);
+ frameId.Set(KAknsIIDQsnFrPopupSub);
+ break;
case QS60StylePrivate::SF_PanelBackground:
// remove center piece for panel graphics, so that only border is drawn
centerId.Set(KAknsIIDNone);
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 81b923b..515b6c7 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -1539,7 +1539,9 @@ QVector<QCss::StyleRule> QStyleSheetStyle::styleRules(const QWidget *w) const
QHash<const void *, StyleSheet>::const_iterator defaultCacheIt = styleSheetCache->constFind(baseStyle());
if (defaultCacheIt == styleSheetCache->constEnd()) {
defaultSs = getDefaultStyleSheet();
- styleSheetCache->insert(baseStyle(), defaultSs);
+ QStyle *bs = baseStyle();
+ styleSheetCache->insert(bs, defaultSs);
+ QObject::connect(bs, SIGNAL(destroyed(QObject*)), this, SLOT(styleDestroyed(QObject*)), Qt::UniqueConnection);
} else {
defaultSs = defaultCacheIt.value();
}
@@ -2666,6 +2668,11 @@ void QStyleSheetStyle::widgetDestroyed(QObject *o)
autoFillDisabledWidgets->remove((const QWidget *)o);
}
+void QStyleSheetStyle::styleDestroyed(QObject *o)
+{
+ styleSheetCache->remove(o);
+}
+
/*!
* Make sure that the cache will be clean by connecting destroyed if needed.
* return false if the widget is not stylable;
diff --git a/src/gui/styles/qstylesheetstyle_p.h b/src/gui/styles/qstylesheetstyle_p.h
index 50abef9..fd81437 100644
--- a/src/gui/styles/qstylesheetstyle_p.h
+++ b/src/gui/styles/qstylesheetstyle_p.h
@@ -147,6 +147,7 @@ protected:
private Q_SLOTS:
void widgetDestroyed(QObject *);
+ void styleDestroyed(QObject *);
private:
int refcount;
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index c9ff661..e557f56 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -221,9 +221,11 @@ bool QFontEngineS60::stringToCMap(const QChar *characters, int len, QGlyphLayout
HB_Glyph *g = glyphs->glyphs;
const unsigned char* cmap = m_extensions->cmap();
+ const bool isRtl = (flags & QTextEngine::RightToLeft);
for (int i = 0; i < len; ++i) {
const unsigned int uc = getChar(characters, i, len);
- *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap, uc);
+ *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap,
+ isRtl ? QChar::mirroredChar(uc) : uc);
}
glyphs->numGlyphs = g - glyphs->glyphs;
@@ -241,8 +243,8 @@ void QFontEngineS60::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFla
Q_UNUSED(flags);
for (int i = 0; i < glyphs->numGlyphs; i++) {
const glyph_metrics_t bbox = boundingBox_const(glyphs->glyphs[i]);
- glyphs->advances_x[i] = glyphs->offsets[i].x = bbox.xoff;
- glyphs->advances_y[i] = glyphs->offsets[i].y = bbox.yoff;
+ glyphs->advances_x[i] = bbox.xoff;
+ glyphs->advances_y[i] = bbox.yoff;
}
}
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 907dd14..f84059d 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -2803,7 +2803,9 @@ void QMenu::mouseMoveEvent(QMouseEvent *e)
QAction *action = d->actionAt(e->pos());
if (!action) {
- if (d->hasHadMouse)
+ if (d->hasHadMouse
+ && (!d->currentAction
+ || !(d->currentAction->menu() && d->currentAction->menu()->isVisible())))
d->setCurrentAction(0);
return;
} else if(e->buttons()) {