Hello,
I need to insert an image as a footer in QTextEdit.
How can I reach the end of the QTextEdit and put the image.
How can I stick it in that place.
Thanks a lot
Hello,
I need to insert an image as a footer in QTextEdit.
How can I reach the end of the QTextEdit and put the image.
How can I stick it in that place.
Thanks a lot
may be
http://www.wysota.eu.org/wwwidgets/
helps you.
see QwwButtonLineEdit
and
QwwClearLineEdit
east or west home is best
Thanks Kwisp,
That seems interesting.
Unfortunately, the feature am looking for is not likely to be implemented by wwWidgets ..
Any other suggestions ? ..
Last edited by Cortex; 22nd October 2009 at 16:16.
Hi,
first we - at least I - prefer normal font size. Second I only see a possibility for your footer if you subclass QTextEdit and watch the modification of the QTextDocument. There you must ensure that the footer is the last text. If that isn't the case, change the document.
Sorry for the font size.
Lykurg, I didn't see your point, my footer is not a text it's an image.
Well, I ended up with:
- Subclassing textEdit
- Reimplementing paintEvent()
- inserting the image as Pixmap using painter.drawPixmap()
Is the footer part of the document or part of the widget? If the latter, then indeed looking at wwWidgets' source code might be helpful.
It's rather the former .. I need to print it with the document later.
So what is the problem? Just insert the footer into the document and don't allow the user to edit it.
How to do that? I mean inserting the footer in the document.
How to make the cursor go down to the bottom of the document and insert the image, stick it there so it won't move if the user edit the document ?
That was exactly my question from the beginning.
As I said earlier, the best solution I found is to draw it with paintEvent().
Just go through QTextDocument and QTextCursor API. QTextCursor::insertImage is the most likely thing to use to insert an image, don't you think?
I've seen all these classes, before I post here.
It's not about simply insert an image into a QTextDocument.
Anyway I managed to solve it now.
I do thank you.
Bookmarks