QFP::QFP(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
{
ui.setupUi(this);
//setAttribute(Qt::WA_TranslucentBackground, true);
this->setWindowFlags(Qt::FramelessWindowHint);
QPainterPath path;
QRectF rect = QRectF(0,0,620,440);
path.addRoundRect(rect,5,5);
QPolygon polygon= path.toFillPolygon().toPolygon();//获得这个路径上的所有的点
QRegion region(polygon);//根据这些点构造这个区域
setMask(region);
}
: QDialog(parent, flags)
{
ui.setupUi(this);
//setAttribute(Qt::WA_TranslucentBackground, true);
this->setWindowFlags(Qt::FramelessWindowHint);
QPainterPath path;
QRectF rect = QRectF(0,0,620,440);
path.addRoundRect(rect,5,5);
QPolygon polygon= path.toFillPolygon().toPolygon();//获得这个路径上的所有的点
QRegion region(polygon);//根据这些点构造这个区域
setMask(region);
}