Translucent frameless window problem on Kubuntu
I have the main window transparent and frameless, inside i have a rounded border widget. This works perfectly fine on Windows, but when i run it on Kubuntu the mainwindow is painted with a blured grey. The translucency works only if i remove the Qt::FramelessWindowHint. (Qt 4.74 on Kubuntu 11.04)
source:
Code:
MainWindow
::MainWindow(QWidget *parent
) : QWidget(parent, Qt
::FramelessWindowHint) {
ui.setupUi(this);
this->setAttribute(Qt::WA_TranslucentBackground,true);
}
Why could this be happening? I need the main window to be frameless and translucent in order to give my application a rounded look and feel.
Re: Translucent frameless window problem on Kubuntu
this->setAttribute(Qt::FramelessWindowHint)ï¼›
Re: Translucent frameless window problem on Kubuntu
Hey, im not with a kubuntu box right now, but i'll try it later. Have you tried?
I can't see how this would solve the problem, the flag Qt::FramelessWindowHint in the QWidget constructor is working since i get a frameless window. The problem is that the widget gets painted wiht grey, instead of been transparent(i didnt apply any style or background color)
anyway i'll give it a try when im back home.
thanks!
Re: Translucent frameless window problem on Kubuntu
A frameless window is probably held out of grasp of the window manager hence your window manager (kwin, I guess) cannot detect the window is translucent and the effects you have enabled for kwin treat your window as opaque, drawing the shadow under the whole area of the window. That's only a guess but I think a pretty good one.
Re: Translucent frameless window problem on Kubuntu
I see what u mean. The window also loses all the effects of dragging windows, applied on window manager config. I tried running a normal program on kubuntu, removing borders with the window options, and the same happened, dragging effect of windows disappeared.
Is there anyway of letting the window manager know about our frameless window, in order to use the translucency, without loosing all desktop effects?
Re: Translucent frameless window problem on Kubuntu
Don't disable the frame. You can try masking it out (using setMask) however I have no idea whether kwin will be able to detect the mask.
Re: Translucent frameless window problem on Kubuntu
I dont really know how to use the masking or paint methods...
Is there any tutorial or guide for masking actions and use of QPixmaps? im interested in changing widget's shape and making transparent areas, but i cant find a tutorial or examples to that. That would be pretty usefull!
thanks for your help!
Re: Translucent frameless window problem on Kubuntu
Open Qt Assistant (or Qt Creator help pane), go to "index" tab and type in "setMask".