目录

实现三个虚函数


算法相关

鼠标相对于左上角的 z 是不变的
添加 QPoint 头文件

因为作用域的原因,我们把 z 定义为类的成员变量。现在就可以正常的拖动窗口了
包含头文件 #include

阴影的高度

阴影的颜色
shadow->setColor(Qt::black);
阴影的偏移
shadow->setOffset(0);
设置主窗口透明

添加按钮和标题


- #shadowWidget
- {
- background-color: rgb(255, 255, 255);
- }
按钮渐变色和点击后改变样

- QPushButton {
- border: 2px solid #8f8f91;
- border-radius: 6px;
- background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #f6f7fa, stop:1 #dadbde);
- min-width: 80px;
- }
-
- QPushButton:pressed {
- background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #dadbde, stop:1 #f6f7fa);
- }
-
- QpushButton:flat {
- border:none;
- }
-
- QpushButton:default {
- border-color: navy;
- }
文字标签里面加图片

鼠标移动上去变色

- QPushButton:hover {
- background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #f05020, stop:1 #ff5b29);
- }
三次转到槽

解决最大化不能占满屏幕
视频里面使用的是这个方法,但是我 QT 上没有这个函数,就暂时不演示了
