And just notice that you close the namespace Ui. So your declaration is incorrect. It should be
Qt Code:
  1. class Ui::Widget: public QWidget;
To copy to clipboard, switch view to plain text mode 
Also it is a bit strange declaration. Is it designer-made class?