pyqt5 Getting started with pyqt5 Installation or Setup


Example

  1. Install Anaconda(PyQt5 is build-in), especially for windows user.
  2. Integrate QtDesigner and QtUIConvert in PyCharm(External Tools)
    • Open PyCharm Settings > Tools > External Tools
    • Create Tool(QtDesigner) - used to edit *.ui files
    • Create Tool(PyUIConv) - used to convert *.ui to *.py
  3. Write Demo
    • new window.ui by external tool(QtDesigner)
    • convert to window.py by external tool(PyUIConv)
    • demo
      import sys
      from PyQt5.QtWidgets import QApplication,QMainWindow
      from window import Ui_MainWindow
      
      if __name__ == '__main__':
          app = QApplication(sys.argv)
          w = QMainWindow()
          ui = Ui_MainWindow()
          ui.setupUi(w)
          w.show()
          sys.exit(app.exec_())