QPushButton 和 QCommandLinkButton

QPushButton:QAbstractButton

菜单 设置菜单 setMenu(QMenu)  
获取菜单 menu()  
展示菜单 showMenu()  
行为 QAction(Qicon(),"文字",QMenu)  
添加行为 QMenu.addAction(QAction)  
添加分割线 QMenu.addSeparator()  
添加子菜单 QMenu.addMenu(QMenu) 子菜单需要设置标题
行为触发信号 QAction.triggered.connect("函数")  
行为设置文本 QAction.setText(str)  
扁平边框 设置扁平边框 setFlat(bool) 默认为False,设置以后不会绘制按钮背景
是否扁平 isFlat()  
默认处理 设置为自动默认 setAutoDefault(bool) 自动默认按钮可能会有稍大的提示
设置为默认 setDefault(bool) 一般默认为Flase
获取自动默认 autoDefault()  
获取默认 isDefault()  
信号 继承自QAbstractButton pressed()  
released()  
clicked(checked = false)  
toggled(bool checked)  
继承自QWidget windowTitleChanged(QString) 窗口标题改变信号
windowIconChanged(QIcon) 窗口图标改变信号
customContextMenuRequest(QPoint) 自定义上下文菜单请求信号

子类

QCommandLinkButton 创建 QCommandLinkBut​​ton(text, description ,parent) 创建命令链接按钮
描述 setDescription(str)/description() 设置命令链接按钮的描述文本

你可能感兴趣的:(PYQT5,pyqt5)