Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 09-05-2009
Member
 
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 ()));
Reply With Quote
  #2  
Old 09-05-2009
Member
 
Join Date: May 2008
Posts: 2,293
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).
Reply With Quote
  #3  
Old 09-05-2009
Member
 
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"); 
     ) 
  );
Reply With Quote
  #4  
Old 09-05-2009
Member
 
Join Date: May 2008
Posts: 2,293
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 (.....);
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 03:06 PM.