PDA

View Full Version : QTextEdit and toHtml()



prof.ebral
27th June 2010, 14:05
:mad: Can I prevent Qt (PyQt4) from forcing it's HTML style onto my QTextEdit's .toHtml() statement? I am trying to make a WYSIWYG Editor and at this point I have to decide what I which direction I am going to take.

QTextEdit offers really nice functionality, especially since I can gain access to the position of the selected text. This can allow me to bold / unbold text. Being that I am a new I am sure I could be more efficient. I am currently just formulating a process to build on.

QWebView looks like it would offer a lot, but my problem with QWebView is the lack of access to the mouse's position in it's own Widget. How was this not implemented? .textCursor() and .position() QWebView does not have .textCursor().

So right now I am looking for direction. If I can find how to prevent QTextEdit from implementing it's awful .toHtml() syntax all over the place ... or if I could discover how to find the position of my selected text in QWebView I could move on. Anyone that can help?

prof.ebral
27th June 2010, 15:16
I have a decision I am running with. It is really draconian, guerilla, outdated ... but I am going to go with it. I have a feeling I should be look at QWebView and it's DOM features ... but no where for the life of me can I find it. WebKit would be awesome if I could just extract the element and it's text from my selection. WYSIWYG editors would be a simple tag change then.