以重写qpushbutton的鼠标事件为例:
创建一个普通的c++类类中继承qpushbutton重写鼠标进入,离开事件将自己lable提升为自己创建的类
进一步工作:完成鼠标进入button则对button的样式进行改变
步骤:
1. 完成继承qpushbutton的类的enterevent的重写
2. 在enterevent中释放信号
3. 在button所在的cpp监听此信号
4. 大功告成
时间:2019-07-14 10:44:26
以重写qpushbutton的鼠标事件为例:
创建一个普通的c++类类中继承qpushbutton重写鼠标进入,离开事件将自己lable提升为自己创建的类
进一步工作:完成鼠标进入button则对button的样式进行改变
步骤:
1. 完成继承qpushbutton的类的enterevent的重写
2. 在enterevent中释放信号
3. 在button所在的cpp监听此信号
4. 大功告成