Skip to main content

QtSimpleWidgets Adiciona Novos ao PyQt5

Project description

QSimpleWidgets

Um Sistema que traz um QWidget Para Edição de Codigo

Exemplo de codigo de Editor Basico usando o QSimpleWidgets

from QSimpleWidgets import QCodeEdit,QSetStyles

# Configurações do Editor
STYLES = {
    'keyword': QSetStyles(255, 0, 157),
    'operator': QSetStyles(255, 0, 157,"bold"),
    'brace': QSetStyles(255,255,255),
    'string': QSetStyles(255, 238, 0),
    'comment': QSetStyles(90,90,90),
    'numbers': QSetStyles(132, 0, 255),
}

# Palavras resevadas
keywords = [
    'and', 'assert', 'break', 'class', 'continue', 'def',
    'del', 'elif', 'else', 'except', 'exec', 'finally',
    'for', 'from', 'global', 'if', 'import', 'in',
    'is', 'lambda', 'not', 'or', 'pass', 'with',
    'raise', 'return', 'try', 'while', 'yield',
    'None', 'True', 'False',
]

# Python Operadores
operators = [
    '=',
    # Comparadores
    '==', '!=', '<', '<=', '>', '>=',
    # Aritimeticos
    '\+', '-', '\*', '/', '//', '\%', '\*\*',
    # Outros
    '\+=', '-=', '\*=', '/=', '\%=',
    # Outros
    '\^', '\|', '\&', '\~', '>>', '<<',
]


# Outros
braces = [
    '\{', '\}', '\(', '\)', '\[', '\]',
]

class PythonCodeEditor(QMainWindow):
    def __init__(self):
        super().__init__()
        self.view = QCodeEdit(self,STYLES,keywords,operators,braces)
        self.view.keywordColor.SetNewKeywordColor("self",SetStyles(255,0,255,"bold")) # Colorca um cor em um keyword
        self.setCentralWidget(self.view)


App = QApplication([])
editor = PythonCodeEditor()
editor.show()
App.exec()

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

QSimpleWidgets-0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

QSimpleWidgets-0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file QSimpleWidgets-0.1.tar.gz.

File metadata

  • Download URL: QSimpleWidgets-0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for QSimpleWidgets-0.1.tar.gz
Algorithm Hash digest
SHA256 ce7c2d301770521be03f51601c5250875377956a3c1f84d840f95fdfd66ed31b
MD5 14e48ee6a2b56b258cd3331df2d83af6
BLAKE2b-256 ece6661d0240d2e64e77a66f9c0340c934311e7a2ea02192fb2cc65e8ee6a644

See more details on using hashes here.

File details

Details for the file QSimpleWidgets-0.1-py3-none-any.whl.

File metadata

  • Download URL: QSimpleWidgets-0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for QSimpleWidgets-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79b75a2e2a548aa0eeae7efe38d2944ed26361b57605be21aded4bcb7ae61f20
MD5 18545494c8978f15433d2fd6bbd9990d
BLAKE2b-256 50795d90fd2dc94f96d969993f6ac917ac1c3224c3fb2b66acbbbf1d7be9f9f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page