当前位置:网站首页>QT -- how to set shadow effect in QWidget
QT -- how to set shadow effect in QWidget
2022-07-02 08:50:00 【Code pirate captain】
Introduce
This is a tool to set up QWidget Control and its child control shadow effect class .
Parent class
Inherited from :QGraphicsEffect
attribute
blurRadius:qeal
Blur radius : have access to qreal blurRadius() const and void setBlurRadius(qreal blurRadius) Get and set the value of the current property , The default value is 1.
color:QColor
Set the shadow color : have access to QColor color() const and void setColor(const QColor &color) To set and get the value of the current property , The default value is (QColor(63, 63, 63, 180))
offset : QPointF
This attribute holds the shadow offset in pixels . By default , Lower right offset is 8 Pixels . The offset is given in the equipment coordinates , This means that it is not affected by proportion . have access to QPointF offset()const and void setOffset(const QPointF &ofs) To set and get the value of the current property .
xOffset : qreal
This attribute holds the shadow offset in pixels X.
yOffset : qreal
This attribute holds the shadow offset in pixels Y.
public inheritance
virtual QRectF boundingRectFor(const QRectF &rect) const override
Protection succession
virtual void draw(QPainter *painter) override
The signal
void blurRadiusChanged(qreal blurRadius)
void colorChanged(const QColor &color)
void offsetChanged(const QPointF &offset)
QGraphicsDropShadowEffect*mpGraphicsDropShadowEffect= new QGraphicsDropShadowEffect(this);
mpGraphicsDropShadowEffect->setColor(QColor(100,100,100,100));
mpGraphicsDropShadowEffect->setBlurRadius(2);
mpGraphicsDropShadowEffect->setOffset(2.5);
ui->label->setGraphicsEffect(mpGraphicsDropShadowEffect);

Code demo
边栏推荐
- C Baidu map, Gaode map, Google map (GPS) longitude and latitude conversion
- Kubedm deploys kubernetes v1.23.5 cluster
- Openshift deployment application
- Openshift build image
- Minecraft group service opening
- 队列的基本概念介绍以及典型应用示例
- kubeadm部署kubernetes v1.23.5集群
- History of Web Technology
- Service de groupe minecraft
- Minecraft plug-in service opening
猜你喜欢

Tcp/ip - transport layer

Linux binary installation Oracle database 19C

群辉 NAS 配置 iSCSI 存储

Kubedm deploys kubernetes v1.23.5 cluster

Googlenet network explanation and model building

HCIA - application layer

Sqli labs level 8 (Boolean blind note)

ARP及ARP欺骗

commands out of sync. did you run multiple statements at once

k8s入门:Helm 构建 MySQL
随机推荐
Using recursive functions to solve the inverse problem of strings
[blackmail virus data recovery] suffix Crylock blackmail virus
C# 百度地图,高德地图,Google地图(GPS) 经纬度转换
Qt QTimer类
Solution of Xiaomi TV's inability to access computer shared files
Minecraft install resource pack
Web security -- core defense mechanism
[flask] ORM one-to-one relationship
Oracle related statistics
Loadbalancer dynamically refreshes Nacos server
ICMP协议
Makefile基本原理
Hcia - Application Layer
History of Web Technology
Honeypot attack and defense drill landing application scheme
IP protocol and IP address
Getting started with k8s: building MySQL with Helm
HackTheBox-Gunship
c语言将字符串中的空格替换成%20
Web security -- Logical ultra vires