Krita Source Code Documentation
Loading...
Searching...
No Matches
test.py
Go to the documentation of this file.
1
"""
2
SPDX-FileCopyrightText: 2017 Eliakin Costa <eliakim170@gmail.com>
3
4
SPDX-License-Identifier: GPL-2.0-or-later
5
"""
6
# editor.py
7
8
try
:
9
from
PyQt6.QtCore
import
QApplication
10
from
PyQt6.QtGui
import
QFont
11
from
PyQt6.QtWidgets
import
QPlainTextEdit
12
except
:
13
from
PyQt5.QtCore
import
QApplication
14
from
PyQt5.QtGui
import
QFont
15
from
PyQt5.QtWidgets
import
QPlainTextEdit
16
17
import
syntax
18
19
app = QApplication([])
20
editor = QPlainTextEdit()
21
f = QFont(
"monospace"
, 10, QFont.Weight.Normal)
22
f.setFixedPitch(
True
)
23
editor.document().setDefaultFont(f)
24
highlight = syntax.PythonHighlighter(editor.document())
25
26
27
editor.show()
28
29
# Load syntax.py into the editor for demo purposes
30
31
# infile = open('syntax.py', 'r')
32
# editor.setPlainText(infile.read())
33
34
app.exec()
QtCore
QtGui
QtWidgets
QtCore
QtGui
QtWidgets
plugins
python
scripter
test.py
Generated at
2025-11-04 02:30:02+01:00
from
Krita
branch
master
, commit
c9dde2e79561a8aea4a7e8d9ac99c98a7bac9e52