diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-01-07 15:18:16 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-01-07 15:18:16 +0100 |
commit | cdf13ce286b14273e1e29c5bb02cbc880f31b786 (patch) | |
tree | 10733cb3fb35647b19cfd15ab158f56b1cb550e1 /src/plugins | |
parent | 21d607c81af0cd285e9bb3869ac3cd18358f1c8f (diff) | |
parent | a8321f21fb82714771b4717c99dd475f2c74649e (diff) |
Merge branch 'stable' into dev
Conflicts:
tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
Change-Id: I6b8d505fc22f052c307ca27f58f7d16f98965f47
Diffstat (limited to 'src/plugins')
9 files changed, 50 insertions, 28 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h index e455a3552e..69801a69f1 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.h +++ b/src/plugins/platforms/cocoa/qcocoaintegration.h @@ -80,11 +80,11 @@ public: // ---------------------------------------------------- // Additional methods void setVirtualSiblings(QList<QPlatformScreen *> siblings) { m_siblings = siblings; } - NSScreen *osScreen() const { return m_screen; } + NSScreen *osScreen() const; void updateGeometry(); public: - NSScreen *m_screen; + int m_screenIndex; QRect m_geometry; QRect m_availableGeometry; QDpi m_logicalDpi; diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index e096096e99..f4da7cc58a 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -70,9 +70,8 @@ static void initResources() QT_BEGIN_NAMESPACE QCocoaScreen::QCocoaScreen(int screenIndex) : - QPlatformScreen(), m_refreshRate(60.0) + QPlatformScreen(), m_screenIndex(screenIndex), m_refreshRate(60.0) { - m_screen = [[NSScreen screens] objectAtIndex:screenIndex]; updateGeometry(); m_cursor = new QCocoaCursor; } @@ -82,19 +81,25 @@ QCocoaScreen::~QCocoaScreen() delete m_cursor; } +NSScreen *QCocoaScreen::osScreen() const +{ + return [[NSScreen screens] objectAtIndex:m_screenIndex]; +} + void QCocoaScreen::updateGeometry() { - NSRect frameRect = [m_screen frame]; + NSScreen *nsScreen = osScreen(); + NSRect frameRect = [nsScreen frame]; m_geometry = QRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width, frameRect.size.height); - NSRect visibleRect = [m_screen visibleFrame]; + NSRect visibleRect = [nsScreen visibleFrame]; m_availableGeometry = QRect(visibleRect.origin.x, frameRect.size.height - (visibleRect.origin.y + visibleRect.size.height), // invert y visibleRect.size.width, visibleRect.size.height); m_format = QImage::Format_RGB32; - m_depth = NSBitsPerPixelFromDepth([m_screen depth]); + m_depth = NSBitsPerPixelFromDepth([nsScreen depth]); - NSDictionary *devDesc = [m_screen deviceDescription]; + NSDictionary *devDesc = [nsScreen deviceDescription]; CGDirectDisplayID dpy = [[devDesc objectForKey:@"NSScreenNumber"] unsignedIntValue]; CGSize size = CGDisplayScreenSize(dpy); m_physicalSize = QSizeF(size.width, size.height); @@ -119,7 +124,7 @@ qreal QCocoaScreen::devicePixelRatio() const { #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { - return qreal([m_screen backingScaleFactor]); + return qreal([osScreen() backingScaleFactor]); } else #endif { diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp index 11babe3aaa..47a72f173b 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp @@ -60,8 +60,7 @@ QQnxRasterBackingStore::QQnxRasterBackingStore(QWindow *window) { qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window; - // save platform window associated with widget - m_platformWindow = static_cast<QQnxWindow*>(window->handle()); + m_window = window; } QQnxRasterBackingStore::~QQnxRasterBackingStore() @@ -71,8 +70,9 @@ QQnxRasterBackingStore::~QQnxRasterBackingStore() QPaintDevice *QQnxRasterBackingStore::paintDevice() { - if (m_platformWindow->hasBuffers()) - return m_platformWindow->renderBuffer().image(); + QQnxWindow *platformWindow = this->platformWindow(); + if (platformWindow->hasBuffers()) + return platformWindow->renderBuffer().image(); return 0; } @@ -85,7 +85,8 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const if (window) targetWindow = static_cast<QQnxWindow *>(window->handle()); - if (!targetWindow || targetWindow == m_platformWindow) { + QQnxWindow *platformWindow = this->platformWindow(); + if (!targetWindow || targetWindow == platformWindow) { // visit all pending scroll operations for (int i = m_scrollOpList.size() - 1; i >= 0; i--) { @@ -93,14 +94,14 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const // do the scroll operation ScrollOp &op = m_scrollOpList[i]; QRegion srcArea = op.totalArea.intersected( op.totalArea.translated(-op.dx, -op.dy) ); - m_platformWindow->scroll(srcArea, op.dx, op.dy); + platformWindow->scroll(srcArea, op.dx, op.dy); } // clear all pending scroll operations m_scrollOpList.clear(); // update the display with newly rendered content - m_platformWindow->post(region); + platformWindow->post(region); } else if (targetWindow) { // The contents of the backing store should be flushed to a different window than the @@ -119,7 +120,7 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const Q_ASSERT(!m_hasUnflushedPaintOperations); targetWindow->adjustBufferSize(); - targetWindow->blitFrom(m_platformWindow, offset, region); + targetWindow->blitFrom(platformWindow, offset, region); targetWindow->post(region); } else { @@ -177,7 +178,7 @@ void QQnxRasterBackingStore::beginPaint(const QRegion ®ion) qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window(); m_hasUnflushedPaintOperations = true; - m_platformWindow->adjustBufferSize(); + platformWindow()->adjustBufferSize(); } void QQnxRasterBackingStore::endPaint(const QRegion ®ion) @@ -186,4 +187,10 @@ void QQnxRasterBackingStore::endPaint(const QRegion ®ion) qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << window(); } +QQnxWindow *QQnxRasterBackingStore::platformWindow() const +{ + Q_ASSERT(m_window->handle()); + return static_cast<QQnxWindow*>(m_window->handle()); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h index 8abd81f217..a344ff209d 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.h +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.h @@ -72,7 +72,9 @@ private: int dy; }; - QQnxWindow *m_platformWindow; + QQnxWindow *platformWindow() const; + + QWindow *m_window; QList<ScrollOp> m_scrollOpList; bool m_hasUnflushedPaintOperations; }; diff --git a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp index f1bdc77303..5902f05663 100644 --- a/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp +++ b/src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp @@ -767,9 +767,11 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::get_accChild(VARIANT varChildI // actually ask for the same object. As a consequence, we need to clone ourselves: if (QAccessibleInterface *par = accessible->parent()) { const int indexOf = par->indexOfChild(accessible); - QAccessibleInterface *clone = par->child(indexOf); + if (indexOf == -1) + qWarning() << "inconsistent hierarchy, parent:" << par << "child:" << accessible; + else + acc = par->child(indexOf); delete par; - acc = clone; } } } diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp index 04fe558541..b7937b4d84 100644 --- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp +++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp @@ -100,10 +100,15 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion ®ion, POINT ptDst = {r.x(), r.y()}; POINT ptSrc = {0, 0}; BLENDFUNCTION blend = {AC_SRC_OVER, 0, (BYTE)(255.0 * rw->opacity()), AC_SRC_ALPHA}; - RECT dirty = {dirtyRect.x(), dirtyRect.y(), - dirtyRect.x() + dirtyRect.width(), dirtyRect.y() + dirtyRect.height()}; - UPDATELAYEREDWINDOWINFO info = {sizeof(info), NULL, &ptDst, &size, m_image->hdc(), &ptSrc, 0, &blend, ULW_ALPHA, &dirty}; - QWindowsContext::user32dll.updateLayeredWindowIndirect(rw->handle(), &info); + + if (QWindowsContext::user32dll.updateLayeredWindowIndirect) { + RECT dirty = {dirtyRect.x(), dirtyRect.y(), + dirtyRect.x() + dirtyRect.width(), dirtyRect.y() + dirtyRect.height()}; + UPDATELAYEREDWINDOWINFO info = {sizeof(info), NULL, &ptDst, &size, m_image->hdc(), &ptSrc, 0, &blend, ULW_ALPHA, &dirty}; + QWindowsContext::user32dll.updateLayeredWindowIndirect(rw->handle(), &info); + } else { + QWindowsContext::user32dll.updateLayeredWindow(rw->handle(), NULL, &ptDst, &size, m_image->hdc(), &ptSrc, 0, &blend, ULW_ALPHA); + } } else { #endif const HDC dc = rw->getDC(); diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index f6011ae082..f5ad442e68 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -419,9 +419,9 @@ inline bool isQMLApplication() { // check if the QtQuick library is loaded #ifdef _DEBUG - HMODULE handle = GetModuleHandle(L"QtQuick" QT_LIBINFIX L"d5.dll"); + HMODULE handle = GetModuleHandle(L"Qt5Quick" QT_LIBINFIX L"d.dll"); #else - HMODULE handle = GetModuleHandle(L"QtQuick" QT_LIBINFIX L"5.dll"); + HMODULE handle = GetModuleHandle(L"Qt5Quick" QT_LIBINFIX L".dll"); #endif return (handle != NULL); } diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp index e1dfe3d6c0..e2843d04dc 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp @@ -545,7 +545,7 @@ QPoint QXcbCursor::pos() const void QXcbCursor::setPos(const QPoint &pos) { - xcb_window_t root; + xcb_window_t root = 0; queryPointer(connection(), &root, 0); xcb_warp_pointer(xcb_connection(), XCB_NONE, root, 0, 0, 0, 0, pos.x(), pos.y()); xcb_flush(xcb_connection()); diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 9c360df900..9a24390bac 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -250,6 +250,7 @@ void * QXcbNativeInterface::eglContextForContext(QOpenGLContext *context) QEGLPlatformContext *eglPlatformContext = static_cast<QEGLPlatformContext *>(context->handle()); return eglPlatformContext->eglContext(); #else + Q_UNUSED(context); return 0; #endif } |