Advertisement

PyQt5的网格布局

阅读量:

研读《PyQt4入门指南 PDF中文版.pdf》过程中所整理的学习记录

最为普遍的界面排列方式属于网格式布局(QGridLayout)。这种布局机制通过将窗口区域分割为多个横向与纵向的行列结构来实现。若需构建此类布局,应采用QGridLayout类进行操作。

复制代码
 #!/usr/bin/python

    
 # gridlayout.py
    
 from PyQt5.QtWidgets import QApplication, QPushButton, QLabel, QGridLayout
    
 from PyQt5 import QtWidgets
    
  
    
 class GridLayout(QtWidgets.QWidget):
    
     def __init__(self, parent= None):
    
     QtWidgets.QWidget.__init__(self)
    
   
    
     self.setWindowTitle('grid layout')
    
     
    

全部评论 (0)

还没有任何评论哟~