parent
54a0afa4f4
commit
b0447f557a
@ -1,5 +0,0 @@
|
||||
from PyQt6.QtCore import QT_VERSION_STR
|
||||
from PyQt6.QtCore import PYQT_VERSION_STR
|
||||
|
||||
print(QT_VERSION_STR)
|
||||
print(PYQT_VERSION_STR)
|
@ -1,11 +0,0 @@
|
||||
from PyQt6.QtCore import QDate, QTime, QDateTime, Qt
|
||||
|
||||
# 获取当前日期
|
||||
now=QDate.currentDate()
|
||||
print(now.toString(Qt.DateFormat.ISODate))
|
||||
print(now.toString(Qt.DateFormat.RFC2822Date))
|
||||
print(now)
|
||||
|
||||
# 获取当前时间
|
||||
datetime=QTime.currentTime()
|
||||
print(datetime.toString())
|
@ -1,37 +0,0 @@
|
||||
import sys
|
||||
from PyQt6.QtWidgets import (QWidget, QToolTip,
|
||||
QPushButton, QApplication)
|
||||
from PyQt6.QtGui import QFont
|
||||
def create_tooltip_widget():
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
# 创建基本的QWidget
|
||||
widget = QWidget()
|
||||
|
||||
# 设置提示字体
|
||||
QToolTip.setFont(QFont('SansSerif', 10))
|
||||
|
||||
# 设置QWidget的提示信息
|
||||
widget.setToolTip('This is a <b>QWidget</b> widget')
|
||||
|
||||
# 创建QPushButton
|
||||
button = QPushButton('Button', widget)
|
||||
button.setToolTip('This is a <b>QPushButton</b> widget')
|
||||
|
||||
# 设置按钮大小和位置
|
||||
button.resize(button.sizeHint())
|
||||
button.move(50, 50)
|
||||
|
||||
# 设置窗口大小和标题
|
||||
widget.setGeometry(300, 300, 300, 200)
|
||||
widget.setWindowTitle('Tooltips')
|
||||
|
||||
# 显示窗口
|
||||
widget.show()
|
||||
|
||||
# 运行应用
|
||||
sys.exit(app.exec())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
create_tooltip_widget()
|
@ -1,23 +0,0 @@
|
||||
import sys
|
||||
from PyQt6.QtWidgets import QApplication, QWidget
|
||||
|
||||
|
||||
def main():
|
||||
# 创建应用程序对象
|
||||
app = QApplication(sys.argv)
|
||||
# 创建窗口
|
||||
w = QWidget()
|
||||
# 设置窗口尺寸
|
||||
w.resize(640, 320)
|
||||
# 设置窗口位置
|
||||
w.move(300, 300)
|
||||
# 设置窗口标题
|
||||
w.setWindowTitle('Simple')
|
||||
# 显示窗口
|
||||
w.show()
|
||||
# 进入主循环
|
||||
sys.exit(app.exec())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Binary file not shown.
Loading…
Reference in new issue