QT是一款跨平台的图形用户界面应用程序开发框架,支持C++及python接口。开发者套件支持通过远程登录工具或使用图形化桌面运行QT及项目,进行界面的查看。
C++方式
sudo apt install --no-install-recommends \ qtbase5-dev qtbase5-dev-tools qtdeclarative5-dev libqt5svg5-dev qttools5-dev libgnutls28-dev \ qml-module-qtquick2 qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qtquick-templates2 qml-module-qtquick-window2 qml-module-qtgraphicaleffects qtcreator
qtcreator
或
designer
Python方式
conda install -c conda-forge pyqt
import sys from PyQt5.QtWidgets import QApplication, QWidget, QLabel if __name__ == '__main__': app = QApplication(sys.argv) w = QWidget() # 设置窗口标题 w.setWindowTitle('小藤的PyQt!') label = QLabel('Welcome to Ascend Devkit!', parent=w) label.move(200, 200) w.setStyleSheet("background-color:yellow;") # 展示窗口 w.show() # 程序进行循环等待状态 app.exec_()
python pyqt_demo.py