Important: Please read the Qt Code of Conduct -

transparent window in windows 7 classic theme

  • Hi,
    I create a transparent qml window and everything works well until I change my windows 7 theme to classic, the area I want it to be transparent is black.

    import QtQuick 2.6
    import QtQuick.Window 2.2
    import QtGraphicalEffects 1.0
    Window {
     id: window
     visible: true
     width: 640
     height: 480
     color: "#00000000"
     flags: Qt.Window | Qt.FramelessWindowHint//去掉标题栏
     RectangularGlow {
       anchors.fill: background
       glowRadius: 10
       spread: 0
       cornerRadius: 10
       color: "#99999999"
         id: background
         anchors.topMargin: 50
         anchors.centerIn: parent
         radius: 15
         width: parent.width *2/3
         height: parent.height - 10
         color: "#ffdbeef5"

    and the cpp

    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    #include <QtQuick>
    int main(int argc, char *argv[])
        QGuiApplication app(argc, argv);
    //    QQuickWindow::setDefaultAlphaBuffer(true);
        QQmlApplicationEngine engine;
        if (engine.rootObjects().isEmpty())
            return -1;
        return app.exec();

    Here is a screenshot, anyone has some idea?
    alt text

  • @yupengfei Have you solved this problem?

Log in to reply