[Development] Qt Quick2 OpenGL or Raster translucent window

sarah.j.smith at nokia.com sarah.j.smith at nokia.com
Sun Mar 11 10:32:09 CET 2012


Hi

Have you tried something like this:

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);
    QSurfaceFormat f;
    f.setSamples(16);              // if you want AA as well
    f.setAlphaBufferSize(8);   // turn on alpha
    QQuickView view;
    view.setFormat(f);
    view.setSource(QUrl::fromLocalFile(QLatin1String("/path/to/my.qml"));
    view.show();
    return app.exec();
}

I don't have a windows box handy to try this on, but give it a try.

As far as I know qmlscene doesnt know how to run with an alpha enabled GL context.

Regards

Sarah Smith
Senior Engineer Team Lead Qt3D
Nokia Qt Development Frameworks
Mobile: +61 448 283 476
Sarah.j.smith at nokia.com<mailto:Sarah.j.smith at nokia.com>



On 11/03/2012, at 3:13 AM, ext hailong geng wrote:

Hi
I have searched the Internet these two days and I find that it seems impossible to draw translucent window in Windows XP by OpenGL, because it doesn't support pixel alpha blending. So does Qt have found a way to do that for Windows XP?
Or Qt Quick2 just ignore the translucent function for Window which use OpenGL as backend, or even with Raster backend, I tried to set alpha channel and  use  RasterSurface but QQuickView just crashed.(maybe  RasterSurface  backend is not finished?)

For Windows Vista and newer windows version, there is DWMAPI which will support translucent opengl on desktop, you can see this demo, http://www.youtube.com/watch?v=4qWKSYWIqdk, this is cool, isn't it ^_^
So shall Qt support translucent OpenGL window for Windows Vista and any newer version?
_______________________________________________
Development mailing list
Development at qt-project.org<mailto:Development at qt-project.org>
http://lists.qt-project.org/mailman/listinfo/development

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120311/0d53cf74/attachment.html>


More information about the Development mailing list