对于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可