Qt 圆角方案
重寫 paintEvent :
Q_UNUSED(event) QPainter p(this); p.setPen(Qt::NoPen); p.setBrush(QBrush(QColor(0, 0, 0, 180))); p.setRenderHint(QPainter::Antialiasing); p.drawRoundedRect(0, 0, width() - 1, height() - 1, 20, 20);
noPen 就不會有邊框的黑色點點了,還闊以 ~
另外,子窗口居中顯示:
cicle->move(this->width() / 2 - cicle->width() / 2, this->height() / 2 - cicle->height() / 2);
笨辦法,行之有效 ~
轉載于:https://www.cnblogs.com/hbrw/p/10289019.html
總結
- 上一篇: Vue-Router API参考
- 下一篇: 君士坦丁堡分叉引起的安全问题