Qt(三)--- 实现QQ登陆界面头像状态栏的功能

本文介绍了如何使用Qt实现QQ登录界面的头像状态栏功能,涉及QMenu、QAction的知识,并详细讲解了自定义头像显示框、状态按钮响应及UI美化的方法。
摘要由CSDN通过智能技术生成

对于QQ登陆界面,可以通过下拉菜单,实现状态的选择,在QQ的头像状态栏需要显示的信息包括:用户的头像以及登陆的状态。这里主要涉及和利用的只是是QMenu以及QAction,同时继承QLabel的类;

QMenu的相关知识

 QMenu继承于QWidget,包含的Properties有:

1、icon:QIcon  

2、separatorsCollapsible:bool     

This property specifies whether consecutive separators in the menu should be visually collapsed to a single one. Separators at the beginning or the end of the menu are also hidden.

3、toolTipsVisbel:bool

4、title:QString

5、tearOffEnable:bool               

This property holds whether the menu supports being torn off.When true, the menu contains a special tear-off item (often shown as a dashed line at the top of the menu) that creates a copy of the menu when it is triggered.

此外还是继承了QWidget的59个性质

下面需要介绍一些关于QMenu将要用到的应用:

Actions,通常对于菜单项,包含一系列的action items,通常在菜单项中,action的表现形式有四种,separators,分割线,用于显示子菜单,widgets还有用于表示一种动作。action可

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值