[Qt-interest] QTextEdit not updating...

Eric Clark eclark at ara.com
Thu Aug 18 20:57:12 CEST 2011


I am setting the text by calling QTextEdit::setText. I agree that I shouldn’t have to call update, but if I don’t, the text does not appear.

Eric

From: Jason H [mailto:scorp1us at yahoo.com]
Sent: Thursday, August 18, 2011 11:44 AM
To: Eric Clark; Qt Interest (qt-interest at trolltech.com)
Subject: Re: [Qt-interest] QTextEdit not updating...

Yes. Only use update() if you are doing your own drawing. All other scenarios should be handled in the existing code. In fact, QWidget::update() would know nothing about it being a QTextEdit

How are you setting the text?


________________________________
From: Eric Clark <eclark at ara.com<mailto:eclark at ara.com>>
To: "Qt Interest (qt-interest at trolltech.com<mailto:qt-interest at trolltech.com>)" <qt-interest at trolltech.com<mailto:qt-interest at trolltech.com>>
Sent: Thursday, August 18, 2011 12:30 PM
Subject: Re: [Qt-interest] QTextEdit not updating...
Nevermind… I figured it out. I was calling update on the text edit and that was not working. However, when I call update on the viewport, that does work. It is still a little strange to me that I have to call update though. Shouldn’t it be updating automatically??

Thanks,
Eric

From: qt-interest-bounces+eclark=ara.com at qt.nokia.com<mailto:qt-interest-bounces+eclark=ara.com at qt.nokia.com> [mailto:qt-interest-bounces+eclark=ara.com at qt.nokia.com]<mailto:[mailto:qt-interest-bounces+eclark=ara.com at qt.nokia.com]> On Behalf Of Eric Clark
Sent: Thursday, August 18, 2011 11:12 AM
To: Qt Interest (qt-interest at trolltech.com<mailto:qt-interest at trolltech.com>)
Subject: [Qt-interest] QTextEdit not updating...

Hello All,

I have a QTextEdit inside of a dialog. When I set the text of the editor from code, the GUI is not updating. The only way I can get I to update is to do two things:

1.       Focus the widget.
2.       Drag my cursor across the text.

When I focus the widget by clicking on it, part of the text appears, but not all and sometimes it is just a portion of the letters. The only way to get it to show all of the text is to select it all, then everything looks good. This is very odd behavior to me though. Does anyone know of a way to get the widget to update its display from code, without the user having to “play” with the widget? Any help would be greatly appreciated!

Thanks,
Eric

_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com<mailto:Qt-interest at qt.nokia.com>
http://lists.qt.nokia.com/mailman/listinfo/qt-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110818/37417034/attachment.html 


More information about the Qt-interest-old mailing list