[pyqt5 interface tool development-12] QtDesigner graphical interface design

Table of contents

0x00 Preface

1. Start the program

2. Basic use

3. Save the layout file

Fourth, load the UI file


0x00 Preface

About the configuration and other steps of the QtDesigner tool (there are also many online links)

The following links are not my own (if you have installed pyqt5 and tools on the command line using pip, you can skip the previous steps)

PyCharm installs PyQt5 and its tools (Qt Designer, PyUIC, PyRcc) detailed tutorial - Zhihu Abstract: Qt is a commonly used user interface design tool, and in Python, the toolkit PyQt is used, which is the Python programming language and Qt library successful fusion. This blog post introduces in detail how to install and configure all the toolkits of PyQt5 in PyCharm in a complete and elegant way through pictures and texts. The main content includes PyQt5... icon-default.png?t=N7T8https://zhuanlan.zhihu.com/p/469526603



1. Start the program

If you are using the above tutorial, you can start it directly in the added extension tool

Then select the corresponding window to create

Interface display of some operations

(After checking, it will be displayed in the interface)



2. Basic use

1. Drag the control on the left to the icon, and then set the layout

2. Then preview

window--->preview

The preview interface can be clicked



3. Save the layout file

save it as

files with ui suffix



Fourth, load the UI file

load and display ui file

import sys

from PyQt5 import uic
from PyQt5.QtWidgets import *




if __name__ == '__main__':
    app = QApplication(sys.argv)

    ui = uic.loadUi("./my_win.ui")      # 加载ui文件
    ui.show()                           # 展示窗口

    sys.exit(app.exec_())

Guess you like

Origin blog.csdn.net/qq_53079406/article/details/132580485