• 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) 
    
  • 相关阅读:
    架构设计-业务逻辑层简述
    大牛的法宝
    架构设计中服务层的简单理解
    架构师都要懂哪些知识
    python 面向对象
    Ubuntu学习
    装饰器
    Py之基础数据类型
    Py之模块
    浏览器环境变量
  • 原文地址:https://www.cnblogs.com/ribavnu/p/4661777.html
Copyright © 2020-2023  润新知