QWidget切换

 

QWidget切换,参考类:QstackedLayout,QStackedWidget,QTabWidget

 

一、Tab出现的位置
tabWidget.setTabPosition(QTabWidget.South);

enum QTabWidget::TabPosition

This enum type defines where QTabWidget draws the tab row:

	Constant		 Value			Description
QTabWidget::North		0		The tabs are drawn above the pages.
QTabWidget::South		1		The tabs are drawn below the pages.
QTabWidget::West		2		The tabs are drawn to the left of the pages.
QTabWidget::East		3		The tabs are drawn to the right of the pages.


二、Tab的形状
tabWidget.setTabShape(QTabWidget::Triangular)

enum QTabWidget::TabShape

This enum type defines the shape of the tabs:

	Constant				Value				Description
QTabWidget::Rounded		 	  0			The tabs are drawn with a rounded look. This is the default shape.
QTabWidget::Triangular	 	  1			The tabs are drawn with a triangular look.

 

QMainWindow的多个QDockWidget停靠在一起

在QMainWindow中

dock4=QDockWidget(self.tr("停靠窗口4"),self)  
        dock4.setFeatures(QDockWidget.DockWidgetFloatable|QDockWidget.DockWidgetClosable)  
# 可引入外部Qwidget
widget4 = QWidget()  
dock4.setWidget(widget4)  
self.addDockWidget(Qt.RightDockWidgetArea,dock4)  


#多个QDockWidget,每两两停靠在一起可以实现多个QDockWidget的停靠在一起
#两个停靠窗口叠加
self.tabifyDockWidget(dock4, dock5) 
self.tabifyDockWidget(dock2, dock4) 

 

转载于:https://www.cnblogs.com/ribavnu/p/4661777.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值