Results 1 to 4 of 4

Thread: Initialize a progress bar in C++

  1. #1
    Join Date
    Apr 2009
    Posts
    79

    Initialize a progress bar in C++

    I want to make a button and a bar pogression, when I click on the button bar or initialize a new bar it returns to 0%.Here is my code, but "the program crashes "

    Code:
      m_initialiser = new QPushButton ( "Initialize", this); 
          m_initialiser -> move (600, 550); 
          QObject:: connect (m_initialiser, SIGNAL (clicked ()), m_progressbar, SLOT (reset ()));

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Initialize a progress bar in C++

    The program crashes on execution or compilation?
    And what is the error report? (if it crashes to the compilation).

  3. #3
    Join Date
    Apr 2009
    Posts
    79

    Re: Initialize a progress bar in C++

    it was the problem in order to call the function :
    Code:
    class Example: public QWidget 
      ( 
         Q_OBJECT 
       
         QPushButton * bt_m; 
         QVector <QLineEdit *> le_m; 
    
         public: 
         Example () 
         ( 
            bt_m = new QPushButton ( "Click", this); 
            le_m. push_back (new QLineEdit (this)); 
               connect (le_m. back (), SIGNAL (triggered ()), this, SLOT (doSomething ())); 
            le_m. push_back (new QLineEdit (this)); 
               connect (le_m. back (), SIGNAL (triggered ()), this, SLOT (doSomething ())); 
         ) 
    
         private slots: 
         void doSomething () 
         ( 
             le_m [0] -> setText ( "hi"); 
             le_m [1] -> setText ( "hello"); 
         ) 
      );

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: Initialize a progress bar in C++

    I was wrong if you connect m_progressbarre even before creation?
    It's where I think the object sender and receiver must exist before the execution of connect (.....);

Similar Threads

  1. How to reset Co-Op progress in Portal 2?
    By Delightful. in forum Video Games
    Replies: 7
    Last Post: 29-04-2011, 01:17 PM
  2. I cannot see the progress bar in the Status Bar
    By Allinone in forum Technology & Internet
    Replies: 3
    Last Post: 27-02-2011, 06:05 AM
  3. Windows 7 is now progress or not
    By SajalSOFT in forum Operating Systems
    Replies: 4
    Last Post: 09-12-2010, 07:29 AM
  4. PHP CLI progress bar
    By Bambina in forum Software Development
    Replies: 2
    Last Post: 26-08-2009, 11:49 PM
  5. Animated GIF Progress Bar
    By Nawvin in forum Software Development
    Replies: 3
    Last Post: 16-07-2009, 09:11 AM

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
  •  
Page generated in 1,714,078,211.20462 seconds with 17 queries