修改控制面板有线/无线网络项悬浮点击背景色

This commit is contained in:
zhangyuanyuan1 2023-04-10 14:45:53 +08:00
parent df80020b08
commit 25f89beb20
3 changed files with 15 additions and 15 deletions

View File

@ -79,17 +79,17 @@ void AddNetBtn::leaveEvent(QEvent *event){
void AddNetBtn::paintEvent(QPaintEvent *event)
{
QPalette pal = qApp->palette();
// QPalette pal = qApp->palette();
QPainter painter(this);
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
painter.setPen(Qt::NoPen);
painter.setBrush(this->palette().base().color());
QColor color = pal.color(QPalette::Button);
color.setAlphaF(0.5);
pal.setColor(QPalette::Button, color);
this->setPalette(pal);
// QColor color = pal.color(QPalette::Button);
// color.setAlphaF(0.5);
// pal.setColor(QPalette::Button, color);
// this->setPalette(pal);
QRect rect = this->rect();
QPainterPath path;

View File

@ -145,17 +145,17 @@ void LanItem::onDeletetTriggered()
void LanItem::paintEvent(QPaintEvent *event)
{
QPalette pal = qApp->palette();
// QPalette pal = qApp->palette();
QPainter painter(this);
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
painter.setPen(Qt::NoPen);
painter.setBrush(this->palette().base().color());
QColor color = pal.color(QPalette::Button);
color.setAlphaF(0.5);
pal.setColor(QPalette::Button, color);
this->setPalette(pal);
// QColor color = pal.color(QPalette::Button);
// color.setAlphaF(0.5);
// pal.setColor(QPalette::Button, color);
// this->setPalette(pal);
QRect rect = this->rect();

View File

@ -92,17 +92,17 @@ void WlanItem::stopLoading(){
void WlanItem::paintEvent(QPaintEvent *event)
{
QPalette pal = qApp->palette();
// QPalette pal = qApp->palette();
QPainter painter(this);
painter.setRenderHint(QPainter:: Antialiasing, true); //设置渲染,启动反锯齿
painter.setPen(Qt::NoPen);
painter.setBrush(this->palette().base().color());
QColor color = pal.color(QPalette::Button);
color.setAlphaF(0.5);
pal.setColor(QPalette::Button, color);
this->setPalette(pal);
// QColor color = pal.color(QPalette::Button);
// color.setAlphaF(0.5);
// pal.setColor(QPalette::Button, color);
// this->setPalette(pal);
QRect rect = this->rect();