Results 1 to 5 of 5

Thread: QProgress bar - Busy Indicator - Strange behaviour

  1. #1
    Join Date
    Aug 2010
    Posts
    30
    Thanks
    2

    Default QProgress bar - Busy Indicator - Strange behaviour

    I'm trying to add a Progress bar as a busy indicator. However, it's behaving strange - the 'progress' only goes a quarter of the way up the bar and then restarts at the beginning. I'm using the following code:

    test.cpp
    Qt Code:
    1. test::test()
    2. {
    3. QProgressBar *qProBar = new QProgressBar;
    4. qProBar->setRange(0,0);
    5.  
    6. QVBoxLayout *mainLayout = new QVBoxLayout();
    7. mainLayout->addWidget(qProBar);
    8.  
    9. setLayout(mainLayout);
    10. }
    To copy to clipboard, switch view to plain text mode 

    test.h
    Qt Code:
    1. class test : public QWidget
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. test();
    7. ~test();
    8. };
    To copy to clipboard, switch view to plain text mode 

    I couldn't find any similar problems on the net, and the code is as minimal as it can get. Any ideas? Thanks in advance!

  2. #2
    Join Date
    Dec 2010
    Location
    Russia
    Posts
    83
    Thanks
    1
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QProgress bar - Busy Indicator - Strange behaviour

    What's the point of setting the bar's range to 0 ? .

  3. #3
    Join Date
    Aug 2010
    Posts
    30
    Thanks
    2

    Default Re: QProgress bar - Busy Indicator - Strange behaviour

    http://doc.trolltech.com/latest/qpro...r.html#details

    "If minimum and maximum both are set to 0, the bar shows a busy indicator instead of a percentage of steps. This is useful, for example, when using QFtp or QNetworkAccessManager to download items when they are unable to determine the size of the item being downloaded."

  4. #4
    Join Date
    Dec 2010
    Location
    Russia
    Posts
    83
    Thanks
    1
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QProgress bar - Busy Indicator - Strange behaviour

    Ah , now i see. Works fine for me though...indicator runs the whole path repeatedly. Do you have any problems with displaying other widgets or it only happens with QStatusBar?

  5. #5
    Join Date
    Aug 2010
    Posts
    30
    Thanks
    2

    Default Re: QProgress bar - Busy Indicator - Strange behaviour

    Strange. I'm using Visual Studio 2010. I tried running my app under Release rather than Debug and the progress bar works as expected.
    Thanks anyway.

Similar Threads

  1. Busy Indicator using QProgressDialog??
    By qtzcute in forum Qt Programming
    Replies: 13
    Last Post: 6th September 2011, 12:31
  2. QProgressBar, stylesheet, and the busy indicator
    By latency in forum Qt Programming
    Replies: 0
    Last Post: 3rd September 2009, 02:10
  3. Need help: Strange behaviour
    By navi1084 in forum Qt Programming
    Replies: 3
    Last Post: 14th November 2008, 05:03
  4. QProgressBar busy indicator
    By Michiel in forum Qt Tools
    Replies: 2
    Last Post: 1st August 2007, 17:54
  5. very strange behaviour
    By regix in forum Qt Programming
    Replies: 23
    Last Post: 20th July 2006, 18:38

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.