Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 45977c0

Browse files
committed
Merge branch 'develop'
2 parents cc93244 + f3770bb commit 45977c0

29 files changed

+1894
-105
lines changed

CHANGELOG.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
11
# Change Log
2-
All notable changes to the "vscode-qt-for-python" extension will be documented in this file.
32

4-
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
3+
## Unreleased
54

6-
## [Unreleased]
7-
- Initial release
5+
### Added
6+
7+
* Python UI compiler (`pyuic5`, `pyside2-uic`)
8+
* Python Resource Compiler (`pyrcc5`, `pyside2-rcc`)
9+
* Python `lupdate` (`pylupdate5`, `pyside2-lupdate`)
10+
* CI/CD
11+
12+
## 0.0.1
13+
14+
### Added
15+
16+
* Qt Markup Language (`*.qml`) highlighting and snippets support
17+
* QML Module Definition Files (`*.qmldir`) highlighting and snippets support
18+
* Qt Style Sheets (`*.qss`) highlighting and snippets support
19+
* Qt Linguist Translation (`*.qt.ts`) highlighting support (XML)
20+
* Resource Collection Files (`*.qrc`) highlighting support (XML)
21+
* Qt Designer Form (`*.ui`) highlighting support (XML)
22+
* Qt Creator User Settings (`*.pro.user`) highlighting support (XML)
23+
* `qmake` highlighting support
24+
* New form (Qt Designer `*.ui` file) command
25+
* Edit form (Qt Designer `*.ui` file) command
26+
* Edit translation (Qt Linguist `*.qt.ts` file)
27+
* Release translation (Qt Linguist `*.qt.ts` file) to `*.qm` file
28+
* Preview QML

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Sean Wu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,79 @@
1-
# vscode-qt-for-python README
1+
# Visual Studio Code Extension Qt for Python
22

3-
This is the README for your extension "vscode-qt-for-python". After writing up a brief description, we recommend including the following sections.
3+
A Visual Studio Code extension provides some common functionalities for PyQt5 and PySide2 with Qt Creator.
44

5-
## Features
5+
| Qt Markup Language (`qml`) | Qt Style Sheets (`qss`) | Resource Collection Files (`qrc`) |
6+
|:---------------------------------------:|:---------------------------------------:|:---------------------------------------:|
7+
| ![qml](https://i.imgur.com/YDWuDDJ.png) | ![qss](https://i.imgur.com/N1w3vs9.png) | ![qrc](https://i.imgur.com/6qW1YTI.png) |
68

7-
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
9+
| `qmake` Files (`pro`) | Qt Linguist Translation (`qt.ts`) | QML Module Definition Files (`qmldir`) |
10+
|:---------------------------------------:|:----------------------------------------:|:------------------------------------------:|
11+
| ![pro](https://i.imgur.com/kI3m5c4.png) | ![qtts](https://i.imgur.com/TnizAQd.png) | ![qmldir](https://i.imgur.com/F6NH69h.png) |
812

9-
For example if there is an image subfolder under your extension project workspace:
13+
| Qt Markup Language (`*.qml`) | Qt Designer Form (`*.ui`) | Qt Linguist Translation (`*.qt.ts`) |
14+
|:-------------------------------------------:|:-------------------------------------------:|---------------------------------------------|
15+
| ![preview](https://i.imgur.com/fSwBIjL.png) | ![preview](https://i.imgur.com/1MMSV2b.png) | ![preview](https://i.imgur.com/Wjf2PkO.png) |
1016

11-
\!\[feature X\]\(images/feature-x.png\)
17+
## Features
1218

13-
> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow.
19+
* [x] Qt Markup Language (`*.qml`) highlighting and snippets support
20+
* [x] QML Module Definition Files (`*.qmldir`) highlighting and snippets support
21+
* [x] Qt Style Sheets (`*.qss`) highlighting and snippets support
22+
* [x] Qt Linguist Translation (`*.qt.ts`) highlighting support (XML)
23+
* [x] Resource Collection Files (`*.qrc`) highlighting support (XML)
24+
* [x] Qt Designer Form (`*.ui`) highlighting support (XML)
25+
* [x] Qt Creator User Settings (`*.pro.user`) highlighting support (XML)
26+
* [x] `qmake` highlighting support
27+
* [x] New form (Qt Designer `*.ui` file) command
28+
* [x] Edit form (Qt Designer `*.ui` file) command
29+
* [x] Edit translation (Qt Linguist `*.qt.ts` file)
30+
* [x] Release translation (Qt Linguist `*.qt.ts` file) to `*.qm` file
31+
* [x] Preview QML
1432

1533
## Requirements
1634

17-
If you have any requirements or dependencies, add a section describing those and how to install and configure them.
18-
19-
## Extension Settings
20-
21-
Include if your extension adds any VS Code settings through the `contributes.configuration` extension point.
22-
23-
For example:
35+
This extension requires Qt Designer, Qt Linguist, Qt `lrelease` and Qt `qmlscene` for different features. You could install these tools by installing [Qt Creator](https://www.qt.io/download).
2436

25-
This extension contributes the following settings:
26-
27-
* `myExtension.enable`: enable/disable this extension
28-
* `myExtension.thing`: set to `blah` to do something
37+
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.12.0 in `/opt/Qt` in Linux, you could find out the binary of these tools in `/opt/Qt/5.12.0/gcc_64/bin`. You have to set the paths of tool in **Qt for Python** section in user settings of Visual Studio Code before using the commands provided by this extension.
2938

30-
## Known Issues
39+
## Commmand and Explorer Context Menu
3140

32-
Calling out known issues can help limit users opening duplicate issues against your extension.
41+
> **Note**: All file generated by the following command would overwrite the existing file with the same name **without warning**.
3342
34-
## Release Notes
43+
### New Form (Qt Designer UI File)
3544

36-
Users appreciate release notes as you update your extension.
45+
* When: Any condition for command palette or the target in explorer context is a folder.
46+
* Behavior: Create new UI file in Qt Designer.
3747

38-
### 1.0.0
48+
### Edit Form (Qt Designer UI File)
3949

40-
Initial release of ...
50+
* When: The file name extension of the target file in explorer context or the current document in the editor is `*.ui`.
51+
* Behavior: Edit the UI file in Qt Designer.
4152

42-
### 1.0.1
53+
### Edit Qt Linguist Translation File
4354

44-
Fixed issue #.
55+
* When: The file name extension of the target file in explorer context or the current document in the editor is `*.qt.ts` and the language is `xml`.
56+
* Behavior: Edit the `qt.ts` file in Qt Linguist.
4557

46-
### 1.1.0
58+
### Release Qt Linguist Translation to QM File
4759

48-
Added features X, Y, and Z.
60+
* When: The file name extension of the target file in explorer context or the current document in the editor is `*.qt.ts` and the language is `xml`.
61+
* Behavior: Use `lrelease` to convert the `qt.ts` file into `*.qm` file.
4962

50-
-----------------------------------------------------------------------------------------------------------
63+
### Preview QML
5164

52-
## Working with Markdown
65+
* When: The file name extension of the target file in explorer context or the current document in the editor is `*.qml`.
66+
* Behavior: Use `qmlscene` to preview the QML file.
5367

54-
**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:
68+
## Extension Settings
5569

56-
* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux)
57-
* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux)
58-
* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets
70+
This extension contributes the following settings:
5971

60-
### For more information
72+
* `qtForPython.path.designer`: The path of Qt Designer with CLI arguments to create and edit form (`*.ui`) files. For example, `/opt/Qt/5.12.0/gcc_64/bin/designer`.
73+
* `qtForPython.path.linguist`: The path of Qt Linguist with CLI arguments to edit translation (`*.qt.ts`) files. For example, `/opt/Qt/5.12.0/gcc_64/bin/linguist`.
74+
* `qtForPython.path.lrelease`: The path of Qt lrelease with CLI arguments to edit translation (`*.qt.ts`) files. For example, `/opt/Qt/5.12.0/gcc_64/bin/lrelease -qm ./out.qm`.
75+
* `qtForPython.path.qmlscene`: The path of Qt QML Scene (`qmlscene`) with CLI arguments to preview QML (`*.qml`) files. For example, `/opt/Qt/5.12.0/gcc_64/bin/qmlscene --verbose`.
6176

62-
* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
63-
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)
77+
## Release Notes
6478

65-
**Enjoy!**
79+
Please see the release notes in [CHANGELOG](CHANGELOG.md).

images/icon.png

3.92 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"brackets": [
3+
["{", "}"],
4+
["[", "]"],
5+
["(", ")"]
6+
],
7+
"autoClosingPairs": [
8+
{ "open": "{", "close": "}", "notIn": ["string", "comment"] },
9+
{ "open": "[", "close": "]", "notIn": ["string", "comment"] },
10+
{ "open": "(", "close": ")", "notIn": ["string", "comment"] },
11+
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] },
12+
{ "open": "'", "close": "'", "notIn": ["string", "comment"] }
13+
],
14+
"surroundingPairs": [
15+
["{", "}"],
16+
["[", "]"],
17+
["(", ")"],
18+
["\"", "\""],
19+
["'", "'"]
20+
],
21+
"folding": {
22+
"markers": {
23+
"start": "^\\s*#region\\b",
24+
"end": "^\\s*#endregion\\b"
25+
}
26+
}
27+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"comments": {
3+
"lineComment": "//",
4+
"blockComment": [ "/*", "*/" ]
5+
},
6+
"brackets": [
7+
["{", "}"],
8+
["[", "]"],
9+
["(", ")"]
10+
],
11+
"autoClosingPairs": [
12+
["{", "}"],
13+
["[", "]"],
14+
["(", ")"],
15+
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
16+
{ "open": "\"", "close": "\"", "notIn": ["string"] },
17+
{ "open": "`", "close": "`", "notIn": ["string", "comment"] },
18+
{ "open": "/**", "close": " */", "notIn": ["string"] }
19+
],
20+
"surroundingPairs": [
21+
["{", "}"],
22+
["[", "]"],
23+
["(", ")"],
24+
["<", ">"],
25+
["'", "'"],
26+
["\"", "\""],
27+
["`", "`"]
28+
],
29+
"folding": {
30+
"offSide": true,
31+
"markers": {
32+
"start": "^\\s*//#region",
33+
"end": "^\\s*//#endregion"
34+
}
35+
},
36+
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)"
37+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"folding": {
3+
"markers": {
4+
"start": "^\\s*#region\\b",
5+
"end": "^\\s*#endregion\\b"
6+
}
7+
}
8+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"comments": {
3+
"blockComment": ["/*", "*/"]
4+
},
5+
"brackets": [
6+
["{", "}"],
7+
["[", "]"],
8+
["(", ")"]
9+
],
10+
"autoClosingPairs": [
11+
{ "open": "{", "close": "}", "notIn": ["string", "comment"] },
12+
{ "open": "[", "close": "]", "notIn": ["string", "comment"] },
13+
{ "open": "(", "close": ")", "notIn": ["string", "comment"] },
14+
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] },
15+
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
16+
{ "open": "/**", "close": " */", "notIn": ["string"] }
17+
],
18+
"surroundingPairs": [
19+
["{", "}"],
20+
["[", "]"],
21+
["(", ")"],
22+
["\"", "\""],
23+
["'", "'"]
24+
],
25+
"folding": {
26+
"markers": {
27+
"start": "^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/",
28+
"end": "^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/"
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)