zoukankan      html  css  js  c++  java
  • PyQt5 -day3-1 绝对位置

    程序 以像素为单位 制定控件的大小 和位置。

    绝对位置有以下限制:

    • 如果我们调整窗口,控件的大小和位置不会改变 
    • 在各种平台上,程序会看起来不一样
    • 窗口中 改变字体的大小 会损坏窗口的布局
    • 如果我们决定改变我们的布局,我们必须完全重做我们的布局
     1 import sys
     2 from PyQt5.QtWidgets import QApplication, QPushButton ,QWidget
     3 
     4 class Example(QWidget):
     5     def __init__(self):
     6         super().__init__()
     7         self.Init_UI()
     8     def Init_UI(self):
     9         self.setGeometry(300,300,300,200)
    10         self.setWindowTitle('绝对位置')
    11 
    12 
    13         jd_button = QPushButton('剪刀',self)
    14         jd_button.move(50,150)
    15         st_button = QPushButton('石头',self)
    16         st_button.move(150, 150)
    17         bu_button = QPushButton('',self)
    18         bu_button.move(250, 150)
    19         self.show()
    20 if __name__ =='__main__':
    21     app =QApplication(sys.argv)
    22     ex = Example()
    23     sys.exit(app.exec_())

    # 拖动窗口的大小, 控件的位置不会位置

  • 相关阅读:
    ado.net的基本特性
    The relationship's type
    the relationship's cardinality
    复杂心情中。。。
    the relationship's existence.
    ORACLE中国的短视
    ADO.net连接数据库
    虚拟基类的初始化
    递归实现全排列
    Factory Methods
  • 原文地址:https://www.cnblogs.com/jiayou888888/p/8530566.html
Copyright © 2011-2022 走看看