(UPDATED) A problem with using WA_Translucent background and QSizeGrip
Unsolved
General and Desktop
-
int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow mw; mw.centralWidget()->setWindowFlags(Qt::SubWindow); QSizeGrip * sizeGrip = new QSizeGrip(mw.centralWidget()); QGridLayout * layout = new QGridLayout(mw.centralWidget()); mw.setWindowFlags(mw.windowFlags() | Qt::FramelessWindowHint); mw.setAttribute(Qt::WA_TranslucentBackground); qDebug() << sizeGrip->testAttribute(Qt::WA_TranslucentBackground); sizeGrip->setAttribute(Qt::WA_TranslucentBackground, false); qDebug() << sizeGrip->testAttribute(Qt::WA_TranslucentBackground); sizeGrip->setWindowFlags(sizeGrip->windowFlags() & ~Qt::FramelessWindowHint); sizeGrip->setWindowOpacity(1.0); mw.setWindowOpacity(1.0); layout->addWidget(sizeGrip, 0,0,1,1,Qt::AlignBottom | Qt::AlignRight); mw.centralWidget()->setStyleSheet("QWidget#a{border-image: url(:/f)}"); mw.show(); return a.exec(); }
Hello guys above is my code and the form it created is like this:
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.
[Double-arrow]
[Pointer]
Could you help me please I would really appreciate that.