(UPDATED) A problem with using WA_Translucent background and QSizeGrip

  • int main(int argc, char *argv[])
        QApplication a(argc, argv);
        MainWindow mw;
        QSizeGrip * sizeGrip = new QSizeGrip(mw.centralWidget());
        QGridLayout * layout = new QGridLayout(mw.centralWidget());
        mw.setWindowFlags(mw.windowFlags() | Qt::FramelessWindowHint);
        qDebug() << sizeGrip->testAttribute(Qt::WA_TranslucentBackground);
        sizeGrip->setAttribute(Qt::WA_TranslucentBackground, false);
        qDebug() << sizeGrip->testAttribute(Qt::WA_TranslucentBackground);
        sizeGrip->setWindowFlags(sizeGrip->windowFlags() & ~Qt::FramelessWindowHint);
        layout->addWidget(sizeGrip, 0,0,1,1,Qt::AlignBottom | Qt::AlignRight);
        mw.centralWidget()->setStyleSheet("QWidget#a{border-image: url(:/f)}");
        return a.exec();

    Hello guys above is my code and the form it created is like this:
    alt text

    the problem is the size griper is composed by 9 little dot with a lot of hole in it and when my mouse hovered around on the griper it is like flashing between the <double arrow state> and <pointer state> (i guess it is caused by the TranslucentBackground attribute and those <translucent> dots in the gripper.

    alt text

    alt text

    Could you help me please I would really appreciate that.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.