Hey all,

Complete noob to QT here. I am trying to write a gui for a program that I wrote in traditional c++ (command line application) - I want to populate a label widget with a value when I push a button on the GUI. The label's objectName is "label" - and my code looks something like this:

Qt Code:
  1. #include "brachygui.h"
  2. #include "ui_brachygui.h"
  3. #include <QLabel>
  4.  
  5. BrachyGUI::BrachyGUI(QWidget *parent) :
  6. QMainWindow(parent),
  7. ui(new Ui::BrachyGUI)
  8. {
  9. ui->setupUi(this);
  10. }
  11.  
  12. BrachyGUI::~BrachyGUI()
  13. {
  14. delete ui;
  15. }
  16.  
  17. void BrachyGUI::on_pushButton_clicked()
  18. {
  19. label->setText("Monday");
  20. }
To copy to clipboard, switch view to plain text mode 

When I build, I get the error "error: 'label' was not declared in this scope". Where do I define the label, or is it already defined somewhere, and I need to access it differently? I've searched the forums and google, but haven't been able to work it out

Thanks in advance.