Support QQuickWidget on Windows.
Task-number: QTBUG-36887 Change-Id: Ifb03804e21fd82d7eae2942b9e8ca83f1bdb776c Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>bb10
parent
b22ef59663
commit
21114bcc1f
|
|
@ -203,4 +203,17 @@ HDC QWindowsBackingStore::getDC() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_OPENGL
|
||||
|
||||
QImage QWindowsBackingStore::toImage() const
|
||||
{
|
||||
if (m_image.isNull()) {
|
||||
qCWarning(lcQpaBackingStore) <<__FUNCTION__ << "Image is null.";
|
||||
return QImage();
|
||||
}
|
||||
return m_image.data()->image();
|
||||
}
|
||||
|
||||
#endif // !QT_NO_OPENGL
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -67,6 +67,10 @@ public:
|
|||
|
||||
HDC getDC() const;
|
||||
|
||||
#ifndef QT_NO_OPENGL
|
||||
QImage toImage() const Q_DECL_OVERRIDE;
|
||||
#endif
|
||||
|
||||
private:
|
||||
QScopedPointer<QWindowsNativeImage> m_image;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -245,6 +245,8 @@ bool QWindowsIntegration::hasCapability(QPlatformIntegration::Capability cap) co
|
|||
return true;
|
||||
case ForeignWindows:
|
||||
return true;
|
||||
case RasterGLSurface:
|
||||
return true;
|
||||
default:
|
||||
return QPlatformIntegration::hasCapability(cap);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,13 +69,18 @@ void *QWindowsNativeInterface::nativeResourceForWindow(const QByteArray &resourc
|
|||
QWindowsWindow *bw = static_cast<QWindowsWindow *>(window->handle());
|
||||
if (resource == "handle")
|
||||
return bw->handle();
|
||||
if (window->surfaceType() == QWindow::RasterSurface) {
|
||||
switch (window->surfaceType()) {
|
||||
case QWindow::RasterSurface:
|
||||
case QWindow::RasterGLSurface:
|
||||
if (resource == "getDC")
|
||||
return bw->getDC();
|
||||
if (resource == "releaseDC") {
|
||||
bw->releaseDC();
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case QWindow::OpenGLSurface:
|
||||
break;
|
||||
}
|
||||
qWarning("%s: Invalid key '%s' requested.", __FUNCTION__, resource.constData());
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue