Nominate our 2022 Qt Champions!

Transparent Window in kde

  • Hi
    i want to create a window with transparent background.i create it for gnome successfully but in kde some shadow draw around window(you can see it in screen shot around map icon).some guys said you can use QML and QDeclarativeView but i cant use them for some reason.
    i found that if you create an image that have some alpha blend and then create a mask for window it disable the window shadow but if you move window something draw on your screen(they are like noise and when the screen update they destroy)!
    if you don't understand you can see in my screen shot the window with shadow enable and the other with no shadow.
    also my code:

    #include <QtGui/QApplication>
    #include "QLabel"

    int main(int argc, char *argv[])
    QApplication a(argc, argv);
    QMainWindow mainwindow = new QMainWindow();
    mainwidget = new QLabel();
    QPixmap pm = QPixmap("/home/bijan/Pictures/Maps.png");
    QPixmap maskImage = QPixmap("/home/bijan/Pictures/MapsMask.png");
    return a.exec();

  • closed due to duplicate post from "this thread":

  • reopened due to user request

Log in to reply