int main(int argc, char *argv[])
{
MainWindow mw;
mw.centralWidget()->setWindowFlags(Qt::SubWindow);
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();
}
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();
}
To copy to clipboard, switch view to plain text mode
Hello guys above is my code and the form it created is like this:
Capture.jpg
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]
Capture1.JPG
[Pointer]
Capture2.JPG
Could you help me please I would really appreciate that.
Bookmarks