I have a QStatusBar at the bottom of my gui, and added a QProgressBar and a QLabel to it; I have a counter that increments the QProgressBar's value every second, and while that's going on, I'm setting the QLabel text to a string that confirms the user that a file was saved.

SO the progress bar kept getting bigger and bigger after each iteration, and started eating up the QLabel; so I set a fized width for it. Then I realized that somehow the QLabel's text kept moving one character over to the left (towards the progress bar), and eventually other strings I defined in completely different places, like inside of dialog boxes in other methods, started popping up in the QLabel..I'm not sure how else to describe it.
I'm only setting the text of the QLabel in one place.

Am I doing something wrong here? Or is there something else I'm possibly forgetting?

Thanks!

Qt Code:
  1. //in header file:
  2. QStatusBar *stat;
  3. QLabel *barStatus;
  4.  
  5. //in constructor:
  6. barStatus = new QLabel ( tr ("Ready" ) );
  7. bar = new QProgressBar(this);
  8. bar -> setFixedWidth(175);
  9.  
  10. stat = new QStatusBar(this);
  11. stat -> addWidget(bar, Qt::AlignLeft);
  12. stat -> addWidget(barStatus, Qt::AlignRight);
  13.  
  14. //in other method that updates counter
  15. bar -> setValue(counter);
  16. barStatus -> clear();
  17. barStatus -> setText("Saved /home/../output" + counter);
To copy to clipboard, switch view to plain text mode