X
X
xSkyFoXx2012-07-13 11:37:23
Python
xSkyFoXx, 2012-07-13 11:37:23

Is there some not-so-rich out-of-the-box text editor for Qt (PyQt)?

Maybe someone faced the problem. There is an area for entering multiline text. I would like to screw elementary functions into it with buttons for bold, italic and underlined font style. There are no problems with the output of such a text. Qt outputs html formatted text just fine. But I don’t feel like writing my semi-rich editor at all.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
B
becks, 2012-07-13
@becks

If I'm not mistaken, there was something similar in Qt demos. It seems to me that it will take you longer to search and deal with someone else's code than write everything from scratch yourself.
If you don’t feel like writing at all, you can look at qt-apps.org for sure you will find it.

C
cencio, 2012-07-13
@cencio

QScintilla, there are bindings for python.

F
Fak3, 2012-07-19
@Fak3

katepart from KDE

I
Ilya Kovalevsky, 2012-08-27
@namespace

They are not. And if there is, then it is a huge rarity. If you need to edit sources, there are several options:
* QScintilla - I wrote about it on Habré (it is in Mine), now I have abandoned it in favor of QSupernova, for many reasons that are well described by hlamer in his post "The Dark Side of QScintilla" .
* QSupernova is an editor based on QTextEdit and xml from katepart (a project of mine, currently in very early development)
* Can be torn from other applications, but it is very labor intensive.

H
hlamer, 2012-08-27
@hlamer

If you drop a QTextEdit on a Qt Designer form and then select “Change HTML” from the context menu, it opens up about what you need.
Look at the sources of Qt Designer, maybe it will suit you.

I
icoz, 2013-03-10
@icoz

It's easier to write yourself. Create a button for, say, italics. Hook the QAction, and wire the toggled(bool) signal from the QAction() to the QTextEdit, setFontItalic(bool).
Thus, there is no need to write processing code at all.
In the old days, when I started to learn Qt, I wrote this myself - I was very surprised by the simplicity.
Of course, if some bells and whistles are already required, then the handlers will have to be written independently.
Approximately the same as what you did in sf.net/projects/dbnote - you can see the implementation there. A simple editor is obtained simply by connecting signal-slots.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question