diff options
author | axis <qt-info@nokia.com> | 2010-03-18 07:57:42 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-03-18 07:57:42 (GMT) |
commit | d3cba714adb35098d515f7c4f8e90a4e38527d76 (patch) | |
tree | 60018e4f20fc6b58017081b5e9e043d36a7ee3a9 /src | |
parent | 09c2a804b700ec51f44bda567b806181d00bc161 (diff) | |
parent | e483886bcfcf7252af9ac7cc89de15f912bf69da (diff) | |
download | Qt-d3cba714adb35098d515f7c4f8e90a4e38527d76.zip Qt-d3cba714adb35098d515f7c4f8e90a4e38527d76.tar.gz Qt-d3cba714adb35098d515f7c4f8e90a4e38527d76.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-s60
Conflicts:
qmake/generators/symbian/symmake_abld.cpp
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qfile.cpp | 16 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsproxywidget.cpp | 5 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsproxywidget_p.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 8 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 2 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 36 | ||||
-rw-r--r-- | src/gui/widgets/qcombobox.cpp | 50 | ||||
-rw-r--r-- | src/gui/widgets/qcombobox_p.h | 2 | ||||
-rw-r--r-- | src/openvg/qpixmapdata_vg.cpp | 16 | ||||
-rw-r--r-- | src/openvg/qwindowsurface_vgegl.cpp | 22 |
10 files changed, 121 insertions, 37 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 728c316..aa1c7d9 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -62,21 +62,25 @@ static const int QFILE_WRITEBUFFER_SIZE = 16384; static QByteArray locale_encode(const QString &f) { -#ifndef Q_OS_DARWIN - return f.toLocal8Bit(); -#else +#if defined(Q_OS_DARWIN) // Mac always expects UTF-8... and decomposed... return f.normalized(QString::NormalizationForm_D).toUtf8(); +#elif defined(Q_OS_SYMBIAN) + return f.toUtf8(); +#else + return f.toLocal8Bit(); #endif } static QString locale_decode(const QByteArray &f) { -#ifndef Q_OS_DARWIN - return QString::fromLocal8Bit(f); -#else +#if defined(Q_OS_DARWIN) // Mac always gives us UTF-8 and decomposed, we want that composed... return QString::fromUtf8(f).normalized(QString::NormalizationForm_C); +#elif defined(Q_OS_SYMBIAN) + return QString::fromUtf8(f); +#else + return QString::fromLocal8Bit(f); #endif } diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp index a39ccfd..483eb62 100644 --- a/src/gui/graphicsview/qgraphicsproxywidget.cpp +++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp @@ -1315,6 +1315,8 @@ void QGraphicsProxyWidget::focusInEvent(QFocusEvent *event) return; } + d->proxyIsGivingFocus = true; + switch (event->reason()) { case Qt::TabFocusReason: { if (QWidget *focusChild = d->findFocusChild(0, true)) @@ -1328,10 +1330,11 @@ void QGraphicsProxyWidget::focusInEvent(QFocusEvent *event) default: if (d->widget && d->widget->focusWidget()) { d->widget->focusWidget()->setFocus(event->reason()); - return; } break; } + + d->proxyIsGivingFocus = false; } /*! diff --git a/src/gui/graphicsview/qgraphicsproxywidget_p.h b/src/gui/graphicsview/qgraphicsproxywidget_p.h index 60eb058..8aed363 100644 --- a/src/gui/graphicsview/qgraphicsproxywidget_p.h +++ b/src/gui/graphicsview/qgraphicsproxywidget_p.h @@ -118,6 +118,7 @@ public: quint32 styleChangeMode : 2; quint32 paletteChangeMode : 2; quint32 focusFromWidgetToProxy : 1; + quint32 proxyIsGivingFocus : 1; }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 573bac6..27b490b 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -52,6 +52,7 @@ #include "qstring.h" #include "qdebug.h" #include "qimage.h" +#include "qcombobox.h" #include "private/qkeymapper_p.h" #include "private/qfont_p.h" #ifndef QT_NO_STYLE_S60 @@ -1409,11 +1410,13 @@ void QApplicationPrivate::leaveModal_sys(QWidget *widget) void QApplicationPrivate::openPopup(QWidget *popup) { + if (popup && qobject_cast<QComboBox *>(popup->parentWidget())) + static_cast<QSymbianControl *>(popup->effectiveWinId())->FadeBehindPopup(ETrue); + if (!QApplicationPrivate::popupWidgets) QApplicationPrivate::popupWidgets = new QWidgetList; QApplicationPrivate::popupWidgets->append(popup); - // Cancel focus widget pointer capture and long tap timer if (QApplication::focusWidget()) { static_cast<QSymbianControl*>(QApplication::focusWidget()->effectiveWinId())->CancelLongTapTimer(); @@ -1452,6 +1455,9 @@ void QApplicationPrivate::openPopup(QWidget *popup) void QApplicationPrivate::closePopup(QWidget *popup) { + if (popup && qobject_cast<QComboBox *>(popup->parentWidget())) + static_cast<QSymbianControl *>(popup->effectiveWinId())->FadeBehindPopup(EFalse); + if (!QApplicationPrivate::popupWidgets) return; QApplicationPrivate::popupWidgets->removeAll(popup); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index e5310ea..af5fcd1 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -6171,6 +6171,8 @@ void QWidget::setFocus(Qt::FocusReason reason) previousProxyFocus = topData->proxyWidget->widget()->focusWidget(); if (previousProxyFocus && previousProxyFocus->focusProxy()) previousProxyFocus = previousProxyFocus->focusProxy(); + if (previousProxyFocus == this && !topData->proxyWidget->d_func()->proxyIsGivingFocus) + return; } } #endif diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index bf5a62e..a2ebebb 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -104,11 +104,11 @@ const int QS60StylePrivate::m_numberOfLayouts = const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = { // *** generated pixel metrics *** -{5,0,-909,0,0,2,0,0,-1,7,12,19,13,13,6,200,-909,-909,-909,20,13,2,0,0,21,7,18,-909,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1}, -{5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,-909,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1}, -{7,0,-909,0,0,2,0,0,-1,25,69,28,19,19,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,-909,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,13,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1}, -{7,0,-909,0,0,2,0,0,-1,25,68,28,19,19,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,-909,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,12,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1}, -{7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,-909,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1} +{5,0,-909,0,0,2,0,0,-1,7,12,19,13,13,6,200,-909,-909,-909,20,13,2,0,0,21,7,18,0,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1}, +{5,0,-909,0,0,1,0,0,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,0,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1}, +{7,0,-909,0,0,2,0,0,-1,25,69,28,19,19,9,258,-909,-909,-909,23,19,26,0,0,32,25,72,0,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,13,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1}, +{7,0,-909,0,0,2,0,0,-1,25,68,28,19,19,9,258,-909,-909,-909,31,19,6,0,0,32,25,60,0,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,12,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1}, +{7,0,-909,0,0,2,0,0,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,0,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1} // *** End of generated data *** }; @@ -2475,6 +2475,9 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w { int retValue = -1; switch (sh) { + case SH_ComboBox_Popup: + retValue = true; + break; case SH_Table_GridLineColor: retValue = int(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 2, 0).rgba()); break; @@ -2690,6 +2693,19 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple height - 2 * frameThickness); } break; + case SC_ComboBoxListBoxPopup: { + const QRect desktopContent = QApplication::desktop()->availableGeometry(); + + // take the size of this and position bottom above available area + QRect popupRect; + const int width = desktopContent.width() - pixelMetric(PM_LayoutRightMargin) - pixelMetric(PM_LayoutLeftMargin); + popupRect.setWidth(width); + popupRect.setHeight(desktopContent.height()); //combobox resets height anyway based on content + popupRect.setBottom(desktopContent.bottom()); + popupRect.translate(pixelMetric(PM_LayoutLeftMargin), 0); + ret = popupRect; + } + break; default: break; } @@ -2844,9 +2860,13 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con ret = menuItem->rect; if (element == SE_ItemViewItemDecoration) { - if (menuItem->direction == Qt::RightToLeft) - ret.translate(ret.width()-indicatorWidth, 0); - ret.setWidth(indicatorWidth); + if (menuItem->icon.isNull()) { + ret = QRect(); + } else { + if (menuItem->direction == Qt::RightToLeft) + ret.translate(ret.width()-indicatorWidth, 0); + ret.setWidth(indicatorWidth); + } } else { ret = menuItem->rect; if (!menuItem->icon.isNull()) diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index f71d250..c16f18a 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -532,9 +532,11 @@ void QComboBoxPrivateContainer::setItemView(QAbstractItemView *itemView) QStyleOptionComboBox opt = comboStyleOption(); const bool usePopup = combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo); #ifndef QT_NO_SCROLLBAR +#ifndef Q_WS_S60 if (usePopup) view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); #endif +#endif if (combo->style()->styleHint(QStyle::SH_ComboBox_ListMouseTracking, &opt, combo) || usePopup) { view->setMouseTracking(true); @@ -2417,24 +2419,44 @@ void QComboBox::showPopup() // Position horizontally. listRect.moveLeft(above.x()); +#ifndef Q_WS_S60 // Position vertically so the curently selected item lines up // with the combo box. const QRect currentItemRect = view()->visualRect(view()->currentIndex()); const int offset = listRect.top() - currentItemRect.top(); listRect.moveTop(above.y() + offset - listRect.top()); +#endif // Clamp the listRect height and vertical position so we don't expand outside the // available screen geometry.This may override the vertical position, but it is more // important to show as much as possible of the popup. const int height = !boundToScreen ? listRect.height() : qMin(listRect.height(), screen.height()); +#ifdef Q_WS_S60 + //popup needs to be stretched with screen minimum dimension + listRect.setHeight(qMin(screen.height(), screen.width())); +#else listRect.setHeight(height); +#endif + if (boundToScreen) { if (listRect.top() < screen.top()) listRect.moveTop(screen.top()); if (listRect.bottom() > screen.bottom()) listRect.moveBottom(screen.bottom()); } +#ifdef Q_WS_S60 + if (screen.width() < screen.height()) { + // in portait, menu should be positioned above softkeys + listRect.moveBottom(screen.bottom()); + } else { + // landscape, menu should be at the right and horizontally centered + listRect.setWidth(listRect.height()); + listRect.moveCenter(screen.center()); + (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) : + listRect.setLeft(screen.left()); + } +#endif } else if (!boundToScreen || listRect.height() <= belowHeight) { listRect.moveTopLeft(below); } else if (listRect.height() <= aboveHeight) { @@ -2643,6 +2665,34 @@ void QComboBox::changeEvent(QEvent *e) if (d->lineEdit) d->updateLineEditGeometry(); d->setLayoutItemMargins(QStyle::SE_ComboBoxLayoutItem); + +#ifdef Q_WS_S60 + if (d->container) { + QStyleOptionComboBox opt; + initStyleOption(&opt); + + if (style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, this)) { + const QRect screen = d->popupGeometry(QApplication::desktop()->screenNumber(this)); + + QRect listRect(style()->subControlRect(QStyle::CC_ComboBox, &opt, + QStyle::SC_ComboBoxListBoxPopup, this)); + listRect.setHeight(qMin(screen.height(), screen.width())); + + if (screen.width() < screen.height()) { + // in portait, menu should be positioned above softkeys + listRect.moveBottom(screen.bottom()); + } else { + // landscape, menu should be at the right and horizontally centered + listRect.setWidth(listRect.height()); + listRect.moveCenter(screen.center()); + (opt.direction == Qt::LeftToRight) ? listRect.setRight(screen.right()) : + listRect.setLeft(screen.left()); + } + d->container->setGeometry(listRect); + } + } +#endif + // ### need to update scrollers etc. as well here break; case QEvent::EnabledChange: diff --git a/src/gui/widgets/qcombobox_p.h b/src/gui/widgets/qcombobox_p.h index 74dfdc9..92d85cc 100644 --- a/src/gui/widgets/qcombobox_p.h +++ b/src/gui/widgets/qcombobox_p.h @@ -270,7 +270,9 @@ protected: const QStyleOptionViewItem &option, const QModelIndex &index) const { QStyleOptionMenuItem opt = getStyleOption(option, index); +#ifndef Q_WS_S60 painter->fillRect(option.rect, opt.palette.background()); +#endif mCombo->style()->drawControl(QStyle::CE_MenuItem, &opt, painter, mCombo); } QSize sizeHint(const QStyleOptionViewItem &option, diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index 44814cc..8adf5af 100644 --- a/src/openvg/qpixmapdata_vg.cpp +++ b/src/openvg/qpixmapdata_vg.cpp @@ -459,10 +459,6 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type) #if defined(QT_SYMBIAN_SUPPORTS_SGIMAGE) && !defined(QT_NO_EGL) if (type == QPixmapData::SgImage && pixmap) { RSgImage *sgImage = reinterpret_cast<RSgImage*>(pixmap); - // when "0" used as argument then - // default display, context are used - if (!context) - context = qt_vg_create_context(0, QInternal::Pixmap); destroyImages(); prevSize = QSize(); @@ -500,7 +496,7 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type) } const EGLint KEglImageAttribs[] = {EGL_IMAGE_PRESERVED_SYMBIAN, EGL_TRUE, EGL_NONE}; - EGLImageKHR eglImage = eglCreateImageKHR(context->display(), + EGLImageKHR eglImage = eglCreateImageKHR(QEglContext::display(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer)sgImage, @@ -515,7 +511,7 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type) vgImage = vgCreateEGLImageTargetKHR(eglImage); if(vgGetError() != VG_NO_ERROR) { cleanup(); - eglDestroyImageKHR(context->display(), eglImage); + eglDestroyImageKHR(QEglContext::display(), eglImage); SgDriver::Close(); return; } @@ -529,7 +525,7 @@ void QVGPixmapData::fromNativeType(void* pixmap, NativeType type) prevSize = QSize(w, h); setSerialNumber(++qt_vg_pixmap_serial); // release stuff - eglDestroyImageKHR(context->display(), eglImage); + eglDestroyImageKHR(QEglContext::display(), eglImage); SgDriver::Close(); } else if (type == QPixmapData::FbsBitmap) { CFbsBitmap *bitmap = reinterpret_cast<CFbsBitmap*>(pixmap); @@ -624,7 +620,7 @@ void* QVGPixmapData::toNativeType(NativeType type) } const EGLint KEglImageAttribs[] = {EGL_IMAGE_PRESERVED_SYMBIAN, EGL_TRUE, EGL_NONE}; - EGLImageKHR eglImage = eglCreateImageKHR(context->display(), + EGLImageKHR eglImage = eglCreateImageKHR(QEglContext::display(), EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer)sgImage, @@ -637,7 +633,7 @@ void* QVGPixmapData::toNativeType(NativeType type) VGImage dstVgImage = vgCreateEGLImageTargetKHR(eglImage); if(vgGetError() != VG_NO_ERROR) { - eglDestroyImageKHR(context->display(), eglImage); + eglDestroyImageKHR(QEglContext::display(), eglImage); sgImage->Close(); SgDriver::Close(); return 0; @@ -653,7 +649,7 @@ void* QVGPixmapData::toNativeType(NativeType type) } // release stuff vgDestroyImage(dstVgImage); - eglDestroyImageKHR(context->display(), eglImage); + eglDestroyImageKHR(QEglContext::display(), eglImage); SgDriver::Close(); return reinterpret_cast<void*>(sgImage); } else if (type == QPixmapData::FbsBitmap) { diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp index 693312a..f46d6c2 100644 --- a/src/openvg/qwindowsurface_vgegl.cpp +++ b/src/openvg/qwindowsurface_vgegl.cpp @@ -230,9 +230,9 @@ static QEglContext *createContext(QPaintDevice *device) // Set the swap interval for the display. QByteArray interval = qgetenv("QT_VG_SWAP_INTERVAL"); if (!interval.isEmpty()) - eglSwapInterval(context->display(), interval.toInt()); + eglSwapInterval(QEglContext::display(), interval.toInt()); else - eglSwapInterval(context->display(), 1); + eglSwapInterval(QEglContext::display(), 1); #ifdef EGL_RENDERABLE_TYPE // Has the user specified an explicit EGL configuration to use? @@ -246,16 +246,16 @@ static QEglContext *createContext(QPaintDevice *device) EGLint matching = 0; EGLConfig cfg; if (eglChooseConfig - (context->display(), properties, &cfg, 1, &matching) && + (QEglContext::display(), properties, &cfg, 1, &matching) && matching > 0) { // Check that the selected configuration actually supports OpenVG // and then create the context with it. EGLint id = 0; EGLint type = 0; eglGetConfigAttrib - (context->display(), cfg, EGL_CONFIG_ID, &id); + (QEglContext::display(), cfg, EGL_CONFIG_ID, &id); eglGetConfigAttrib - (context->display(), cfg, EGL_RENDERABLE_TYPE, &type); + (QEglContext::display(), cfg, EGL_RENDERABLE_TYPE, &type); if (cfgId == id && (type & EGL_OPENVG_BIT) != 0) { context->setConfig(cfg); if (!context->createContext()) { @@ -334,7 +334,7 @@ static void qt_vg_destroy_shared_context(QVGSharedContext *shared) shared->engine = 0; shared->context->doneCurrent(); if (shared->surface != EGL_NO_SURFACE) { - eglDestroySurface(shared->context->display(), shared->surface); + eglDestroySurface(QEglContext::display(), shared->surface); shared->surface = EGL_NO_SURFACE; } delete shared->context; @@ -412,7 +412,7 @@ EGLSurface qt_vg_shared_surface(void) attribs[4] = EGL_NONE; } shared->surface = eglCreatePbufferSurface - (shared->context->display(), shared->context->config(), attribs); + (QEglContext::display(), shared->context->config(), attribs); } return shared->surface; } @@ -555,7 +555,7 @@ void QVGEGLWindowSurfaceVGImage::beginPaint(QWidget *widget) context->makeCurrent(mainSurface()); recreateBackBuffer = false; if (backBufferSurface != EGL_NO_SURFACE) { - eglDestroySurface(context->display(), backBufferSurface); + eglDestroySurface(QEglContext::display(), backBufferSurface); backBufferSurface = EGL_NO_SURFACE; } if (backBuffer != VG_INVALID_HANDLE) { @@ -568,7 +568,7 @@ void QVGEGLWindowSurfaceVGImage::beginPaint(QWidget *widget) if (backBuffer != VG_INVALID_HANDLE) { // Create an EGL surface for rendering into the VGImage. backBufferSurface = eglCreatePbufferFromClientBuffer - (context->display(), EGL_OPENVG_IMAGE, + (QEglContext::display(), EGL_OPENVG_IMAGE, (EGLClientBuffer)(backBuffer), context->config(), NULL); if (backBufferSurface == EGL_NO_SURFACE) { @@ -704,7 +704,7 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) #if defined(QVG_DIRECT_TO_WINDOW) // Did we get a direct to window rendering surface? EGLint buffer = 0; - if (eglQueryContext(context->display(), context->context(), + if (eglQueryContext(QEglContext::display(), context->context(), EGL_RENDER_BUFFER, &buffer) && buffer == EGL_SINGLE_BUFFER) { needToSwap = false; @@ -714,7 +714,7 @@ QEglContext *QVGEGLWindowSurfaceDirect::ensureContext(QWidget *widget) // Try to force the surface back buffer to preserve its contents. if (needToSwap) { eglGetError(); // Clear error state first. - eglSurfaceAttrib(context->display(), surface, + eglSurfaceAttrib(QEglContext::display(), surface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED); if (eglGetError() != EGL_SUCCESS) { qWarning("QVG: could not enable preserved swap"); |