TL;DR; Add #include "ui_Task.h" in your Task.cpp file.
Longer explanation - the uic tool takes the Task.ui file and generates ui_Task.h header, which contains the definition for the Ui::Task class. This header is to be included in your Task.cpp file so that you can use it to initialize your ui by first creating an instance of that class (it's the new Ui::Task line that gives you the error about incomplete type) and then calling ui->setupUi(this) on it.
Compare that with the wizard generated code - see the #include "ui_Mainwindow.h" line in the Mainwindow.cpp file.