Results 1 to 9 of 9

Thread: QLabel->setText() sometimes not working

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QLabel->setText() sometimes not working

    Quote Originally Posted by cass View Post
    Then how SHOULD I use the timer?
    You should check the time elapsed instead of bumping the value one by one. To simplify the situation you could use QTimeLine.

    The QProgressBar updates fine using the same timer and the same method!
    Like I said, I doubt this has any influence on what you observe.

    I know for a small project like this, it is silly to use the Graphics View architecture, but for the original project this is a requirement. I did however removed the Graphics View architecture as you suggested and then the QLabel updated correctly. However the original project still requires the Graphics View architecture for animations and stuff and I was under the impression that Qt 4.6.2 is a stable release.
    Ok but now we know QLabel::setText() is not the one causing problems.
    Last edited by wysota; 15th May 2010 at 18:29.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QLabel->setText() sometimes not working

    The example above works just fine for me on Linux with Qt 4.6.2. No skipped output. Could be a Windows-ism.

  3. #3
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QLabel->setText() sometimes not working

    Quote Originally Posted by cass View Post
    I reproduced the error noticed by the original project to a smaller compilable project: ...
    ChrisW67, it works for me too, on Windows (7) and Qt 4.6.2, so that's no windows issue.

Similar Threads

  1. QLabel setText Problem
    By pmabie in forum Qt Programming
    Replies: 10
    Last Post: 1st November 2007, 23:32
  2. Problem with QLabel and setText
    By jambrek in forum Qt Programming
    Replies: 7
    Last Post: 31st October 2007, 16:02
  3. Replies: 1
    Last Post: 26th November 2006, 09:32
  4. QLabel::setText() how to
    By freak in forum Qt Programming
    Replies: 1
    Last Post: 30th October 2006, 17:19
  5. setText not working
    By MarkoSan in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2006, 13:05

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.