摘要:
1 import sys 2 from PyQt5.QtWidgets import QApplication, QLineEdit, QWidget, QFormLayout 3 4 class lineEditDemo(QWidget): 5 def __init__(self): 6 supe 阅读全文
posted @ 2020-07-30 17:42
胸怀丶若谷
阅读(515)
评论(0)
推荐(0)
摘要:
QLineEdit类是一个单行文本框控件,可以输入单行字符串,如果需要输入多行字符串,使用QTextEdit类。 QLineEdit类中的常用方法: setAkignment(): 按固定值方式对齐文本: Qt.AlignLeft,水平方向靠左对齐。 Qt.AlignRight,水平方向靠右对齐 Q 阅读全文
posted @ 2020-07-30 17:27
胸怀丶若谷
阅读(617)
评论(0)
推荐(0)
摘要:
1 from PyQt5.QtWidgets import * 2 import sys 3 4 class QlabelDemo(QDialog): 5 def __init__(self): 6 super().__init__() 7 8 self.setWindowTitle('QLabel 阅读全文
posted @ 2020-07-30 16:57
胸怀丶若谷
阅读(690)
评论(0)
推荐(1)
摘要:
1 from PyQt5.QtWidgets import QApplication, QLabel, QWidget, QVBoxLayout 2 from PyQt5.QtCore import Qt 3 from PyQt5.QtGui import QPixmap, QPalette 4 i 阅读全文
posted @ 2020-07-30 15:19
胸怀丶若谷
阅读(177)
评论(0)
推荐(0)
摘要:
setAlignment: 按固定值方式对齐文本 Qt.AlignLeft:水平方向靠左对齐 Qt.AlignRight:水平方向靠右对齐 Qt.AlignCenter:水平方向居中对齐 Qt.AlignJustify:水平方向调整间距两端对齐 Qt.AlignTop:垂直方向靠上对齐 Qt.Ali 阅读全文
posted @ 2020-07-30 14:43
胸怀丶若谷
阅读(1337)
评论(0)
推荐(0)
摘要:
1 """设置一个气泡提示""" 2 3 import sys 4 from PyQt5.QtWidgets import QWidget, QToolTip, QApplication 5 from PyQt5.QtGui import QFont 6 7 class Winform(QWidge 阅读全文
posted @ 2020-07-30 14:28
胸怀丶若谷
阅读(135)
评论(0)
推荐(0)
摘要:
import sys from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QWidget, QApplication # 创建一个Icon类,继承Qwidget类 class Icon(QWidget): def __init__(se 阅读全文
posted @ 2020-07-30 14:16
胸怀丶若谷
阅读(208)
评论(0)
推荐(0)
摘要:
1 """关闭主窗口""" 2 3 from PyQt5.QtWidgets import QMainWindow, QHBoxLayout, QPushButton, QApplication, QWidget 4 import sys 5 6 class WinForm(QMainWindow) 阅读全文
posted @ 2020-07-30 14:15
胸怀丶若谷
阅读(118)
评论(0)
推荐(0)
摘要:
1 """主窗口居中""" 2 from PyQt5.QtWidgets import QDesktopWidget, QApplication, QMainWindow 3 import sys 4 5 class Winform(QMainWindow): 6 7 def __init__(se 阅读全文
posted @ 2020-07-30 14:06
胸怀丶若谷
阅读(169)
评论(0)
推荐(0)
摘要:
1 """创建主窗口""" 2 import sys 3 from PyQt5.QtWidgets import QMainWindow, QApplication 4 from PyQt5.QtGui import QIcon 5 6 class MainWindow(QMainWindow): 阅读全文
posted @ 2020-07-30 14:02
胸怀丶若谷
阅读(184)
评论(0)
推荐(0)
摘要:
1 import sys 2 from PyQt5.QtWidgets import QApplication,QWidget,QPushButton 3 4 app = QApplication(sys.argv) 5 widget = QWidget() 6 btn = QPushButton( 阅读全文
posted @ 2020-07-30 14:00
胸怀丶若谷
阅读(264)
评论(0)
推荐(0)
摘要:
QWidget有两种常用的几何结构: 1.不包含外边各种边框的几何结构。 一般情况下,不包含边框的部分是客户区,这里面就i是我们正常操作的地方,可以添加子控件。这部分是一个长方形,会有大小和位置。大小是指宽度和高度;位置就是指这个长方形在屏幕上的位置。在Qt中保存的这个长方形使用的是QRect类,这 阅读全文
posted @ 2020-07-30 13:46
胸怀丶若谷
阅读(186)
评论(0)
推荐(0)
摘要:
PyQt使用统一的坐标系统来定位窗口空间的位置和大小。左上角为原点(0,0). 阅读全文
posted @ 2020-07-30 13:24
胸怀丶若谷
阅读(138)
评论(0)
推荐(0)
摘要:
方法和描述 addToolBar():添加工具栏 centralWidget():返回窗口中心的一个空间,未设置时返回NULL menuBar(): 返回主窗口的菜单栏 setCentralWidget():设置窗口中心的控件 setStausBar(): 设置状态栏 statusBar():获得状 阅读全文
posted @ 2020-07-30 10:56
胸怀丶若谷
阅读(128)
评论(0)
推荐(0)
摘要:
QMainWindow、QWidgwt和QDialog三个类都是用来创建窗口的,可以直接使用,也可以继承后再使用。 QMainWindow窗口可以包含菜单栏、工具栏、状态栏、标题栏等。是最常见的窗口像是。 QDialog是对话窗口的基类。对话框主要用来执行短期任务,或者与用户进行互动。 如何使用: 阅读全文
posted @ 2020-07-30 10:39
胸怀丶若谷
阅读(546)
评论(0)
推荐(0)

浙公网安备 33010602011771号