pyqt5-QTabWidget标签页组件

1、介绍

QTabWidget,标签页组件。

2、基础使用

clear(self) 
  • 清除所有子页面
addTab(self, widget: QWidget, a1: str) -> int
addTab(self, widget: QWidget, icon: QIcon, label: str) -> int
  • 添加子页面
insertTab(self, index: int, widget: QWidget, a2: str) -> int
insertTab(self, index: int, widget: QWidget, icon: QIcon, label: str) -> int
  • 插入子页面
removeTab(self, index: int) 
  • 移除指定子页面
setTabText(self, index: int, a1: str)
  • 设置指定子页面的标签文本
setTabIcon(self, index: int, icon: QIcon)
  • 设置指定子页面的标签图片
tabText(self, index: int) -> str 
  • 获取指定子页面的标签文本
tabIcon(self, index: int) -> QIcon 
  • 获取指定子页面的标签图片
indexOf(self, widget: QWidget) -> int
  • 获取指定子页面组件的序号
setCurrentIndex(self, index: int)
  • 设置当前的子页面
currentIndex(self) -> int
  • 获取当前的子页面序号
setCurrentWidget(self, widget: QWidget)
  • 设置当前的子页面组件
currentWidget(self) -> QWidget 
  • 获取当前的子页面组件

3、事件

currentChanged(self, index: int) [signal] 
  • 当前子页面切换时,触发
  • index是切换后的索引
posted @   挖洞404  阅读(331)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
点击右上角即可分享
微信分享提示