PyQCodeEditor
A simple code edit widget for pyside and pyqt (qtpy).
Description
This is a python implementation of the QCodeEditor(written in C++ Qt). This project uses qtpy as the abstract layer of different python bindings of Qt, so that the user can choose whatever python binding of qt they want, like pyqt5、pyqt6、pyside2、pyside6.
The original QCodeEditor can be found here: https://github.com/Megaxela/QCodeEditor.
Status
Now the following features are implemented:
- Auto parentheses.
- Different highlight rules.
- Auto indentation.
- Replace tabs with spaces.
- Some builtin completion and highlight rules
- Support custom themes and styles
- Pure python, No C++ code
Completers for:
Highlighters for:
Unimplemented and known bugs:
-
Frame selection (I write the python according to the original C++ code, but some bugs are occurred and I don't know why and how fix it for now)
-
Highlighting for python's multi-line strings is not fully behave as expected (again I don't time to look into it and find a workaround now, any help is welcome)
Different from QCodeEditor:
- The styles and language rules are defined in json instead of xml
Note: This is not a fully featured IDE or code editor like VS Code
Get-Started
Install this library
pip install PyQCodeEditor
Install the python binding of QT you want, for example, PySide2
pip install pyside2
Import QCodeEditor and use it as any regular qt widget:
from qtpy.QtWidgets import QApplication
from pyqcodeeditor.QCodeEditor import QCodeEditor
from pyqcodeeditor.highlighters import QPythonHighlighter
from pyqcodeeditor.completers import QPythonCompleter
app = QApplication([])
editor = QCodeEditor()
editor.setCompleter(QPythonCompleter())
editor.setHighlighter(QPythonHighlighter())
editor.resize(800, 600)
editor.setPlainText("print('hello world!')")
editor.show()
app.exec_()
Here is a screenshot of the above code:
License
This lib itself is under the MIT license, but user should also comply with the license of the qt binding lib they choose. For example, if the user uses PyQT5, they should comply with the GPL license, if they chooses the PySide2 they should comply with the LGPL license, and so on
Metadata
Release files for pyqcodeeditor 0.3.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyqcodeeditor-0.3.7.tar.gz | 17.9 kB | Without provenance | Details for pyqcodeeditor-0.3.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyqcodeeditor-0.3.7-py3-none-any.whl | Python 3 | none | any | Details for pyqcodeeditor-0.3.7-py3-none-any.whl |
Total release size: 46.7 kB
Release files / pyqcodeeditor-0.3.7.tar.gz
| Download URL | pyqcodeeditor-0.3.7.tar.gz |
|---|---|
| Size | 17.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b153a15d4514ffec0417db6a5e1335901ed205dcaac0cdadfd7a790c050c8df5
|
|
BLAKE2b-256 checksum How to use checksums |
314fac4acc743496d1be8062e2bfb7ed3ca4f86b0686340624942f6b380b8e5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.8.10 Windows/10
|
Release files / pyqcodeeditor-0.3.7-py3-none-any.whl
| Download URL | pyqcodeeditor-0.3.7-py3-none-any.whl |
|---|---|
| Size | 28.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4adc216e207a8648783834cb78782f86a777765801627cebcadd5b426629bb8c
|
|
BLAKE2b-256 checksum How to use checksums |
84da8160a149c9868f71f8d145505d0140ce3e5b46c000ad30eb063ab7914c9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.8.10 Windows/10
|
Security for pyqcodeeditor 0.3.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.