PCM_Viewer/test_basic.py

32 lines
770 B
Python

"""
基础测试脚本 - 测试PySide6是否能正常工作
"""
import sys
import os
from PySide6.QtWidgets import QApplication, QLabel
if __name__ == "__main__":
print("Testing basic PySide6 functionality...")
# 测试基本的Qt Widgets
app = QApplication(sys.argv)
label = QLabel("Hello PySide6!")
label.show()
# 运行应用程序
print("Application started successfully!")
print("If you see a window with 'Hello PySide6!', basic PySide6 is working.")
# 运行一小段时间后退出
import time
from PySide6.QtCore import QTimer
def quit_app():
app.quit()
timer = QTimer()
timer.timeout.connect(quit_app)
timer.start(2000) # 2秒后退出
sys.exit(app.exec())