Results 1 to 20 of 35

Thread: busy progress bar without thread ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #20
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default Re: busy progress bar without thread ?

    Quote Originally Posted by jpn View Post
    Works for me:
    Qt Code:
    1. // main.cpp
    2. #include <QtGui>
    3.  
    4. int main(int argc, char* argv[])
    5. {
    6. QApplication app(argc, argv);
    7. QProgressBar progressBar;
    8. progressBar.setMinimum(0);
    9. progressBar.setMaximum(0);
    10. progressBar.show();
    11. return app.exec();
    12. }
    To copy to clipboard, switch view to plain text mode 
    Don't work... see

    Qt Code:
    1. QApplication app(argc, argv);
    2. QMainWindow window;
    3. QProgressBar* progressBar = new QProgressBar(&window);
    4. progressBar->setMaximumHeight(16);
    5. progressBar->setMaximumWidth(200);
    6. progressBar->setTextVisible(false);
    7. progressBar->setMaximum(0);
    8. progressBar->setMinimum(0);
    9.  
    10. progressBar->show(); // ??? don't move the bar
    11.  
    12. window.statusBar()->addPermanentWidget(progressBar);
    13. window.statusBar()->showMessage("Loading");
    14. window.show();
    15. app.exec();
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 4th December 2008 at 19:31. Reason: missing [code] tags

Similar Threads

  1. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49
  2. simple thread layout question
    By mhoover in forum Qt Programming
    Replies: 1
    Last Post: 12th August 2006, 11:02
  3. Replies: 11
    Last Post: 7th July 2006, 13:09
  4. [QT4] QThread and printing a QList<QPixmap>
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 21:44
  5. Replies: 2
    Last Post: 6th January 2006, 21:15

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.