diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-03-23 09:44:10 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2010-03-23 09:44:10 (GMT) |
commit | 47902b7587d66c0941bacf08b31b8caae264f09a (patch) | |
tree | fc7b9715220274c9fd07254159502bf90c300fe5 /src | |
parent | dd9c26cba63c54358f3309143b76ae0416f89c78 (diff) | |
parent | 0409cdb406021d8609eb2a88a896f9fbc085805f (diff) | |
download | Qt-47902b7587d66c0941bacf08b31b8caae264f09a.zip Qt-47902b7587d66c0941bacf08b31b8caae264f09a.tar.gz Qt-47902b7587d66c0941bacf08b31b8caae264f09a.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6
Diffstat (limited to 'src')
36 files changed, 398 insertions, 105 deletions
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index a2d5f37..def66ef 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - 266a6c4f1938dd9edf4a8125faf91c62495e3ce2 + d95c54951e7af2aa7def4346a142b2162bd89bbd diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index a3f70d3..869e225 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,49 @@ +2010-01-31 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Eric Seidel. + + [Qt] Enable FAST_MOBILE_SCROLLING on Qt embedded platforms + https://bugs.webkit.org/show_bug.cgi?id=34168 + + Enable FAST_MOBILE_SCROLLING for Qt on Maemo 5, Linux embedded + and Symbian + + * WebCore.pro: + +2010-01-19 Daniel Bates <dbates@rim.com> + + Reviewed by Adam Treat. + + https://bugs.webkit.org/show_bug.cgi?id=33408 + + Implements an optimization to ignore fixed background images + (i.e. background-attachment: fixed) when a page does not contain + any fixed position elements so as to allow fast repaints (via bit + blit) when scrolling a page. + + Currently, if a page has elements that specify either a fixed + background or a fixed position then we perform a slow repaint + (i.e disable blitting) so as to avoid rendering artifacts. + However, on low-powered/mobile devices slow repaints can cause + noticeable delays when scrolling a page with a fixed background + image. By sacrificing support for fixed background images when + there are no fixed elements on the page and with come care, we + don't need to force slow repaints and can avoid rendering artifacts. + Hence, on such devices we can improve the responsiveness of + scrolling a page with a fixed background image. + + Note, this optimization is only enabled if the WebKit is built + with FAST_MOBILE_SCROLLING enabled. + + Tests: fast/fast-mobile-scrolling/fixed-position-element.html + fast/fast-mobile-scrolling/no-fixed-position-elements.html + + * rendering/RenderBoxModelObject.cpp: + (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): + Disable fixed background attachment if we can blit on scroll. + * rendering/RenderObject.cpp: + (WebCore::RenderObject::styleWillChange): + 2010-03-11 Simon Hausmann <simon.hausmann@nokia.com> Reviewed by Tor Arne Vestbø. diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 5654a18..735c8ef 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -162,6 +162,10 @@ contains(DEFINES, ENABLE_SINGLE_THREADED=1) { DEFINES += ENABLE_SVG_FONTS=0 ENABLE_SVG_FOREIGN_OBJECT=0 ENABLE_SVG_ANIMATION=0 ENABLE_SVG_AS_IMAGE=0 ENABLE_SVG_USE=0 } +mameo5|symbian|embedded { + DEFINES += ENABLE_FAST_MOBILE_SCROLLING=1 +} + # HTML5 ruby support !contains(DEFINES, ENABLE_RUBY=.): DEFINES += ENABLE_RUBY=1 diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.cpp b/src/3rdparty/webkit/WebCore/page/FrameView.cpp index bc4e4f2..4c3a0ab 100644 --- a/src/3rdparty/webkit/WebCore/page/FrameView.cpp +++ b/src/3rdparty/webkit/WebCore/page/FrameView.cpp @@ -106,6 +106,7 @@ struct ScheduledEvent { FrameView::FrameView(Frame* frame) : m_frame(frame) , m_slowRepaintObjectCount(0) + , m_fixedObjectCount(0) , m_layoutTimer(this, &FrameView::layoutTimerFired) , m_layoutRoot(0) , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) @@ -735,7 +736,7 @@ String FrameView::mediaType() const bool FrameView::useSlowRepaints() const { - return m_useSlowRepaints || m_slowRepaintObjectCount > 0 || m_isOverlapped || !m_contentIsOpaque; + return m_useSlowRepaints || m_slowRepaintObjectCount > 0 || (platformWidget() && m_fixedObjectCount > 0) || m_isOverlapped || !m_contentIsOpaque; } void FrameView::setUseSlowRepaints() @@ -759,6 +760,78 @@ void FrameView::removeSlowRepaintObject() setCanBlitOnScroll(!useSlowRepaints()); } +void FrameView::addFixedObject() +{ + if (!m_fixedObjectCount && platformWidget()) + setCanBlitOnScroll(false); + ++m_fixedObjectCount; +} + +void FrameView::removeFixedObject() +{ + ASSERT(m_fixedObjectCount > 0); + m_fixedObjectCount--; + if (!m_fixedObjectCount) + setCanBlitOnScroll(!useSlowRepaints()); +} + +void FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) +{ + const size_t fixedObjectThreshold = 5; + + ListHashSet<RenderBox*>* positionedObjects = 0; + if (RenderView* root = m_frame->contentRenderer()) + positionedObjects = root->positionedObjects(); + + if (!positionedObjects || positionedObjects->isEmpty()) { + hostWindow()->scroll(scrollDelta, rectToScroll, clipRect); + return; + } + + // Get the rects of the fixed objects visible in the rectToScroll + Vector<IntRect, fixedObjectThreshold> subRectToUpdate; + bool updateInvalidatedSubRect = true; + ListHashSet<RenderBox*>::const_iterator end = positionedObjects->end(); + for (ListHashSet<RenderBox*>::const_iterator it = positionedObjects->begin(); it != end; ++it) { + RenderBox* renderBox = *it; + if (renderBox->style()->position() != FixedPosition) + continue; + IntRect topLevelRect; + IntRect updateRect = renderBox->paintingRootRect(topLevelRect); + updateRect.move(-scrollX(), -scrollY()); + updateRect.intersect(rectToScroll); + if (!updateRect.isEmpty()) { + if (subRectToUpdate.size() >= fixedObjectThreshold) { + updateInvalidatedSubRect = false; + break; + } + subRectToUpdate.append(updateRect); + } + } + + // Scroll the view + if (updateInvalidatedSubRect) { + // 1) scroll + hostWindow()->scroll(scrollDelta, rectToScroll, clipRect); + + // 2) update the area of fixed objets that has been invalidated + size_t fixObjectsCount = subRectToUpdate.size(); + for (size_t i = 0; i < fixObjectsCount; ++i) { + IntRect updateRect = subRectToUpdate[i]; + IntRect scrolledRect = updateRect; + scrolledRect.move(scrollDelta); + updateRect.unite(scrolledRect); + updateRect.intersect(rectToScroll); + hostWindow()->repaint(updateRect, true, false, true); + } + } else { + // the number of fixed objects exceed the threshold, so we repaint everything. + IntRect updateRect = clipRect; + updateRect.intersect(rectToScroll); + hostWindow()->repaint(updateRect, true, false, true); + } +} + void FrameView::setIsOverlapped(bool isOverlapped) { if (isOverlapped == m_isOverlapped) diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.h b/src/3rdparty/webkit/WebCore/page/FrameView.h index 3d17d2c..5243c02 100644 --- a/src/3rdparty/webkit/WebCore/page/FrameView.h +++ b/src/3rdparty/webkit/WebCore/page/FrameView.h @@ -143,6 +143,9 @@ public: void addSlowRepaintObject(); void removeSlowRepaintObject(); + void addFixedObject(); + void removeFixedObject(); + void beginDeferredRepaints(); void endDeferredRepaints(); void checkStopDelayingDeferredRepaints(); @@ -196,6 +199,9 @@ public: bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { return m_scrollCorner == scrollCorner; } void invalidateScrollCorner(); +protected: + virtual void scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); + private: FrameView(Frame*); @@ -261,6 +267,7 @@ private: bool m_isOverlapped; bool m_contentIsOpaque; unsigned m_slowRepaintObjectCount; + unsigned m_fixedObjectCount; int m_borderX, m_borderY; diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp index e67daf9..9e15c43 100644 --- a/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp +++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.cpp @@ -509,7 +509,7 @@ void ScrollView::scrollContents(const IntSize& scrollDelta) if (canBlitOnScroll()) { // The main frame can just blit the WebView window // FIXME: Find a way to blit subframes without blitting overlapping content - hostWindow()->scroll(-scrollDelta, scrollViewRect, clipRect); + scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect); } else { // We need to go ahead and repaint the entire backing store. Do it now before moving the // windowed plugins. @@ -524,6 +524,11 @@ void ScrollView::scrollContents(const IntSize& scrollDelta) hostWindow()->paint(); } +void ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) +{ + hostWindow()->scroll(scrollDelta, rectToScroll, clipRect); +} + IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const { IntPoint viewPoint = convertFromContainingWindow(windowPoint); diff --git a/src/3rdparty/webkit/WebCore/platform/ScrollView.h b/src/3rdparty/webkit/WebCore/platform/ScrollView.h index 5dacff5..7060d07 100644 --- a/src/3rdparty/webkit/WebCore/platform/ScrollView.h +++ b/src/3rdparty/webkit/WebCore/platform/ScrollView.h @@ -244,6 +244,9 @@ protected: IntRect scrollCornerRect() const; virtual void updateScrollCorner(); virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect); + + // Scroll the content by blitting the pixels + virtual void scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); private: RefPtr<Scrollbar> m_horizontalScrollbar; diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h index 7ba5fce..3300d01 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h +++ b/src/3rdparty/webkit/WebCore/rendering/RenderBlock.h @@ -75,6 +75,7 @@ public: void insertPositionedObject(RenderBox*); void removePositionedObject(RenderBox*); void removePositionedObjects(RenderBlock*); + ListHashSet<RenderBox*>* positionedObjects() const { return m_positionedObjects; } void addPercentHeightDescendant(RenderBox*); static void removePercentHeightDescendant(RenderBox*); diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp index 1df82a4..7ca2ff8 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderBox.cpp @@ -145,6 +145,16 @@ void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl removeFloatingOrPositionedChildFromBlockLists(); } } + if (FrameView *frameView = view()->frameView()) { + bool newStyleIsFixed = newStyle && newStyle->position() == FixedPosition; + bool oldStyleIsFixed = style() && style()->position() == FixedPosition; + if (newStyleIsFixed != oldStyleIsFixed) { + if (newStyleIsFixed) + frameView->addFixedObject(); + else + frameView->removeFixedObject(); + } + } RenderBoxModelObject::styleWillChange(diff, newStyle); } diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderBoxModelObject.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderBoxModelObject.cpp index 23dad2d..9d0f1ed 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderBoxModelObject.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderBoxModelObject.cpp @@ -557,6 +557,17 @@ void RenderBoxModelObject::calculateBackgroundImageGeometry(const FillLayer* fil // Determine the background positioning area and set destRect to the background painting area. // destRect will be adjusted later if the background is non-repeating. bool fixedAttachment = fillLayer->attachment() == FixedBackgroundAttachment; + +#if ENABLE(FAST_MOBILE_SCROLLING) + if (view()->frameView() && view()->frameView()->canBlitOnScroll()) { + // As a side effect of an optimization to blit on scroll, we do not honor the CSS + // property "background-attachment: fixed" because it may result in rendering + // artifacts. Note, these artifacts only appear if we are blitting on scroll of + // a page that has fixed background images. + fixedAttachment = false; + } +#endif + if (!fixedAttachment) { destRect = IntRect(tx, ty, w, h); diff --git a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp index a10ffd9..199de4a 100644 --- a/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp +++ b/src/3rdparty/webkit/WebCore/rendering/RenderObject.cpp @@ -1591,10 +1591,17 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS s_affectsParentBlock = false; if (view()->frameView()) { - // FIXME: A better solution would be to only invalidate the fixed regions when scrolling. It's overkill to - // prevent the entire view from blitting on a scroll. - bool newStyleSlowScroll = newStyle && (newStyle->position() == FixedPosition || newStyle->hasFixedBackgroundImage()); - bool oldStyleSlowScroll = m_style && (m_style->position() == FixedPosition || m_style->hasFixedBackgroundImage()); + bool shouldBlitOnFixedBackgroundImage = false; +#if ENABLE(FAST_MOBILE_SCROLLING) + // On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays + // when scrolling a page with a fixed background image. As an optimization, assuming there are + // no fixed positoned elements on the page, we can acclerate scrolling (via blitting) if we + // ignore the CSS property "background-attachment: fixed". + shouldBlitOnFixedBackgroundImage = true; +#endif + + bool newStyleSlowScroll = newStyle && !shouldBlitOnFixedBackgroundImage && newStyle->hasFixedBackgroundImage(); + bool oldStyleSlowScroll = m_style && !shouldBlitOnFixedBackgroundImage && m_style->hasFixedBackgroundImage(); if (oldStyleSlowScroll != newStyleSlowScroll) { if (oldStyleSlowScroll) view()->frameView()->removeSlowRepaintObject(); diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp index ceb5ee1..a80c5d3 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp @@ -30,6 +30,7 @@ #include <QtGui/qapplication.h> #include <QtGui/qgraphicssceneevent.h> #include <QtGui/qstyleoption.h> +#include <QtGui/qinputcontext.h> #if defined(Q_WS_X11) #include <QX11Info> #endif @@ -63,6 +64,8 @@ public: void _q_doLoadFinished(bool success); + void _q_updateMicroFocus(); + QGraphicsWebView* q; QWebPage* page; }; @@ -80,6 +83,20 @@ void QGraphicsWebViewPrivate::_q_doLoadFinished(bool success) emit q->loadFinished(success); } +void QGraphicsWebViewPrivate::_q_updateMicroFocus() +{ +#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) + // Ideally, this should be handled by a common call to an updateMicroFocus function + // in QGraphicsItem. See http://bugreports.qt.nokia.com/browse/QTBUG-7578. + QList<QGraphicsView*> views = q->scene()->views(); + for (int c = 0; c < views.size(); ++c) { + QInputContext* ic = views.at(c)->inputContext(); + if (ic) + ic->update(); + } +#endif +} + void QGraphicsWebViewPrivate::scroll(int dx, int dy, const QRect& rectToScroll) { q->scroll(qreal(dx), qreal(dy), QRectF(rectToScroll)); @@ -435,6 +452,8 @@ void QGraphicsWebView::setPage(QWebPage* page) this, SIGNAL(statusBarMessage(QString))); connect(d->page, SIGNAL(linkClicked(QUrl)), this, SIGNAL(linkClicked(QUrl))); + connect(d->page, SIGNAL(microFocusChanged()), + this, SLOT(_q_updateMicroFocus())); } /*! diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h index f3afb4c..68379a2 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h +++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.h @@ -140,3 +140,4 @@ private: }; #endif // QGraphicsWebView_h + Q_PRIVATE_SLOT(d, void _q_updateMicroFocus()) diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index e54c176..a5441cd 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,3 +1,15 @@ +2010-03-21 Kristian Amlie <kristian.amlie@nokia.com> + + Reviewed by Simon Hausmann. + + Fixed updating the VKB display when inputting into QGraphicsWebView. + https://bugs.webkit.org/show_bug.cgi?id=36292 + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::_q_updateMicroFocus): + (QGraphicsWebView::setPage): + * Api/qgraphicswebview.h: + 2010-03-04 Simon Hausmann <simon.hausmann@nokia.com> Reviewed by Kenneth Rohde Christiansen. diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index bd7e626..9d5c49f 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -1175,6 +1175,16 @@ void QStateMachinePrivate::removeStartState() _startState = 0; } +void QStateMachinePrivate::clearHistory() +{ + Q_Q(QStateMachine); + QList<QHistoryState*> historyStates = qFindChildren<QHistoryState*>(q); + for (int i = 0; i < historyStates.size(); ++i) { + QHistoryState *h = historyStates.at(i); + QHistoryStatePrivate::get(h)->configuration.clear(); + } +} + void QStateMachinePrivate::_q_start() { Q_Q(QStateMachine); @@ -1186,6 +1196,7 @@ void QStateMachinePrivate::_q_start() internalEventQueue.clear(); qDeleteAll(externalEventQueue); externalEventQueue.clear(); + clearHistory(); #ifdef QSTATEMACHINE_DEBUG qDebug() << q << ": starting"; diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h index 0fead5d..5e1015f 100644 --- a/src/corelib/statemachine/qstatemachine_p.h +++ b/src/corelib/statemachine/qstatemachine_p.h @@ -126,6 +126,8 @@ public: QState *startState(); void removeStartState(); + void clearHistory(); + void microstep(QEvent *event, const QList<QAbstractTransition*> &transitionList); bool isPreempted(const QAbstractState *s, const QSet<QAbstractTransition*> &transitions) const; QSet<QAbstractTransition*> selectTransitions(QEvent *event) const; diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index d8ac9a8..25ba016 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -69,7 +69,6 @@ extern bool qt_wince_is_smartphone(); //is defined in qguifunctions_wce.cpp # include "qfontdialog.h" # include "qcolordialog.h" # include "qwizard.h" -# include "qmenubar.h" #endif #if defined(Q_WS_S60) @@ -529,12 +528,6 @@ int QDialog::exec() #endif //Q_WS_WINCE_WM #ifdef Q_OS_SYMBIAN -#ifndef QT_NO_MENUBAR - QMenuBar *menuBar = 0; - if (!findChild<QMenuBar *>()) - menuBar = new QMenuBar(this); -#endif - if (qobject_cast<QFileDialog *>(this) || qobject_cast<QFontDialog *>(this) || qobject_cast<QColorDialog *>(this) || qobject_cast<QWizard *>(this)) showMaximized(); @@ -566,13 +559,6 @@ int QDialog::exec() delete menuBar; #endif //QT_NO_MENUBAR #endif //Q_WS_WINCE_WM -#ifdef Q_OS_SYMBIAN -#ifndef QT_NO_MENUBAR - else if (menuBar) - delete menuBar; -#endif //QT_NO_MENUBAR -#endif //Q_OS_SYMBIAN - return res; } diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index e7a7093..37d1b62 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1004,16 +1004,32 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) // else { We don't touch the active window unless we were explicitly activated or deactivated } } +void QSymbianControl::handleClientAreaChange() +{ + const bool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint; + if (qwidget->isFullScreen() && !cbaVisibilityHint) { + SetExtentToWholeScreen(); + } else if (qwidget->isMaximized() || (qwidget->isFullScreen() && cbaVisibilityHint)) { + TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); + SetExtent(r.iTl, r.Size()); + } else if (!qwidget->isMinimized()) { // Normal geometry + if (!qwidget->testAttribute(Qt::WA_Resized)) { + qwidget->adjustSize(); + qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize + } + if (!qwidget->testAttribute(Qt::WA_Moved) && qwidget->windowType() != Qt::Dialog) { + TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); + SetPosition(r.iTl); + qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position + } + } +} + void QSymbianControl::HandleResourceChange(int resourceType) { switch (resourceType) { case KInternalStatusPaneChange: - if (qwidget->isFullScreen()) { - SetExtentToWholeScreen(); - } else if (qwidget->isMaximized()) { - TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); - SetExtent(r.iTl, r.Size()); - } + handleClientAreaChange(); if (IsFocused() && IsVisible()) { qwidget->d_func()->setWindowIcon_sys(true); qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); @@ -1025,22 +1041,7 @@ void QSymbianControl::HandleResourceChange(int resourceType) #ifdef Q_WS_S60 case KEikDynamicLayoutVariantSwitch: { - if (qwidget->isFullScreen()) { - SetExtentToWholeScreen(); - } else if (qwidget->isMaximized()) { - TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); - SetExtent(r.iTl, r.Size()); - } else if (!qwidget->isMinimized()){ // Normal geometry - if (!qwidget->testAttribute(Qt::WA_Resized)) { - qwidget->adjustSize(); - qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize - } - if (!qwidget->testAttribute(Qt::WA_Moved) && qwidget->windowType() != Qt::Dialog) { - TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect(); - SetPosition(r.iTl); - qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position - } - } + handleClientAreaChange(); break; } #endif diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp index c9a94ee..923144a 100644 --- a/src/gui/kernel/qsoftkeymanager.cpp +++ b/src/gui/kernel/qsoftkeymanager.cpp @@ -115,6 +115,8 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act break; } action->setSoftKeyRole(softKeyRole); + action->setVisible(false); + setForceEnabledInSoftkeys(action); return action; } @@ -168,25 +170,55 @@ bool QSoftKeyManager::appendSoftkeys(const QWidget &source, int level) { Q_D(QSoftKeyManager); bool ret = false; - QList<QAction*> actions = source.actions(); - for (int i = 0; i < actions.count(); ++i) { - if (actions.at(i)->softKeyRole() != QAction::NoSoftKey) { - d->requestedSoftKeyActions.insert(level, actions.at(i)); + foreach(QAction *action, source.actions()) { + if (action->softKeyRole() != QAction::NoSoftKey + && (action->isVisible() || isForceEnabledInSofkeys(action))) { + d->requestedSoftKeyActions.insert(level, action); ret = true; } } return ret; } + +static bool isChildOf(const QWidget *c, const QWidget *p) +{ + while (c) { + if (c == p) + return true; + c = c->parentWidget(); + } + return false; +} + QWidget *QSoftKeyManager::softkeySource(QWidget *previousSource, bool& recursiveMerging) { Q_D(QSoftKeyManager); QWidget *source = NULL; if (!previousSource) { // Initial source is primarily focuswidget and secondarily activeWindow - source = QApplication::focusWidget(); - if (!source) - source = QApplication::activeWindow(); + QWidget *focus = QApplication::focusWidget(); + QWidget *popup = QApplication::activePopupWidget(); + if (popup) { + if (isChildOf(focus, popup)) + source = focus; + else + source = popup; + } + if (!source) { + QWidget *modal = QApplication::activeModalWidget(); + if (modal) { + if (isChildOf(focus, modal)) + source = focus; + else + source = modal; + } + } + if (!source) { + source = focus; + if (!source) + source = QApplication::activeWindow(); + } } else { // Softkey merging is based on four criterias // 1. Implicit merging is used whenever focus widget does not specify any softkeys @@ -220,6 +252,20 @@ bool QSoftKeyManager::handleUpdateSoftKeys() return true; } +void QSoftKeyManager::setForceEnabledInSoftkeys(QAction *action) +{ + action->setProperty(FORCE_ENABLED_PROPERTY, QVariant(true)); +} + +bool QSoftKeyManager::isForceEnabledInSofkeys(QAction *action) +{ + bool ret = false; + QVariant property = action->property(FORCE_ENABLED_PROPERTY); + if (property.isValid() && property.toBool()) + ret = true; + return ret; +} + bool QSoftKeyManager::event(QEvent *e) { #ifndef QT_NO_ACTION diff --git a/src/gui/kernel/qsoftkeymanager_p.h b/src/gui/kernel/qsoftkeymanager_p.h index a6fe17e..a5b258b 100644 --- a/src/gui/kernel/qsoftkeymanager_p.h +++ b/src/gui/kernel/qsoftkeymanager_p.h @@ -63,7 +63,8 @@ QT_BEGIN_NAMESPACE class QSoftKeyManagerPrivate; -const char MENU_ACTION_PROPERTY[] = "_q_menuaction"; +const char MENU_ACTION_PROPERTY[] = "_q_menuAction"; +const char FORCE_ENABLED_PROPERTY[] = "_q_forceEnabledInSoftkeys"; class Q_AUTOTEST_EXPORT QSoftKeyManager : public QObject { @@ -88,6 +89,8 @@ public: static QAction *createAction(StandardSoftKey standardKey, QWidget *actionWidget); static QAction *createKeyedAction(StandardSoftKey standardKey, Qt::Key key, QWidget *actionWidget); static QString standardSoftKeyText(StandardSoftKey standardKey); + static void setForceEnabledInSoftkeys(QAction *action); + static bool isForceEnabledInSofkeys(QAction *action); protected: bool event(QEvent *e); diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index 3a0304c..9812d72 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -288,11 +288,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkey(CEikButtonGroupContainer &cba, TPtrC nativeText = qt_QString2TPtrC(text); int command = S60_COMMAND_START + position; setNativeSoftkey(cba, position, command, nativeText); - // QMainWindow "Options" action is set to invisible in order it does not appear in context menu - // and all invisible actions are by default disabled. - // However we never want to dim options softkey, even it is set to invisible - QVariant property = action->property(MENU_ACTION_PROPERTY); - const bool dimmed = (property.isValid() && property.toBool()) ? false : !action->isEnabled(); + const bool dimmed = !action->isEnabled() && !QSoftKeyManager::isForceEnabledInSofkeys(action); cba.DimCommand(command, dimmed); realSoftKeyActions.insert(command, action); return true; @@ -335,6 +331,7 @@ bool QSoftKeyManagerPrivateS60::setRightSoftkey(CEikButtonGroupContainer &cba) cbaHasImage[RSK_POSITION] = false; } setNativeSoftkey(cba, RSK_POSITION, EAknSoftkeyExit, nativeText); + cba.DimCommand(EAknSoftkeyExit, false); return true; } } diff --git a/src/gui/kernel/qsound.cpp b/src/gui/kernel/qsound.cpp index 165e6ce..9d8ffa5 100644 --- a/src/gui/kernel/qsound.cpp +++ b/src/gui/kernel/qsound.cpp @@ -147,12 +147,13 @@ public: supports WAVE and AU files. \row \o Mac OS X - \o NSSound is used. All formats that NSSound supports, including QuickTime formats, + \o NSSound is used. All formats that NSSound supports, including QuickTime formats, are supported by Qt for Mac OS X. \row \o Qt for Embedded Linux \o A built-in mixing sound server is used, accessing \c /dev/dsp directly. Only the WAVE format is supported. + \row \o Symbian \o CMdaAudioPlayerUtility is used. All formats that Symbian OS or devices support are supported also by Qt. diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index cedede1..7c6b754 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -212,6 +212,7 @@ private: #ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event); #endif + void handleClientAreaChange(); private: static QSymbianControl *lastFocusedControl; diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 79702af..bfa7050 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -1109,9 +1109,11 @@ void QWidget::setWindowState(Qt::WindowStates newstate) QTLWExtra *top = d->topData(); const QRect normalGeometry = (top->normalGeometry.width() < 0) ? geometry() : top->normalGeometry; - if (newstate & Qt::WindowFullScreen) - setGeometry(qApp->desktop()->availableGeometry(this)); - else if (newstate & Qt::WindowMaximized) + + 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 setGeometry(normalGeometry); diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index c77d828..af37e6e 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -1969,40 +1969,37 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option, case CE_MenuScroller: break; case CE_FocusFrame: { - // The pen width should nearly fill the layoutspacings around the widget - const int penWidth = - qMin(pixelMetric(QS60Style::PM_LayoutVerticalSpacing), pixelMetric(QS60Style::PM_LayoutHorizontalSpacing)) - - 2; // But keep 1 pixel distance to the focus widget and 1 pixel to the adjacent widgets - #ifdef QT_KEYPAD_NAVIGATION bool editFocus = false; if (const QFocusFrame *focusFrame = qobject_cast<const QFocusFrame*>(widget)) { if (focusFrame->widget() && focusFrame->widget()->hasEditFocus()) editFocus = true; } - const qreal opacity = editFocus ? 0.65 : 0.45; // Trial and error factors. Feel free to improve. + const qreal opacity = editFocus ? 1 : 0.75; // Trial and error factors. Feel free to improve. #else - const qreal opacity = 0.5; + const qreal opacity = 0.85; #endif - // Because of Qts coordinate system, we need to tweak the rect by .5 pixels, otherwise it gets blurred. - const qreal rectAdjustment = (penWidth % 2) ? -.5 : 0; - - // Make sure that the pen stroke is inside the rect - const QRectF adjustedRect = - QRectF(option->rect).adjusted( - rectAdjustment + penWidth, - rectAdjustment + penWidth, - -rectAdjustment - penWidth, - -rectAdjustment - penWidth - ); - - const qreal roundRectRadius = penWidth * goldenRatio; + // We need to reduce the focus frame size if LayoutSpacing is smaller than FocusFrameMargin + // Otherwise, we would overlay adjacent widgets. + const int frameHeightReduction = + qMin(0, pixelMetric(QStyle::PM_LayoutVerticalSpacing) + - pixelMetric(QStyle::PM_FocusFrameVMargin)); + const int frameWidthReduction = + qMin(0, pixelMetric(QStyle::PM_LayoutHorizontalSpacing) + - pixelMetric(QStyle::PM_FocusFrameHMargin)); + const int rounding = + qMin(pixelMetric(QStyle::PM_FocusFrameVMargin), + pixelMetric(QStyle::PM_LayoutVerticalSpacing)); + const QRect frameRect = + option->rect.adjusted(-frameWidthReduction, -frameHeightReduction, + frameWidthReduction, frameHeightReduction); + QPainterPath framePath; + framePath.addRoundedRect(frameRect, rounding, rounding); painter->save(); painter->setRenderHint(QPainter::Antialiasing); painter->setOpacity(opacity); - painter->setPen(QPen(option->palette.color(QPalette::Text), penWidth)); - painter->drawRoundedRect(adjustedRect, roundRectRadius, roundRectRadius); + painter->fillPath(framePath, option->palette.color(QPalette::Text)); painter->restore(); } break; diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index c000457..629db66 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -379,6 +379,15 @@ void QFontEngine::getGlyphPositions(const QGlyphLayout &glyphs, const QTransform Q_ASSERT(positions.size() == glyphs_out.size()); } +void QFontEngine::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing) +{ + glyph_metrics_t gi = boundingBox(glyph); + bool isValid = gi.isValid(); + if (leftBearing != 0) + *leftBearing = isValid ? gi.x.toReal() : 0.0; + if (rightBearing != 0) + *rightBearing = isValid ? (gi.xoff - gi.x - gi.width).toReal() : 0.0; +} glyph_metrics_t QFontEngine::tightBoundingBox(const QGlyphLayout &glyphs) { @@ -1385,6 +1394,12 @@ glyph_metrics_t QFontEngineMulti::boundingBox(const QGlyphLayout &glyphs) return overall; } +void QFontEngineMulti::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing) +{ + int which = highByte(glyph); + engine(which)->getGlyphBearings(stripped(glyph), leftBearing, rightBearing); +} + void QFontEngineMulti::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) { diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index 71ab5a5..e645caf 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -206,6 +206,8 @@ public: virtual qreal minLeftBearing() const { return qreal(); } virtual qreal minRightBearing() const { return qreal(); } + virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0); + virtual const char *name() const = 0; virtual bool canRender(const QChar *string, int len) = 0; @@ -374,6 +376,7 @@ public: virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const; virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const; virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags); + virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0); virtual QFixed ascent() const; virtual QFixed descent() const; diff --git a/src/gui/text/qfontengine_win.cpp b/src/gui/text/qfontengine_win.cpp index 1a815d3..a133b48 100644 --- a/src/gui/text/qfontengine_win.cpp +++ b/src/gui/text/qfontengine_win.cpp @@ -649,6 +649,30 @@ static const ushort char_table[] = { static const int char_table_entries = sizeof(char_table)/sizeof(ushort); +void QFontEngineWin::getGlyphBearings(glyph_t glyph, qreal *leftBearing, qreal *rightBearing) +{ + HDC hdc = shared_dc(); + SelectObject(hdc, hfont); + +#ifndef Q_WS_WINCE + if (ttf) +#endif + + { + ABC abcWidths; + GetCharABCWidthsI(hdc, glyph, 1, 0, &abcWidths); + if (leftBearing) + *leftBearing = abcWidths.abcA; + if (rightBearing) + *rightBearing = abcWidths.abcC; + } + +#ifndef Q_WS_WINCE + else { + QFontEngine::getGlyphBearings(glyph, leftBearing, rightBearing); + } +#endif +} qreal QFontEngineWin::minLeftBearing() const { diff --git a/src/gui/text/qfontengine_win_p.h b/src/gui/text/qfontengine_win_p.h index f9d8f8b..f19e48e 100644 --- a/src/gui/text/qfontengine_win_p.h +++ b/src/gui/text/qfontengine_win_p.h @@ -106,6 +106,8 @@ public: virtual QImage alphaMapForGlyph(glyph_t, const QTransform &xform); virtual QImage alphaRGBMapForGlyph(glyph_t t, int margin, const QTransform &xform); + virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0); + int getGlyphIndexes(const QChar *ch, int numChars, QGlyphLayout *glyphs, bool mirrored) const; void getCMap(); diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index 41d0af1..44a18de 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -472,8 +472,9 @@ int QFontMetrics::leftBearing(QChar ch) const int nglyphs = 9; engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0); // ### can nglyphs != 1 happen at all? Not currently I think - glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]); - return qRound(gi.x); + qreal lb; + engine->getGlyphBearings(glyphs.glyphs[0], &lb); + return qRound(lb); } /*! @@ -506,8 +507,9 @@ int QFontMetrics::rightBearing(QChar ch) const int nglyphs = 9; engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0); // ### can nglyphs != 1 happen at all? Not currently I think - glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]); - return qRound(gi.xoff - gi.x - gi.width); + qreal rb; + engine->getGlyphBearings(glyphs.glyphs[0], 0, &rb); + return qRound(rb); } /*! @@ -1317,8 +1319,9 @@ qreal QFontMetricsF::leftBearing(QChar ch) const int nglyphs = 9; engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0); // ### can nglyphs != 1 happen at all? Not currently I think - glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]); - return gi.x.toReal(); + qreal lb; + engine->getGlyphBearings(glyphs.glyphs[0], &lb); + return lb; } /*! @@ -1351,8 +1354,10 @@ qreal QFontMetricsF::rightBearing(QChar ch) const int nglyphs = 9; engine->stringToCMap(&ch, 1, &glyphs, &nglyphs, 0); // ### can nglyphs != 1 happen at all? Not currently I think - glyph_metrics_t gi = engine->boundingBox(glyphs.glyphs[0]); - return (gi.xoff - gi.x - gi.width).toReal(); + qreal rb; + engine->getGlyphBearings(glyphs.glyphs[0], 0, &rb); + return rb; + } /*! diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 204effa..3c0e85e 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -1688,9 +1688,9 @@ namespace { if (currentPosition <= 0) return; - glyph_metrics_t gi = fontEngine->boundingBox(currentGlyph()); - if (gi.isValid()) - rightBearing = qMin(QFixed(), gi.xoff - gi.x - gi.width); + qreal rb; + fontEngine->getGlyphBearings(currentGlyph(), 0, &rb); + rightBearing = qMin(QFixed(), QFixed::fromReal(rb)); } inline void resetRightBearing() diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 42b7406..a9978f9 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -168,8 +168,8 @@ void QMenuPrivate::init() #ifdef QT_SOFTKEYS_ENABLED selectAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::SelectSoftKey, Qt::Key_Select, q); cancelAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::CancelSoftKey, Qt::Key_Back, q); - selectAction->setVisible(false); // Don't show these in the menu - cancelAction->setVisible(false); + selectAction->setPriority(QAction::HighPriority); + cancelAction->setPriority(QAction::HighPriority); q->addAction(selectAction); q->addAction(cancelAction); #endif diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index 13aa02b..e368d3d 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -1404,7 +1404,6 @@ void QMenuBarPrivate::handleReparent() if (!menuBarAction) { if (newParent) { menuBarAction = QSoftKeyManager::createAction(QSoftKeyManager::MenuSoftKey, newParent); - menuBarAction->setVisible(false); newParent->addAction(menuBarAction); } } else { diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 7150fb7..6894978 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -479,6 +479,7 @@ void QHostInfoRunnable::run() QHostInfoLookupManager::QHostInfoLookupManager() : mutex(QMutex::Recursive), wasDeleted(false) { moveToThread(QCoreApplicationPrivate::mainThread()); + connect(QCoreApplication::instance(), SIGNAL(destroyed()), SLOT(waitForThreadPoolDone()), Qt::DirectConnection); threadPool.setMaxThreadCount(5); // do 5 DNS lookups in parallel } diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h index 2b26b07..4fc74e9 100644 --- a/src/network/kernel/qhostinfo_p.h +++ b/src/network/kernel/qhostinfo_p.h @@ -184,6 +184,9 @@ protected: QMutex mutex; bool wasDeleted; + +private slots: + void waitForThreadPoolDone() { threadPool.waitForDone(); } }; #endif diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index cb5255d..d602790 100644 --- a/src/openvg/qpixmapdata_vg.cpp +++ b/src/openvg/qpixmapdata_vg.cpp @@ -464,8 +464,8 @@ void QVGPixmapData::cleanup() void QVGPixmapData::fromNativeType(void* pixmap, NativeType type) { -#if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL) if (type == QPixmapData::SgImage && pixmap) { +#if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL) RSgImage *sgImage = reinterpret_cast<RSgImage*>(pixmap); destroyImages(); @@ -536,6 +536,7 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type) // release stuff eglDestroyImageKHR(QEglContext::display(), eglImage); driver.Close(); +#endif } else if (type == QPixmapData::FbsBitmap) { CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap*>(pixmap); @@ -581,16 +582,12 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type) if(deleteSourceBitmap) delete bitmap; } -#else - Q_UNUSED(pixmap); - Q_UNUSED(type); -#endif } void* QVGPixmapData::toNativeType(NativeType type) { -#if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL) if (type == QPixmapData::SgImage) { +#if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL) toVGImage(); if (!isValid() || vgImage == VG_INVALID_HANDLE) @@ -657,6 +654,7 @@ void* QVGPixmapData::toNativeType(NativeType type) eglDestroyImageKHR(QEglContext::display(), eglImage); driver.Close(); return reinterpret_cast<void*>(sgImage); +#endif } else if (type == QPixmapData::FbsBitmap) { CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); @@ -678,10 +676,7 @@ void* QVGPixmapData::toNativeType(NativeType type) return reinterpret_cast<void*>(bitmap); } -#else - Q_UNUSED(type); return 0; -#endif } #endif //Q_OS_SYMBIAN |