[Qt-interest] problem with sleep

mierdatutis mi mmm286 at gmail.com
Tue Jun 23 21:48:53 CEST 2009


Many thanks!

I try with QTextBrowser.setText but I have the same problem. How could I do
it with qtimer?

Many thanks!


2009/6/23 Pascal Patry <iscy at invalidip.com>

> On Tuesday 23 June 2009 15:25:48 mierdatutis mi wrote:
> > Hi,
> >
> > I try have program that when I do click in a QListWidget puts in a
> > QTextBrowser some text, then sleeps X seconds and then put other text but
> > it doesn't works. The first text that I put ( ---DESCARGANDO SINOPSIS
> ---)
> > never appears in the object Qtextbrowser.
> >
> > Any help?
> >
> >
> >
> >
> > Any help?
> >
> >  To sleep:
> >
> >
> > class I : public QThread
> >
> > {
> >
> > public:
> >
> > static void sleep(unsigned long secs) {
> >
> > QThread::sleep(secs);
> >
> > }
> >
> > static void msleep(unsigned long msecs) {
> >
> > QThread::msleep(msecs);
> >
> > }
> >
> > static void usleep(unsigned long usecs) {
> >
> > QThread::usleep(usecs);
> >
> > }
> >
> > };
> >
> >
> > To put the text I do:
> >
> >
> > texto->setHtml(" ---DESCARGANDO SINOPSIS ---");
> >
> > I::sleep(3);
> > texto->setHtml(" ---acabado tiempo DESCARGANDO SINOPSIS ---");
>
> 1. You seems to be blocking the event loop, so nothing will get painted on
> the
> screen. You should not be doing sleep but instead, you should rely on a
> 'QTimer' to append the rest of the text.
> 2. 'setHtml()' resets everything, it doesn't only append things together.
> 3. 'setHtml()' is usually for html content, "---" is not a valid html tag.
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090623/bf7e6768/attachment.html 


More information about the Qt-interest-old mailing list