Skip to content

pyqt5-tools development and configuration  #5

Description

@Tim-eyes

Issue

Our member has the problem of compiling .qrc file menu.qrc in resource disk. Here, we configure the basic Pycharm IDE with pyqt5-tool to fix the problem.

Tutorial

View the “pycharm + qtdesigner + pyuic + pyrcc tutorial” when using

  1. Install pyqt5-tool and PyQt5
    QT designer is included in pyqt5, which is a python module, so we can install it directly through pip3 install pyqt5. Also, you can install it directly through pycharm.
    Select File->Setting->Project Interpter:
    Snipaste_2021-10-25_17-14-56
    Snipaste_2021-10-25_17-14-30
    Snipaste_2021-10-25_17-13-25

  2. Configure qtdesigner, pyuic and pyrcc
    Select File->Setting->External Tools->Add
    Snipaste_2021-10-25_17-00-05

Specific configuration:
a. qtdesigner

  • Name — enter the name of the last tool you want to render in the menu, such as qtdesigner
  • Program — the location of the designer.exe program, which is located in lib \site-packages\qt5_applications\Qt\bin\designer.exe of the currently used parser

Noticing that different versions of python have different paths of designer.exe

  • Working directory — designer.exe working path, set to $FileDir$
    Snipaste_2021-10-25_17-01-05
    b. pyuic
  • Program -- pyuic is located in Scripts\pyuic5.exe of the current parser
  • Arguments --$FileName$ -o $FileNameWithoutExtension$.py
  • Working directory --$FileDir$
    Snipaste_2021-10-25_17-34-32
    c. pyrcc
  • Program -- pyrcc is located in Scripts\pyrcc5.exe of the current parser
  • Arguments -- $FileName$ -o $FileNameWithoutExtension$_rc.py
  • Working directory -- $FileDir$
    Snipaste_2021-10-25_17-01-29
  1. Use External Tools
    Specifically using pyrcc as the example :
    Snipaste_2021-10-25_17-37-48

The final meua_rc,py must be located in the root directory of your project directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions