[Development] Qt Quick2 OpenGL or Raster translucent window

hailong geng longlongh4 at yahoo.com
Mon Mar 12 05:31:12 CET 2012


Hi
    Yes, I have tried this before and only get black background. 
    I have reported a bug : https://bugreports.qt-project.org/browse/QTBUG-24707 (I am not sure whether this should be a bug or a task).
I just want to make QQuickView with translucent bakcground work(with OpenGL as backend is the best but Raster is also ok). 
 Because windows XP doesn't support pixel alpha blending with OpenGL so maybe we can't make QQuickView work translucently in Xp with OpenGL backend, but we can do that in Vista or win7 Using dwmapi.dll to support that. 
I am not familiar with the new QQuickView structure, so I don't know what is the best way to make QQuickView with translucent background work in Win7 and Xp(with OpenGL the best), may you tell me what should I do or forward this question to some person who is in charge of QQuickView and Scene Graph?
Thank you^_^


________________________________
 From: "sarah.j.smith at nokia.com" <sarah.j.smith at nokia.com>
To: longlongh4 at yahoo.com 
Cc: samuel.rodal at nokia.com; development at qt-project.org 
Sent: Sunday, March 11, 2012 5:32 PM
Subject: Re: [Development] Qt Quick2 OpenGL or Raster translucent window
 

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



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
>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/abffaaa0/attachment.html>


More information about the Development mailing list