daravi / vscode-qt-for-python

Qt for Python (PyQt5 and PySide2) extension for Visual Studio Code.

Home Page:https://marketplace.visualstudio.com/items?itemName=seanwu.vscode-qt-for-python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Visual Studio Code Extension Qt for Python

version rating downloads installs dependencies Status devDependencies Status

A Visual Studio Code extension provides some common functionalities for PyQt5 and PySide2 with Qt Creator.

Qt Markup Language (qml) Qt Style Sheets (qss) Resource Collection Files (qrc)
qml qss qrc
qmake Files (pro) Qt Linguist Translation (qt.ts) QML Module Definition Files (qmldir)
pro qtts qmldir
Qt Markup Language (*.qml) Qt Designer Form (*.ui) Qt Linguist Translation (*.qt.ts)
preview preview preview

Features

  • Qt Markup Language (*.qml) highlighting and snippets support
  • QML Module Definition Files (*.qmldir) highlighting and snippets support
  • Qt Style Sheets (*.qss) highlighting and snippets support
  • Qt Linguist Translation (*.qt.ts) highlighting support (XML)
  • Resource Collection Files (*.qrc) highlighting support (XML)
  • Qt Designer Form (*.ui) highlighting support (XML)
  • Qt Creator User Settings (*.pro.user) highlighting support (XML)
  • qmake highlighting support
  • New form (Qt Designer *.ui file) command
  • Edit form (Qt Designer *.ui file) command
  • Compile form (Qt Designer *.ui file) into Python file (require pyuic5 or pyside2-uic)
  • Update translation (Qt Linguist *.qt.ts file) from Python file (require pylupdate5 or pyside2-lupdate)
  • Edit translation (Qt Linguist *.qt.ts file)
  • Release translation (Qt Linguist *.qt.ts file) to *.qm file
  • Preview QML
  • Compile QRC (Qt Resource File) into Python file (require pyrcc5 or pyside2-rcc)

Supported Environment Variables

The following list shows the supported environment variables you can use for the path of Qt tools in configurations.

Predefined Variables

  • ${workspaceFolder} - the path of the folder opened in VS Code
  • ${workspaceFolderBasename} - the name of the folder opened in VS Code without any slashes (/)
  • ${file} - the current opened file
  • ${relativeFile} - the current opened file relative to workspaceFolder
  • ${fileBasename} - the current opened file's basename
  • ${fileBasenameNoExtension} - the current opened file's basename without file extension
  • ${fileDirname} - the current opened file's dirname
  • ${fileExtname} - the current opened file's extension
  • ${lineNumber} - the current selected line number in the active file
  • ${selectedText} - the current selected text in the active file

The example of predefined variables can be found here.

System Environment Variables

You can also reference environment variables through the ${env:Name} syntax (for example, ${env:USER}).

Be sure to match the environment variable name's casing, for example, ${env:Path} on Windows.

Requirements

This extension requires Qt Designer, Qt Linguist, Qt lrelease and Qt qmlscene for different features. You could install these tools by installing Qt Creator.

After the installation, you could find the tools within the installing folder of Qt Creator in your computer. For example, if you install Qt Creator 5.13.0 in /opt/Qt in Linux, you could find out the binary of these tools in /opt/Qt/5.13.0/gcc_64/bin. Or, for Windows, you could find the binary of the tools in C:\Qt\5.13.0\mingw73_64\bin if you did not change the default path. You have to set the paths of tools in Qt for Python section in user settings of Visual Studio Code before using the commands provided by this extension.

Caveat

  • All file generated by the following command would overwrite the existing files with the same name without warning.

Release Notes

Please see the release notes in CHANGELOG.

About

Qt for Python (PyQt5 and PySide2) extension for Visual Studio Code.

https://marketplace.visualstudio.com/items?itemName=seanwu.vscode-qt-for-python

License:MIT License


Languages

Language:TypeScript 52.1%Language:QML 22.6%Language:Python 22.4%Language:QMake 3.0%