站內搜尋:Yahoo搜尋的結果,如果沒有給完整的網址,請在站內再搜尋一次!

2019-08-17

讓在Anaconda Navigator環境下安裝執行的Visual Studio Code增加PYQT Integration的擴充功能

  1. 在Visual Studio Code安裝PYQT Integration的擴充功能
  2. 安裝PYQT Integration擴充功能後,將會增加下列功能,或更多,例如:
    從VS code直接開啟 designer.exe 新增 ui form,在VS Code下預覽 ui form ...

    PYQT: New FormOpen designer
    PYQT: Edit In DesignerOpen designer with current ui form
    PYQT: PreviewPreview current ui form
    PYQT: Compile FormCompile ui form to path defined in "pyqt-integration.pyuic.compile.filepath"
    PYQT: Compile ResourceCompile qrc file to path defined in "pyqt-integration.pyrcc.compile.filepath"
    PYQT: Generate Translation File (.ts)Compile UI file (.py) to translation file with path defined in "pyqt-integration.pylupdate.compile.filepath"
    Compile .pro file
    PYQT: Open With Qt LinguistOpen with Qt Linguist for translation file (.ts)
  3. 如果從 VS Code,無法正常啟動 designer.exe 或 pyuic5 ...,可以透過擴充延伸模組設定,指定正確的路徑、檔名 ...
  4. 以Qtdesigner這個設定項目為例,designer.exe,通常都是放在,Anaconda3安裝目錄的\Lib\site-packages\pyqt5_tools\路徑下。
  5. 設定項目的參考資料:
    pyqt-integration.qtdesigner.pathPath of executable file of qt designer, the extension will ask you to set at the first time it runs, e.g. c:\\Users\\username\\AppData\\Local\\Programs\\Python\\Python35\\Lib\\site-packages\\pyqt5-tools\\designer.exe
    pyqt-integration.pyuic.cmd"pyuic" command, default "pyuic5"
    pyqt-integration.pyuic.compile.filepathCompile file path, relative path as default, switch to absolute path by involving ${workspace}, e.g. ${workspace}\\UI\\Ui_${ui_name}.py
    pyqt-integration.pyuic.compile.addOptionsAdditional options for pyuic compiling, it can be a combination of '-x', '-d', '-i', etc.
    pyqt-integration.pyrcc.cmd"pyrcc" command, default "pyrcc5"
    pyqt-integration.pyrcc.compile.filepathCompile file path, relative path as default, switch to absolute path by involving ${workspace}, e.g. ${workspace}\\QRC\\${qrc_name}_rc.py
    pyqt-integration.pyrcc.compile.addOptionsAdditional options for pyrcc compiling, it can be a combination of '-root', '-threshold', '-compress', '-no-compress', etc.
    pyqt-integration.pylupdate.cmd"pylupdate" command, default "pylupdate5"
    pyqt-integration.pylupdate.compile.filepathOnly works when compiling an UI file (.py), Stores the target '.ts' file's path, relative path as default, switch to absolute path by involving ${workspace}, e.g. ${workspace}\\TS\\${ts_name}.ts
    pyqt-integration.pylupdate.compile.addOptionsAdditional options for pylupdate, it can be a combination of '-verbose', '-noobsolete', '-tr-function', '-translate-function', etc.
    pyqt-integration.linguist.cmd"linguist" command, default "linguist"

沒有留言:

張貼留言