Thursday, October 19, 2006

ARGB windows

I've been getting a lot of questions about writing semi transparent applications with Qt. So I've put up an example showing once again how to use ARGB visuals with Qt. The example, just like the old one I showed a while ago looks like this:

The code is available at

By the way of this example I would like to ask some KDE people to stop abusing the fact that I work for Trolltech. What has been happening a lot lately is that people send me emails asking and in some cases actually telling me to do X or Y for their application or send them code to show them how to do Z, which would not be a problem if not the fact that if I won't respond within a few hours they email qt-bugs referencing me by name and writing that this is a "bug" for me. That's ridicules, please don't do that. My motivation to help you is not proportional to the amount of emails you manage to get in my inbox. And if I tell you on IRC that I can't reproduce a bug and I'll need more informations, for example what version of X.Org and on what drivers you're running it, then sending the same bug you told me about on IRC to qt-bugs will not magically make me fix it, I'll still need the same extra informations to get anywhere. So please have mercy on me and be reasonable I am physically not capable of addressing everyones graphics related issues and questions.


Anonymous said...

Thanks a lot for such beautiful sample! It is difficult to find any information on this topic.

Anonymous said...

To be honest: I think one of the reasons that some people react in such strange ways could be that at least in your blog you only seldom answer to any questions or notes in the comment section.

Additionally some - very interesting! - topics are only mentioned once in this blog. They never appear again. A good example is Glucose: it was reported in all important news, and so on, but no one seems to know what has happened with it.

On the other hand it is much better hat you keep the readers up2date in this way (which costs enough time already I guess) than writing nothing at all.

So, it would be nice to cover some stuff once in a while again here, but when you do not have the time, it is cool already that you cover the stories once :)

Anonymous said...

Thank you Zack! I know I was one of those annoying guys asking about ARGB visuals :) Sorry, just couldn't find any info on it anywhere else. Thanks so much for providing the code.

Anonymous said...

Hmm ... does this QApplication ctor still have the not so nice side-effects for which e.g. KDE3 Konsole has this code disabled?

Anonymous said...

which would you rather have the man doing, commenting on blogs, or writing code?

you cant have it all.

Anonymous said...

Hi zack,

I'm getting the following error:

X Error: BadMatch (invalid parameter attributes) 8
Extension: 154 (RENDER)
Minor opcode: 4 (RenderCreatePicture)
Resource id: 0x186

The bird shows up btw.

Great example!


Anonymous said...

I didn't know how to get it compiled. So for all with the same problem: run in the demo-directory: run "qmake -makefile" then "make" if all worked well "./argb"

You need o have the X- and the qt-heades installed!