阴影不受窗体透明度影响,增加重叠实现描边效果
This commit is contained in:
parent
bbe642c685
commit
81ee93a7e6
|
@ -685,15 +685,19 @@ void MainWindow::paintEvent(QPaintEvent *event)
|
|||
painter.setPen(Qt::transparent);
|
||||
painter.setOpacity(transparency);
|
||||
painter.drawPath(path);
|
||||
painter.restore();
|
||||
KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon()));
|
||||
QColor color = Qt::black;
|
||||
for (int i = 0; i < 6; i++) {
|
||||
painter.save();
|
||||
for (int i = 0; i < 7; i++) {
|
||||
rect = this->rect().adjusted(i, i, - i, - i);
|
||||
color.setAlpha(i * 6);
|
||||
painter.setBrush(Qt::NoBrush);
|
||||
painter.setPen(QPen(color, 1));
|
||||
painter.drawRoundedRect(rect, 10, 10);
|
||||
}
|
||||
painter.restore();
|
||||
QMainWindow::paintEvent(event);
|
||||
}
|
||||
/**
|
||||
* 鼠标点击窗口外部事件
|
||||
|
|
Loading…
Reference in New Issue