Hi,
if you want to make a ARGB window using xlib/Qt here is the code i use
/**files to include from xlib*/
#include <X11/extensions/Xrender.h>
#include <X11/Xlib.h>
   
/**getting display*/
Display *dpy = XOpenDisplay ( 0 ); // open default display
    if ( !dpy ) {
        qWarning ( "Cannot connect to the X server" );
        exit ( 1 );
    }

/**code for argb visual*/
    bool  argbVisual=false;
    int screen = DefaultScreen ( dpy );
    Colormap colormap = 0;
    Visual *visual = 0;
    int eventBase, errorBase;

    if ( XRenderQueryExtension ( dpy, &eventBase, &errorBase ) ) {
        qWarning ("You have ARGB support");
        int nvi;
        XVisualInfo templ;
        templ.screen  = screen;
        templ.depth   = 32;
        templ.c_class = TrueColor;
        XVisualInfo *xvi = XGetVisualInfo ( dpy, VisualScreenMask |
                                            VisualDepthMask |
                                            VisualClassMask, &templ, &nvi );

        for ( int i = 0; i < nvi; ++i ) {
            XRenderPictFormat *format = XRenderFindVisualFormat ( dpy,
                                        xvi[i].visual );
            if ( format->type == PictTypeDirect && format->direct.alphaMask ) {
                visual = xvi[i].visual;
                colormap = XCreateColormap ( dpy, RootWindow ( dpy, screen ),
                                             visual, AllocNone );
                argbVisual=true;
                break;
            }
        }
    }
    /**end of code for argb visual*/

then QApplication app (dpy, argc, argv,Qt::HANDLE ( visual ), Qt::HANDLE ( colormap ) );



On Thu, May 14, 2009 at 6:24 PM, Thomas Lübking <thomas.luebking@web.de> wrote:
Am Thursday 14 May 2009 schrieb Harald Hvaal:


> Do I need to write graphics routines through kwin plugin framework? Is
if you want an effect on desktops/windows (like the cube switch etc.) that's likely the best location


> there a flag in Qt that I can use to get an alpha blended backgroudn for a
> qmainwindow?
Qt 4.5 (only on window type widgets QWidget::isWindow())
QWidget::setAttribute(Qt::WA_TranslucentBackground)
this will however (obviously) only work on composited desktops


> Maybe plasma has something for this? Is it even possible?
if you want whatever you want on the desktop layer (i.e. below all normal windows), you can make a plasmoid (QGraphicsViewItem) and just use alpha blending


Thomas





>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<




--
Regards:
Shashank Singh
Associate - Software | New Technologies team
Geodesic Limited |  <http://www.geodesic.com>
Tel: +91 22 2831 2872

Blog:http://techfreaks4u.com/blog
Marble contributor : http://edu.kde.org/marble/
KDE-in Volunteer : http://www.kde.in/