I need help as I have no idea what I could be doing wrong. I have been trying to follow the Calc Form Example (http://doc.trolltech.com/4.7/designe...latorform.html) and can't for the life of me figure out what I am doing wrong.

Here are the error codes that are thrown when trying to compile:
Qt Code:
  1. ..\test\widget.cpp: In member function 'void Widget::on_def_valueChanged(int)':
  2. ..\test\widget.cpp:17: error: request for member 'total' in '((Widget*)this)->Widget::ui', which is of non-class type 'Ui::Widget*'
  3. ..\test\widget.cpp:17: error: request for member 'soc' in '((Widget*)this)->Widget::ui', which is of non-class type 'Ui::Widget*'
To copy to clipboard, switch view to plain text mode 

Here is widget.cpp:
Qt Code:
  1. #include "widget.h"
  2.  
  3. Widget::Widget(QWidget *parent) :
  4. QWidget(parent),
  5. ui(new Ui::Widget)
  6. {
  7. ui->setupUi(this);
  8. }
  9.  
  10. Widget::~Widget()
  11. {
  12. delete ui;
  13. }
  14.  
  15. void Widget::on_def_valueChanged(int value)
  16. {
  17. ui.total->setText(QString::number(value * 2 + ui.soc->value()));
  18. }
To copy to clipboard, switch view to plain text mode 

main.cpp:
Qt Code:
  1. #include <QtGui/QApplication>
  2. #include "widget.h"
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication a(argc, argv);
  7. Widget w;
  8. w.show();
  9.  
  10. return a.exec();
  11. }
To copy to clipboard, switch view to plain text mode 

widget.h:
Qt Code:
  1. #ifndef WIDGET_H
  2. #define WIDGET_H
  3.  
  4. #include <QWidget>
  5.  
  6. #include "ui_widget.h"
  7.  
  8. namespace Ui {
  9. class Widget;
  10. }
  11.  
  12. class Widget : public QWidget
  13. {
  14. Q_OBJECT
  15.  
  16. public:
  17. explicit Widget(QWidget *parent = 0);
  18. ~Widget();
  19.  
  20. private slots:
  21. void on_def_valueChanged(int value);
  22.  
  23. private:
  24. Ui::Widget *ui;
  25. };
  26.  
  27. #endif // WIDGET_H
To copy to clipboard, switch view to plain text mode 

and test.pro
Qt Code:
  1. #-------------------------------------------------
  2. #
  3. # Project created by QtCreator 2011-03-15T16:01:49
  4. #
  5. #-------------------------------------------------
  6.  
  7. QT += core gui
  8.  
  9. TARGET = test
  10. TEMPLATE = app
  11.  
  12.  
  13. SOURCES += main.cpp\
  14. widget.cpp
  15.  
  16. HEADERS += widget.h
  17.  
  18. FORMS += widget.ui
To copy to clipboard, switch view to plain text mode 

"def" and "soc" are qspinboxs, and "total" is a qlabel.

This should be simple, right? I'm sitting here banging my head against the wall.