diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-17 23:11:22 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-17 23:11:22 (GMT) |
commit | 2c07b5d2cba8d8e499bd0861eefef12d4e00d99a (patch) | |
tree | 3e6b31daecfe217b355fa973f2f122da8468c0ac /src | |
parent | cb2980a09aefcc207eacb500d5a3c74f064859dd (diff) | |
parent | 3773fcb78db02a2577c89f755c07c2c7dbf0de74 (diff) | |
download | Qt-2c07b5d2cba8d8e499bd0861eefef12d4e00d99a.zip Qt-2c07b5d2cba8d8e499bd0861eefef12d4e00d99a.tar.gz Qt-2c07b5d2cba8d8e499bd0861eefef12d4e00d99a.tar.bz2 |
Merge branch 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-4.8-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (55 commits)
Fix thread safety regression of QNetworkConfigurationManager
Fix instability in QNetworkConfigurationManager autotest
Support word selection list with predictive text from splitview
Fix softkey icon positioning in S60 5.3
QDeclarativeMouseArea: block context menu events
ListViews loses items if all visible items are removed.
Make TextEdit word selection more natural.
Clear confusion between QMainWindow and QMainWindowLayout.
Fix for rounded corners bug in QMenu
Compile
QWidgetPrivate::setParent_sys might be using null pointer
Ensure the TextEdit cursor delegate is repositioned on mouse events.
Don't crash on an invalid replacementStart from an input method.
Fix incorrect hardware address on systems without getifaddrs()
Enable multisampling on Symbian if hw supports it
Fix QtCoreu.def file error
Introduce platform extension to QGraphicsSystem
Fix Symbian/WinsCW build break
Prevent crash in OpenGL engine when scaling images / pixmaps.
emit QNetWorkAccessManager::finished on QNetworkReply::abort()
...
Diffstat (limited to 'src')
43 files changed, 492 insertions, 93 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index aca1cb1..005e90a 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -450,10 +450,11 @@ QLibraryInfo::location(LibraryLocation loc) } if (QDir::isRelativePath(ret)) { + QString baseDir; if (loc == PrefixPath) { // we make the prefix path absolute to the executable's directory #ifdef BOOTSTRAPPING - return QFileInfo(qmake_libraryInfoFile()).absolutePath(); + baseDir = QFileInfo(qmake_libraryInfoFile()).absolutePath(); #else if (QCoreApplication::instance()) { #ifdef Q_OS_MAC @@ -466,15 +467,16 @@ QLibraryInfo::location(LibraryLocation loc) } } #endif - return QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(ret); + baseDir = QCoreApplication::applicationDirPath(); } else { - return QDir::current().absoluteFilePath(ret); + baseDir = QDir::currentPath(); } #endif } else { // we make any other path absolute to the prefix directory - return QDir(location(PrefixPath)).absoluteFilePath(ret); + baseDir = location(PrefixPath); } + ret = QDir::cleanPath(baseDir + QLatin1Char('/') + ret); } return ret; } diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index f30831d..a3395a4 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -1499,6 +1499,7 @@ void QDeclarativeGridView::setDelegate(QDeclarativeComponent *delegate) d->ownModel = true; } if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) { + int oldCount = dataModel->count(); dataModel->setDelegate(delegate); if (isComponentComplete()) { for (int i = 0; i < d->visibleItems.count(); ++i) @@ -1516,6 +1517,8 @@ void QDeclarativeGridView::setDelegate(QDeclarativeComponent *delegate) } d->moveReason = QDeclarativeGridViewPrivate::Other; } + if (oldCount != dataModel->count()) + emit countChanged(); emit delegateChanged(); } } diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 3190d7e..ef6b032 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -733,6 +733,7 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer) if (doBuffer && (bufferMode & BufferBefore)) fillFrom = bufferFrom; + bool haveValidItems = false; int modelIndex = visibleIndex; qreal itemEnd = visiblePos-1; if (!visibleItems.isEmpty()) { @@ -741,11 +742,13 @@ void QDeclarativeListViewPrivate::refill(qreal from, qreal to, bool doBuffer) int i = visibleItems.count() - 1; while (i > 0 && visibleItems.at(i)->index == -1) --i; - if (visibleItems.at(i)->index != -1) + if (visibleItems.at(i)->index != -1) { + haveValidItems = true; modelIndex = visibleItems.at(i)->index + 1; + } } - if (visibleItems.count() && (fillFrom > itemEnd+averageSize+spacing + if (haveValidItems && (fillFrom > itemEnd+averageSize+spacing || fillTo < visiblePos - averageSize - spacing)) { // We've jumped more than a page. Estimate which items are now // visible and fill from there. @@ -1813,6 +1816,7 @@ void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate) d->ownModel = true; } if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) { + int oldCount = dataModel->count(); dataModel->setDelegate(delegate); if (isComponentComplete()) { for (int i = 0; i < d->visibleItems.count(); ++i) @@ -1831,6 +1835,8 @@ void QDeclarativeListView::setDelegate(QDeclarativeComponent *delegate) } d->updateViewport(); } + if (oldCount != dataModel->count()) + emit countChanged(); } emit delegateChanged(); } @@ -3403,9 +3409,9 @@ void QDeclarativeListView::itemsRemoved(int modelIndex, int count) } } - if (removedVisible && !haveVisibleIndex) { + if (!haveVisibleIndex) { d->timeline.clear(); - if (d->itemCount == 0) { + if (removedVisible && d->itemCount == 0) { d->visibleIndex = 0; d->visiblePos = d->header ? d->header->size() : 0; d->setPosition(0); diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp index d4e7f7b..6633256 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp +++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp @@ -660,6 +660,32 @@ void QDeclarativeMouseArea::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) setHovered(false); } +#ifndef QT_NO_CONTEXTMENU +void QDeclarativeMouseArea::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) +{ + bool acceptsContextMenuButton; +#if defined(Q_OS_SYMBIAN) + // In Symbian a Long Tap on the screen will trigger. See QSymbianControl::HandleLongTapEventL(). + acceptsContextMenuButton = acceptedButtons() & Qt::LeftButton; +#elif defined(Q_WS_WINCE) + // ### WinCE can trigger context menu event with a gesture in the left button or a + // click with the right button. Since we have no way here to differentiate them when + // event happens, accepting either of the them will block the event. + acceptsContextMenuButton = acceptedButtons() & (Qt::LeftButton | Qt::RightButton); +#else + acceptsContextMenuButton = acceptedButtons() & Qt::RightButton; +#endif + + if (isEnabled() && event->reason() == QGraphicsSceneContextMenuEvent::Mouse + && acceptsContextMenuButton) { + // Do not let the context menu event propagate to items behind. + return; + } + + QDeclarativeItem::contextMenuEvent(event); +} +#endif // QT_NO_CONTEXTMENU + bool QDeclarativeMouseArea::sceneEvent(QEvent *event) { bool rv = QDeclarativeItem::sceneEvent(event); diff --git a/src/declarative/graphicsitems/qdeclarativemousearea_p.h b/src/declarative/graphicsitems/qdeclarativemousearea_p.h index 351d4de..0fe8c6a 100644 --- a/src/declarative/graphicsitems/qdeclarativemousearea_p.h +++ b/src/declarative/graphicsitems/qdeclarativemousearea_p.h @@ -190,6 +190,9 @@ protected: void hoverEnterEvent(QGraphicsSceneHoverEvent *event); void hoverMoveEvent(QGraphicsSceneHoverEvent *event); void hoverLeaveEvent(QGraphicsSceneHoverEvent *event); +#ifndef QT_NO_CONTEXTMENU + void contextMenuEvent(QGraphicsSceneContextMenuEvent *event); +#endif // QT_NO_CONTEXTMENU bool sceneEvent(QEvent *); bool sendMouseEvent(QGraphicsSceneMouseEvent *event); bool sceneEventFilter(QGraphicsItem *i, QEvent *e); diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp index aed849b..be2bd60 100644 --- a/src/declarative/graphicsitems/qdeclarativepathview.cpp +++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp @@ -1021,9 +1021,12 @@ void QDeclarativePathView::setDelegate(QDeclarativeComponent *delegate) d->ownModel = true; } if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) { + int oldCount = dataModel->count(); dataModel->setDelegate(delegate); d->modelCount = dataModel->count(); d->regenerate(); + if (oldCount != dataModel->count()) + emit countChanged(); emit delegateChanged(); } } diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index 7f74da4..253d744 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -1451,6 +1451,7 @@ QByteArray QDeclarativePropertyPrivate::saveValueType(const QMetaObject *metaObj QMetaProperty subProp = subObject->property(subIndex); ValueTypeSerializedData sd; + memset(&sd, 0, sizeof(sd)); sd.isValueType = true; sd.core.load(metaObject->property(index)); sd.valueType.flags = QDeclarativePropertyCache::Data::flagsForProperty(subProp); @@ -1465,6 +1466,7 @@ QByteArray QDeclarativePropertyPrivate::saveValueType(const QMetaObject *metaObj QByteArray QDeclarativePropertyPrivate::saveProperty(const QMetaObject *metaObject, int index) { SerializedData sd; + memset(&sd, 0, sizeof(sd)); sd.isValueType = false; sd.core.load(metaObject->property(index)); diff --git a/src/declarative/qml/qmetaobjectbuilder.cpp b/src/declarative/qml/qmetaobjectbuilder.cpp index a63656b..d8a7b77 100644 --- a/src/declarative/qml/qmetaobjectbuilder.cpp +++ b/src/declarative/qml/qmetaobjectbuilder.cpp @@ -1452,6 +1452,7 @@ QMetaObject *QMetaObjectBuilder::toMetaObject() const { int size = buildMetaObject(d, 0, false); char *buf = reinterpret_cast<char *>(qMalloc(size)); + memset(buf, 0, size); buildMetaObject(d, buf, false); return reinterpret_cast<QMetaObject *>(buf); } @@ -1481,6 +1482,7 @@ QByteArray QMetaObjectBuilder::toRelocatableData(bool *ok) const QByteArray data; data.resize(size); char *buf = data.data(); + memset(buf, 0, size); buildMetaObject(d, buf, true); if (ok) *ok = true; return data; diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 50b372e..25f6295 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4449,6 +4449,8 @@ QImage QImage::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Transf QSize newSize = size(); newSize.scale(s, aspectMode); + newSize.rwidth() = qMax(newSize.width(), 1); + newSize.rheight() = qMax(newSize.height(), 1); if (newSize == size()) return *this; diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index c34f6ac..640864d 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1514,6 +1514,8 @@ QPixmap QPixmap::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Tran QSize newSize = size(); newSize.scale(s, aspectMode); + newSize.rwidth() = qMax(newSize.width(), 1); + newSize.rheight() = qMax(newSize.height(), 1); if (newSize == size()) return *this; diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index a4d53c0..23109e1 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -240,21 +240,6 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) return false; switch (event->type()) { - case QEvent::MouseButtonPress: - // Alphanumeric keypad doesn't like it when we click and text is still getting displayed - // It ignores the mouse event, so we need to commit and send a selection event (which will get triggered - // after the commit) - if (!m_preeditString.isEmpty()) { - commitCurrentString(true); - - int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt(); - - QList<QInputMethodEvent::Attribute> selectAttributes; - selectAttributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos, 0, QVariant()); - QInputMethodEvent selectEvent(QLatin1String(""), selectAttributes); - sendEvent(selectEvent); - } - break; case QEvent::KeyPress: commitTemporaryPreeditString(); // fall through intended @@ -333,7 +318,10 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) if (sControl) { sControl->setIgnoreFocusChanged(false); } - return true; + //If m_pointerHandler has already been set, it means that fep inline editing is in progress. + //When this is happening, do not filter out pointer events. + if (!m_pointerHandler) + return true; } return false; @@ -385,18 +373,31 @@ void QCoeFepInputContext::commitTemporaryPreeditString() commitCurrentString(false); } -void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event) +void QCoeFepInputContext::mouseHandler(int x, QMouseEvent *event) { Q_ASSERT(focusWidget()); if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::LeftButton) { - commitCurrentString(true); - int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt(); + QWidget *proxy = focusWidget()->focusProxy(); + Qt::InputMethodHints currentHints = proxy ? proxy->inputMethodHints() : focusWidget()->inputMethodHints(); + + //If splitview is open and T9 word is tapped, pass the pointer event to pointer handler. + //This will open the "suggested words" list. Pass pointer position always as zero, to make + //full word replacement in case user makes a selection. + if (S60->partial_keyboard && S60->partialKeyboardOpen + && m_pointerHandler + && !(currentHints & Qt::ImhNoPredictiveText) + && (x > 0 && x < m_preeditString.length())) { + m_pointerHandler->HandlePointerEventInInlineTextL(TPointerEvent::EButton1Up, 0, 0); + } else { + commitCurrentString(true); + int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt(); - QList<QInputMethodEvent::Attribute> attributes; - attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos + x, 0, QVariant()); - QInputMethodEvent event(QLatin1String(""), attributes); - sendEvent(event); + QList<QInputMethodEvent::Attribute> attributes; + attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, pos + x, 0, QVariant()); + QInputMethodEvent event(QLatin1String(""), attributes); + sendEvent(event); + } } } diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 68c1ab5..815d221 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1490,8 +1490,10 @@ void QSymbianControl::HandleResourceChange(int resourceType) } if (ic && isSplitViewWidget(widget)) { if (resourceType == KSplitViewCloseEvent) { + S60->partialKeyboardOpen = false; ic->resetSplitViewWidget(); } else { + S60->partialKeyboardOpen = true; ic->ensureFocusWidgetVisible(widget); } } diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp index d80cf8a..71ae520 100644 --- a/src/gui/kernel/qsoftkeymanager_s60.cpp +++ b/src/gui/kernel/qsoftkeymanager_s60.cpp @@ -176,22 +176,27 @@ void QSoftKeyManagerPrivateS60::setNativeSoftkey(CEikButtonGroupContainer &cba, QPoint QSoftKeyManagerPrivateS60::softkeyIconPosition(int position, QSize sourceSize, QSize targetSize) { QPoint iconPosition(0,0); - switch( AknLayoutUtils::CbaLocation() ) - { - case AknLayoutUtils::EAknCbaLocationBottom: - // RSK must be moved to right, LSK in on correct position by default - if (position == RSK_POSITION) - iconPosition.setX(targetSize.width() - sourceSize.width()); - break; - case AknLayoutUtils::EAknCbaLocationRight: - case AknLayoutUtils::EAknCbaLocationLeft: - // Already in correct position - default: - break; - } - // Align horizontally to center - iconPosition.setY((targetSize.height() - sourceSize.height()) >> 1); + // Prior to S60 5.3 icons need to be properly positioned to buttons, but starting with 5.3 + // positioning is done on Avkon side. + if (QSysInfo::s60Version() < QSysInfo::SV_S60_5_3) { + switch (AknLayoutUtils::CbaLocation()) + { + case AknLayoutUtils::EAknCbaLocationBottom: + // RSK must be moved to right, LSK in on correct position by default + if (position == RSK_POSITION) + iconPosition.setX(targetSize.width() - sourceSize.width()); + break; + case AknLayoutUtils::EAknCbaLocationRight: + case AknLayoutUtils::EAknCbaLocationLeft: + // Already in correct position + default: + break; + } + + // Align horizontally to center + iconPosition.setY((targetSize.height() - sourceSize.height()) >> 1); + } return iconPosition; } diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index 4640393..0023649 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -160,6 +160,7 @@ public: int orientationSet : 1; int partial_keyboard : 1; int partial_keyboardAutoTranslation : 1; + int partialKeyboardOpen : 1; QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type QPointer<QWidget> splitViewLastWidget; @@ -351,6 +352,7 @@ inline QS60Data::QS60Data() orientationSet(0), partial_keyboard(0), partial_keyboardAutoTranslation(1), + partialKeyboardOpen(0), s60ApplicationFactory(0) #ifdef Q_OS_SYMBIAN ,s60InstalledTrapHandler(0) diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 4c1a6dd..9556169 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -299,6 +299,7 @@ QWidgetPrivate::QWidgetPrivate(int version) #ifndef QT_NO_IM , inheritsInputMethodHints(0) #endif + , inSetParent(0) #if defined(Q_WS_X11) , picture(0) #elif defined(Q_WS_WIN) @@ -2589,6 +2590,22 @@ WId QWidget::effectiveWinId() const if (id || !testAttribute(Qt::WA_WState_Created)) return id; QWidget *realParent = nativeParentWidget(); + if (!realParent && d_func()->inSetParent) { + // In transitional state. This is really just a workaround. The real problem + // is that QWidgetPrivate::setParent_sys (platform specific code) first sets + // the window id to 0 (setWinId(0)) before it sets the Qt::WA_WState_Created + // attribute to false. The correct way is to do it the other way around, and + // in that case the Qt::WA_WState_Created logic above will kick in and + // return 0 whenever the widget is in a transitional state. However, changing + // the original logic for all platforms is far more intrusive and might + // break existing applications. + // Note: The widget can only be in a transitional state when changing its + // parent -- everything else is an internal error -- hence explicitly checking + // against 'inSetParent' rather than doing an unconditional return whenever + // 'realParent' is 0 (which may cause strange artifacts and headache later). + return 0; + } + // This widget *must* have a native parent widget. Q_ASSERT(realParent); Q_ASSERT(realParent->internalWinId()); return realParent->internalWinId(); @@ -10101,6 +10118,7 @@ void QWidget::setParent(QWidget *parent) void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) { Q_D(QWidget); + d->inSetParent = true; bool resized = testAttribute(Qt::WA_Resized); bool wasCreated = testAttribute(Qt::WA_WState_Created); QWidget *oldtlw = window(); @@ -10261,6 +10279,8 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) ancestorProxy->d_func()->embedSubWindow(this); } #endif + + d->inSetParent = false; } /*! diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 919f8bc..acf1860 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -232,6 +232,7 @@ struct QTLWExtra { #elif defined(Q_OS_SYMBIAN) uint inExpose : 1; // Prevents drawing recursion uint nativeWindowTransparencyEnabled : 1; // Tracks native window transparency + uint forcedToRaster : 1; #elif defined(Q_WS_QPA) QPlatformWindow *platformWindow; QPlatformWindowFormat platformWindowFormat; @@ -770,6 +771,7 @@ public: #ifndef QT_NO_IM uint inheritsInputMethodHints : 1; #endif + uint inSetParent : 1; // *************************** Platform specific ************************************ #if defined(Q_WS_X11) // <----------------------------------------------------------- X11 diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 5e9584b..c011cf1 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -578,6 +578,11 @@ void QWidgetPrivate::show_sys() if (isFullscreen) { const bool cbaVisible = S60->buttonGroupContainer() && S60->buttonGroupContainer()->IsVisible(); S60->setStatusPaneAndButtonGroupVisibility(false, cbaVisible); + if (cbaVisible) { + // Fix window dimensions as without screen furniture they will have + // defaulted to full screen dimensions initially. + id->handleClientAreaChange(); + } } } } @@ -792,7 +797,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) adjustFlags(data.window_flags, q); // keep compatibility with previous versions, we need to preserve the created state // (but we recreate the winId for the widget being reparented, again for compatibility) - if (wasCreated || (!q->isWindow() && parent->testAttribute(Qt::WA_WState_Created))) + if (wasCreated || (!q->isWindow() && parent && parent->testAttribute(Qt::WA_WState_Created))) createWinId(); if (q->isWindow() || (!parent || parent->isVisible()) || explicitlyHidden) q->setAttribute(Qt::WA_WState_Hidden); @@ -835,7 +840,8 @@ void QWidgetPrivate::s60UpdateIsOpaque() RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow()); #ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE - if (QApplicationPrivate::instance()->useTranslucentEGLSurfaces) { + if (QApplicationPrivate::instance()->useTranslucentEGLSurfaces + && !extra->topextra->forcedToRaster) { window->SetSurfaceTransparency(!isOpaque); extra->topextra->nativeWindowTransparencyEnabled = !isOpaque; return; @@ -1019,6 +1025,7 @@ void QWidgetPrivate::createTLSysExtra() { extra->topextra->inExpose = 0; extra->topextra->nativeWindowTransparencyEnabled = 0; + extra->topextra->forcedToRaster = 0; } void QWidgetPrivate::deleteTLSysExtra() diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri index 65e7af4..f1496b1 100644 --- a/src/gui/painting/painting.pri +++ b/src/gui/painting/painting.pri @@ -9,6 +9,7 @@ HEADERS += \ painting/qdrawutil.h \ painting/qemulationpaintengine_p.h \ painting/qgraphicssystem_p.h \ + painting/qgraphicssystemex_p.h \ painting/qmatrix.h \ painting/qmemrotate_p.h \ painting/qoutlinemapper_p.h \ @@ -249,8 +250,10 @@ embedded { symbian { HEADERS += painting/qwindowsurface_s60_p.h \ - painting/qdrawhelper_arm_simd_p.h - SOURCES += painting/qwindowsurface_s60.cpp + painting/qdrawhelper_arm_simd_p.h \ + painting/qgraphicssystemex_symbian_p.h + SOURCES += painting/qwindowsurface_s60.cpp \ + painting/qgraphicssystemex_symbian.cpp armccIfdefBlock = \ "$${LITERAL_HASH}if defined(ARMV6)" \ "MACRO QT_HAVE_ARM_SIMD" \ diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp index 171ef46..d82fdc9 100644 --- a/src/gui/painting/qgraphicssystem.cpp +++ b/src/gui/painting/qgraphicssystem.cpp @@ -55,6 +55,9 @@ #endif #ifdef Q_OS_SYMBIAN # include <private/qpixmap_s60_p.h> +# include <private/qgraphicssystemex_symbian_p.h> +#else +# include <private/qgraphicssystemex_p.h> #endif QT_BEGIN_NAMESPACE @@ -89,9 +92,18 @@ QPixmapData *QGraphicsSystem::createPixmapData(QPixmapData *origin) return createPixmapData(origin->pixelType()); } -void QGraphicsSystem::releaseCachedResources() +#ifdef Q_OS_SYMBIAN +Q_GLOBAL_STATIC(QSymbianGraphicsSystemEx, symbianPlatformExtension) +#endif + +QGraphicsSystemEx* QGraphicsSystem::platformExtension() { - // Do nothing here +#ifdef Q_OS_SYMBIAN + // this is used on raster graphics systems. HW accelerated + // graphics systems will overwrite this function. + return symbianPlatformExtension(); +#endif + return 0; } QT_END_NAMESPACE diff --git a/src/gui/painting/qgraphicssystem_p.h b/src/gui/painting/qgraphicssystem_p.h index 0f99a31..275f9eb 100644 --- a/src/gui/painting/qgraphicssystem_p.h +++ b/src/gui/painting/qgraphicssystem_p.h @@ -63,6 +63,7 @@ QT_BEGIN_NAMESPACE class QPixmapFilter; class QBlittable; +class QGraphicsSystemEx; class Q_GUI_EXPORT QGraphicsSystem { @@ -77,7 +78,7 @@ public: // to have a graphics system. static QPixmapData *createDefaultPixmapData(QPixmapData::PixelType type); - virtual void releaseCachedResources(); + virtual QGraphicsSystemEx* platformExtension(); }; QT_END_NAMESPACE diff --git a/src/gui/painting/qgraphicssystemex_p.h b/src/gui/painting/qgraphicssystemex_p.h new file mode 100644 index 0000000..6feb116 --- /dev/null +++ b/src/gui/painting/qgraphicssystemex_p.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QGRAPHICSSYSTEMEX_P_H +#define QGRAPHICSSYSTEMEX_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <qglobal.h> + +QT_BEGIN_NAMESPACE + +class Q_GUI_EXPORT QGraphicsSystemEx +{ +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/gui/painting/qgraphicssystemex_symbian.cpp b/src/gui/painting/qgraphicssystemex_symbian.cpp new file mode 100644 index 0000000..2d3f137 --- /dev/null +++ b/src/gui/painting/qgraphicssystemex_symbian.cpp @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qgraphicssystemex_symbian_p.h" +#include "private/qwidget_p.h" +#include "private/qbackingstore_p.h" +#include "private/qapplication_p.h" + +#include <QDebug> + +QT_BEGIN_NAMESPACE + +void QSymbianGraphicsSystemEx::releaseCachedGpuResources() +{ + // Do nothing here + // This is implemented in graphics system specific plugin +} + +void QSymbianGraphicsSystemEx::releaseAllGpuResources() +{ + releaseCachedGpuResources(); + + foreach (QWidget *widget, QApplication::topLevelWidgets()) { + if (QTLWExtra *topExtra = qt_widget_private(widget)->maybeTopData()) + topExtra->backingStore.destroy(); + } +} + +bool QSymbianGraphicsSystemEx::hasBCM2727() +{ + return !QApplicationPrivate::instance()->useTranslucentEGLSurfaces; +} + +void QSymbianGraphicsSystemEx::forceToRaster(QWidget *window) +{ + if (window && window->isWindow()) { + qt_widget_private(window)->createTLExtra(); + if (QTLWExtra *topExtra = qt_widget_private(window)->maybeTopData()) { + topExtra->forcedToRaster = 1; + if (topExtra->backingStore.data()) { + topExtra->backingStore.create(window); + topExtra->backingStore.registerWidget(window); + } + } + } +} + +QT_END_NAMESPACE diff --git a/src/gui/painting/qgraphicssystemex_symbian_p.h b/src/gui/painting/qgraphicssystemex_symbian_p.h new file mode 100644 index 0000000..0b1e39e --- /dev/null +++ b/src/gui/painting/qgraphicssystemex_symbian_p.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QSYMBIANGRAPHICSSYSTEMEX_P_H +#define QSYMBIANGRAPHICSSYSTEMEX_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "private/qgraphicssystemex_p.h" + +QT_BEGIN_NAMESPACE + +class QWidget; + +class Q_GUI_EXPORT QSymbianGraphicsSystemEx : public QGraphicsSystemEx +{ +public: + virtual void releaseCachedGpuResources(); + virtual void releaseAllGpuResources(); + virtual bool hasBCM2727(); + virtual void forceToRaster(QWidget *window); +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 4dae2a3..9d4a21a 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -1751,6 +1751,7 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe } else { glyphSet = &defaultGlyphSet; } + bool needsDelete = false; Glyph * g = glyphSet->getGlyph(glyph); if (!g || g->format != format) { face = lockFace(); @@ -1758,6 +1759,7 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe FT_Matrix_Multiply(&glyphSet->transformationMatrix, &m); freetype->matrix = m; g = loadGlyph(glyphSet, glyph, subPixelPosition, format); + needsDelete = true; } if (g) { @@ -1766,6 +1768,8 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe overall.width = g->width; overall.height = g->height; overall.xoff = g->advance; + if (needsDelete) + delete g; } else { int left = FLOOR(face->glyph->metrics.horiBearingX); int right = CEIL(face->glyph->metrics.horiBearingX + face->glyph->metrics.width); diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 4396730..a8bf763 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -677,7 +677,7 @@ void QTextControlPrivate::extendWordwiseSelection(int suggestedNewPosition, qrea const qreal wordEndX = line.cursorToX(curs.position() - blockPos) + blockCoordinates.x(); - if (mouseXPosition < wordStartX || mouseXPosition > wordEndX) + if (!wordSelectionEnabled && (mouseXPosition < wordStartX || mouseXPosition > wordEndX)) return; // keep the already selected word even when moving to the left @@ -1579,8 +1579,10 @@ void QTextControlPrivate::mousePressEvent(QEvent *e, Qt::MouseButton button, con emit q->cursorPositionChanged(); _q_updateCurrentCharFormatAndSelection(); } else { - if (cursor.position() != oldCursorPos) + if (cursor.position() != oldCursorPos) { emit q->cursorPositionChanged(); + emit q->microFocusChanged(); + } selectionChanged(); } repaintOldAndNewSelection(oldSelection); diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp index 8dabcc7..b7e05d2 100644 --- a/src/gui/text/qtextobject.cpp +++ b/src/gui/text/qtextobject.cpp @@ -891,11 +891,6 @@ QTextBlockUserData::~QTextBlockUserData() Returns true if this text block is valid; otherwise returns false. */ -bool QTextBlock::isValid() const -{ - return p != 0 && p->blockMap().isValid(n); -} - /*! \fn QTextBlock &QTextBlock::operator=(const QTextBlock &other) @@ -1493,7 +1488,7 @@ QTextBlock::iterator QTextBlock::end() const */ QTextBlock QTextBlock::next() const { - if (!isValid()) + if (!isValid() || !p->blockMap().isValid(n)) return QTextBlock(); return QTextBlock(p, p->blockMap().next(n)); diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h index 1588349..a443e79 100644 --- a/src/gui/text/qtextobject.h +++ b/src/gui/text/qtextobject.h @@ -205,7 +205,7 @@ public: inline QTextBlock(const QTextBlock &o) : p(o.p), n(o.n) {} inline QTextBlock &operator=(const QTextBlock &o) { p = o.p; n = o.n; return *this; } - bool isValid() const; + inline bool isValid() const { return p != 0 && n != 0; } inline bool operator==(const QTextBlock &o) const { return p == o.p && n == o.n; } inline bool operator!=(const QTextBlock &o) const { return p != o.p || n != o.n; } diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index 2a15555..c9dae77 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -435,6 +435,8 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) c += event->commitString().length() - qMin(-event->replacementStart(), event->replacementLength()); m_cursor += event->replacementStart(); + if (m_cursor < 0) + m_cursor = 0; // insert commit string if (event->replacementLength()) { @@ -447,7 +449,7 @@ void QLineControl::processInputMethodEvent(QInputMethodEvent *event) cursorPositionChanged = true; } - m_cursor = qMin(c, m_text.length()); + m_cursor = qBound(0, c, m_text.length()); for (int i = 0; i < event->attributes().size(); ++i) { const QInputMethodEvent::Attribute &a = event->attributes().at(i); diff --git a/src/gui/widgets/qmainwindow.cpp b/src/gui/widgets/qmainwindow.cpp index 43d6796..e39e595 100644 --- a/src/gui/widgets/qmainwindow.cpp +++ b/src/gui/widgets/qmainwindow.cpp @@ -78,7 +78,6 @@ public: : layout(0), explicitIconSize(false), toolButtonStyle(Qt::ToolButtonIconOnly) #ifdef Q_WS_MAC , useHIToolBar(false) - , activateUnifiedToolbarAfterFullScreen(false) #endif #if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_CURSOR) , hasOldCursor(false) , cursorAdjusted(false) @@ -90,7 +89,6 @@ public: Qt::ToolButtonStyle toolButtonStyle; #ifdef Q_WS_MAC bool useHIToolBar; - bool activateUnifiedToolbarAfterFullScreen; #endif void init(); QList<int> hoverSeparator; diff --git a/src/gui/widgets/qmainwindowlayout.cpp b/src/gui/widgets/qmainwindowlayout.cpp index d4afe07..8880ca9 100644 --- a/src/gui/widgets/qmainwindowlayout.cpp +++ b/src/gui/widgets/qmainwindowlayout.cpp @@ -1699,6 +1699,7 @@ QMainWindowLayout::QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLay , gapIndicator(new QRubberBand(QRubberBand::Rectangle, mainwindow)) #endif //QT_NO_RUBBERBAND #ifdef Q_WS_MAC + , activateUnifiedToolbarAfterFullScreen(false) , blockVisiblityCheck(false) #endif { diff --git a/src/gui/widgets/qmainwindowlayout_p.h b/src/gui/widgets/qmainwindowlayout_p.h index 20aca61..0442510 100644 --- a/src/gui/widgets/qmainwindowlayout_p.h +++ b/src/gui/widgets/qmainwindowlayout_p.h @@ -338,7 +338,6 @@ public: void removeFromMacToolbar(QToolBar *toolbar); void cleanUpMacToolbarItems(); void fixSizeInUnifiedToolbar(QToolBar *tb) const; - bool useHIToolBar; bool activateUnifiedToolbarAfterFullScreen; void syncUnifiedToolbarVisibility(); bool blockVisiblityCheck; diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index b0ea00f..1dac661 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -82,6 +82,10 @@ # include <private/qt_cocoa_helpers_mac_p.h> #endif +#ifdef Q_WS_S60 +# include "private/qt_s60_p.h" +#endif + QT_BEGIN_NAMESPACE @@ -172,6 +176,14 @@ void QMenuPrivate::init() q->addAction(selectAction); q->addAction(cancelAction); #endif + +#ifdef Q_WS_S60 + if (S60->avkonComponentsSupportTransparency) { + bool noSystemBackground = q->testAttribute(Qt::WA_NoSystemBackground); + q->setAttribute(Qt::WA_TranslucentBackground); // also sets WA_NoSystemBackground + q->setAttribute(Qt::WA_NoSystemBackground, noSystemBackground); // restore system background attribute + } +#endif } int QMenuPrivate::scrollerHeight() const diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index 34fd7a7..db57e90 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -860,6 +860,8 @@ void QNetworkReplyImpl::abort() if (d->state != QNetworkReplyImplPrivate::Finished) { // call finished which will emit signals d->error(OperationCanceledError, tr("Operation canceled")); + if (d->state == QNetworkReplyImplPrivate::WaitingForSession) + d->state = QNetworkReplyImplPrivate::Working; d->finished(); } d->state = QNetworkReplyImplPrivate::Aborted; @@ -1019,10 +1021,6 @@ bool QNetworkReplyImplPrivate::migrateBackend() if (state == Finished || state == Aborted) return true; - // Backend does not support resuming download. - if (!backend->canResume()) - return false; - // Request has outgoing data, not migrating. if (outgoingData) return false; @@ -1031,6 +1029,10 @@ bool QNetworkReplyImplPrivate::migrateBackend() if (copyDevice) return true; + // Backend does not support resuming download. + if (!backend->canResume()) + return false; + state = QNetworkReplyImplPrivate::Reconnecting; if (backend) { diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index e9b6703..42fc49d 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -385,8 +385,6 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer))); connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)), this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer))); - - QMetaObject::invokeMethod(engine, "initialize"); } } @@ -410,8 +408,19 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() startPolling(); } - if (firstUpdate) + if (firstUpdate) { firstUpdate = false; + QList<QBearerEngine*> enginesToInitialize = sessionEngines; //shallow copy the list in case it is modified when we unlock mutex + Qt::ConnectionType connectionType; + if (QCoreApplicationPrivate::mainThread() == QThread::currentThread()) + connectionType = Qt::DirectConnection; + else + connectionType = Qt::BlockingQueuedConnection; + locker.unlock(); + foreach (QBearerEngine* engine, enginesToInitialize) { + QMetaObject::invokeMethod(engine, "initialize", connectionType); + } + } } void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate() @@ -479,7 +488,7 @@ void QNetworkConfigurationManagerPrivate::enablePolling() ++forcedPolling; if (forcedPolling == 1) - startPolling(); + QMetaObject::invokeMethod(this, "startPolling"); } void QNetworkConfigurationManagerPrivate::disablePolling() diff --git a/src/network/bearer/qnetworkconfigmanager_p.h b/src/network/bearer/qnetworkconfigmanager_p.h index abc4b9b..45d6a75 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.h +++ b/src/network/bearer/qnetworkconfigmanager_p.h @@ -107,7 +107,7 @@ private Q_SLOTS: void pollEngines(); private: - void startPolling(); + Q_INVOKABLE void startPolling(); QTimer *pollTimer; private: diff --git a/src/network/kernel/qnetworkinterface_unix.cpp b/src/network/kernel/qnetworkinterface_unix.cpp index 6098bde..7f251a7 100644 --- a/src/network/kernel/qnetworkinterface_unix.cpp +++ b/src/network/kernel/qnetworkinterface_unix.cpp @@ -219,7 +219,7 @@ static QNetworkInterfacePrivate *findInterface(int socket, QList<QNetworkInterfa #ifdef SIOCGIFHWADDR // Get the HW address if (qt_safe_ioctl(socket, SIOCGIFHWADDR, &req) >= 0) { - uchar *addr = (uchar *)&req.ifr_addr; + uchar *addr = (uchar *)req.ifr_addr.sa_data; iface->hardwareAddress = iface->makeHwAddress(6, addr); } #endif diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp index 1b41db4..ab37977 100644 --- a/src/opengl/qgl_symbian.cpp +++ b/src/opengl/qgl_symbian.cpp @@ -49,6 +49,9 @@ #include <private/qpaintengine_opengl_p.h> #include <private/qwidget_p.h> // to access QWExtra #include <private/qnativeimagehandleprovider_p.h> +#include <private/qapplication_p.h> +#include <private/qgraphicssystem_p.h> +#include <private/qgraphicssystemex_symbian_p.h> #include "qgl_egl_p.h" #include "qpixmapdata_gl_p.h" #include "qgltexturepool_p.h" @@ -180,6 +183,15 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as d->ownsEglContext = true; d->eglContext->setApi(QEgl::OpenGL); + QGraphicsSystemEx *ex = QApplicationPrivate::graphicsSystem()->platformExtension(); + QSymbianGraphicsSystemEx *symex = static_cast<QSymbianGraphicsSystemEx*>(ex); + if (symex && !symex->hasBCM2727()) { + // Most likely we have hw support for multisampling + // so let's enable it. + d->glFormat.setSampleBuffers(1); + d->glFormat.setSamples(4); + } + // If the device is a widget with WA_TranslucentBackground set, make sure the glFormat // has the alpha channel option set: if (devType == QInternal::Widget) { @@ -229,20 +241,20 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as d->eglSurface = QEgl::createSurface(device(), d->eglContext->config()); - eglGetError(); // Clear error state first. + eglGetError(); // Clear error state first. #ifdef QGL_NO_PRESERVED_SWAP - eglSurfaceAttrib(QEgl::display(), d->eglSurface, - EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED); + eglSurfaceAttrib(QEgl::display(), d->eglSurface, + EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED); - if (eglGetError() != EGL_SUCCESS) - qWarning("QGLContext: could not enable destroyed swap behaviour"); + if (eglGetError() != EGL_SUCCESS) + qWarning("QGLContext: could not enable destroyed swap behaviour"); #else - eglSurfaceAttrib(QEgl::display(), d->eglSurface, - EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); + eglSurfaceAttrib(QEgl::display(), d->eglSurface, + EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); - if (eglGetError() != EGL_SUCCESS) - qWarning("QGLContext: could not enable preserved swap behaviour"); + if (eglGetError() != EGL_SUCCESS) + qWarning("QGLContext: could not enable preserved swap behaviour"); #endif setWindowCreated(true); diff --git a/src/opengl/qgraphicssystem_gl.cpp b/src/opengl/qgraphicssystem_gl.cpp index 0aa3c2e..5a01d8c 100644 --- a/src/opengl/qgraphicssystem_gl.cpp +++ b/src/opengl/qgraphicssystem_gl.cpp @@ -104,11 +104,17 @@ QWindowSurface *QGLGraphicsSystem::createWindowSurface(QWidget *widget) const return new QGLWindowSurface(widget); } -#ifdef QGL_USE_TEXTURE_POOL -void QGLGraphicsSystem::releaseCachedResources() +#ifdef Q_OS_SYMBIAN +void QGLGraphicsSystem::releaseCachedGpuResources() { QGLTexturePool::instance()->hibernate(); } + +QGraphicsSystemEx* QGLGraphicsSystem::platformExtension() +{ + return this; +} #endif + QT_END_NAMESPACE diff --git a/src/opengl/qgraphicssystem_gl_p.h b/src/opengl/qgraphicssystem_gl_p.h index 5829dcc..5372443 100644 --- a/src/opengl/qgraphicssystem_gl_p.h +++ b/src/opengl/qgraphicssystem_gl_p.h @@ -55,11 +55,19 @@ #include "private/qgraphicssystem_p.h" +#ifdef Q_OS_SYMBIAN +#include "private/qgraphicssystemex_symbian_p.h" +#endif + #include <QMap> QT_BEGIN_NAMESPACE class Q_OPENGL_EXPORT QGLGraphicsSystem : public QGraphicsSystem +#ifdef Q_OS_SYMBIAN + , public QSymbianGraphicsSystemEx +#endif + { public: QGLGraphicsSystem(bool useX11GL); @@ -67,8 +75,9 @@ public: QPixmapData *createPixmapData(QPixmapData::PixelType type) const; QWindowSurface *createWindowSurface(QWidget *widget) const; -#ifdef QGL_USE_TEXTURE_POOL - void releaseCachedResources(); +#ifdef Q_OS_SYMBIAN + void releaseCachedGpuResources(); + QGraphicsSystemEx* platformExtension(); #endif private: bool m_useX11GL; diff --git a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp index 4b4f677..bf29dd4 100644 --- a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp +++ b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg.cpp @@ -80,9 +80,15 @@ QWindowSurface *QVGGraphicsSystem::createWindowSurface(QWidget *widget) const return new QVGWindowSurface(widget); } -void QVGGraphicsSystem::releaseCachedResources() +#ifdef Q_OS_SYMBIAN +void QVGGraphicsSystem::releaseCachedGpuResources() { QVGImagePool::instance()->hibernate(); } +QGraphicsSystemEx *QVGGraphicsSystem::platformExtension() +{ + return this; +} +#endif QT_END_NAMESPACE diff --git a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h index 9c9b3e2..feff451 100644 --- a/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h +++ b/src/plugins/graphicssystems/openvg/qgraphicssystem_vg_p.h @@ -55,9 +55,16 @@ #include <QtGui/private/qgraphicssystem_p.h> +#ifdef Q_OS_SYMBIAN +#include <QtGui/private/qgraphicssystemex_symbian_p.h> +#endif + QT_BEGIN_NAMESPACE class QVGGraphicsSystem : public QGraphicsSystem +#ifdef Q_OS_SYMBIAN + , public QSymbianGraphicsSystemEx +#endif { public: QVGGraphicsSystem(); @@ -65,7 +72,10 @@ public: QPixmapData *createPixmapData(QPixmapData::PixelType type) const; QWindowSurface *createWindowSurface(QWidget *widget) const; - void releaseCachedResources(); +#ifdef Q_OS_SYMBIAN + void releaseCachedGpuResources(); + QGraphicsSystemEx* platformExtension(); +#endif }; QT_END_NAMESPACE diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 7479d2f..2d0c201 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -7,9 +7,9 @@ unix:!symbian { SUBDIRS *= codecs } !contains(QT_CONFIG, no-gui): SUBDIRS *= imageformats iconengines -!embedded:!qpa:SUBDIRS *= graphicssystems +!embedded:!qpa:!contains(QT_CONFIG, no-gui):SUBDIRS *= graphicssystems embedded:SUBDIRS *= gfxdrivers decorations mousedrivers kbddrivers -!win32:!embedded:!mac:!symbian:SUBDIRS *= inputmethods +!win32:!embedded:!mac:!symbian:!contains(QT_CONFIG, no-gui):SUBDIRS *= inputmethods !symbian:!contains(QT_CONFIG, no-gui):SUBDIRS += accessible symbian:SUBDIRS += s60 contains(QT_CONFIG, phonon): SUBDIRS *= phonon diff --git a/src/tools/uic3/uic3.pro b/src/tools/uic3/uic3.pro index 5ad3c4d..54f7dc8 100644 --- a/src/tools/uic3/uic3.pro +++ b/src/tools/uic3/uic3.pro @@ -1,5 +1,6 @@ TEMPLATE = app CONFIG += console qt_no_compat_warning +win32-msvc*:CONFIG += no_batch # otherwise the wrong main.cpp may be picked up CONFIG -= app_bundle build_all:!build_pass { CONFIG -= build_all |