Find cmakelists.txt and open it, just add it in the following location.
set(PROJECT_SOURCES
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
dialog.h //This is the dialog file added later
dialog.cpp //
dialog.ui //
)